Open JohnRyk opened 4 years ago
For some reason this code do not work for me :
for i in `objdump -d shellcode.o | tr '\t' ' ' | tr ' ' '\n' | egrep '^[0-9a-f]{2}$' ` ; do echo -n "\x$i" ; done
And I found that you can use the following code to extract hexadecimal shellcode from the objdump disassemble output :
for i in `objdump -d shellcode.o | tr '\t' ' ' | tr ' ' '\n' | egrep '^[0-9a-f]{2}$' ` ; do printf \\%c%b x $i ; done
For anyone reading this. Do not expect portability from shell scripts. Unix has x number of lineages and descendants, each with slightly different implementations -> always try out shell scripts before using them :)
For some reason this code do not work for me :
And I found that you can use the following code to extract hexadecimal shellcode from the objdump disassemble output :