Function to reverse a shellcode array in 0x format */
| 283 | |
| 284 | /* Function to reverse a shellcode array in 0x format */ |
| 285 | void reverseShellcode(unsigned char *shellcode, int size) { |
| 286 | int i; |
| 287 | unsigned char temp; |
| 288 | for (i = 0; i < size/2; i++) { |
| 289 | temp = shellcode[size-i-1]; |
| 290 | shellcode[size-i-1] = shellcode[i]; |
| 291 | shellcode[i] = temp; |
| 292 | } if (size % 2 != 0) { shellcode[size/2] = shellcode[size/2]; } |
| 293 | } |
| 294 | |
| 295 | |
| 296 |