title: Shellcoding Tips categories: [cheatsheets]
For:
mov eax, 0
Use:
xor eax, eax ; to clear/zero a register
For:
mov ebx, 0x00XX
Use:
mov ebx, 0x11XX
shle 0x8
shr 0x8
for i in $(objdump -d <objfile.o> |grep "^ " |cut -f2); do echo -n '\x'$i; done; echo
char shellcode[] = "H1 ....";
int main() {
int(*ret)() = (int(*)())shellcode;
ret();
return 0;
}