Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract the hexadecimal shellcode #6

Open
JohnRyk opened this issue Nov 26, 2019 · 1 comment
Open

Extract the hexadecimal shellcode #6

JohnRyk opened this issue Nov 26, 2019 · 1 comment

Comments

@JohnRyk
Copy link

JohnRyk commented Nov 26, 2019

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
@chettriyuvraj
Copy link

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants