Function to reverse a shellcode array in 0x format
| 2 | |
| 3 | // Function to reverse a shellcode array in 0x format |
| 4 | void reverseShellcode(unsigned char *shellcode, int size) { |
| 5 | int i; |
| 6 | unsigned char temp; |
| 7 | for (i = 0; i < size/2; i++) { |
| 8 | temp = shellcode[size-i-1]; |
| 9 | shellcode[size-i-1] = shellcode[i]; |
| 10 | shellcode[i] = temp; |
| 11 | } |
| 12 | if (size % 2 != 0) { |
| 13 | shellcode[size/2] = shellcode[size/2]; |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | int main() { |
| 18 | // Example shellcode array in 0x format |