#include #include #include #include int main(void) { unsigned char reversed_payload [42] = {0x17, 0x25, 0x17, 0x25, 0x17, 0x78, 0x17, 0x60, 0x17, 0x6d, 0x17, 0x64, 0x17, 0x79, 0x17, 0x7e, 0x17, 0x72, 0x17, 0x78, 0x17, 0x60, 0x17, 0x6d, 0x17, 0x64, 0x17, 0x79, 0x17, 0x7e, 0x17, 0x72, 0x17, 0x63, 0x17, 0x64, 0x17, 0x72, 0x17, 0x63, 0xe9, 0xe8}; char shellcode[sizeof(reversed_payload)] = {0}; unsigned int len = sizeof(reversed_payload); int xorkey = 23; // reverse and de-xor our array of ints for (int i = 0; i < len; i++) { char decoded = reversed_payload[len - i - 1] ^ xorkey; shellcode[i] = decoded; } int idx = 0; while (idx < sizeof(reversed_payload)) { if (idx == (sizeof(reversed_payload) - 1)) { printf("0x%02x ", (unsigned char)shellcode[idx]); } else { printf("0x%02x, ", (unsigned char)shellcode[idx]); } idx++; } return 0; }