Skip to content

Instantly share code, notes, and snippets.

@t94j0
Created December 2, 2016 16:12
Show Gist options
  • Save t94j0/684fbab0e46e8765bea49fb4c3d856f8 to your computer and use it in GitHub Desktop.
Save t94j0/684fbab0e46e8765bea49fb4c3d856f8 to your computer and use it in GitHub Desktop.
Getting shellcode from an objdump. Typically used for ASM. Just use `get_shellcode BINARY`
function get_shellcode
objdump -d ./$argv[1]|grep '[0-9a-f]:'|grep -v 'file'|cut -f2 -d:|cut -f1-6 -d' '|tr -s ' '|tr '\t' ' '|sed 's/ $//g'|sed 's/ /\\x/g'|paste -d '' -s |sed 's/^/"/'|sed 's/$/"/g'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment