Created
July 8, 2014 08:46
-
-
Save inaz2/003bf82ecbc29725e5d3 to your computer and use it in GitHub Desktop.
convert between asm and opcodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function asm() { | |
echo "$*" | as -msyntax=intel -mnaked-reg -aln -o /dev/null | |
} | |
function disas() { | |
echo "$*" | perl -ne 's/([0-9A-Fa-f]{2})/print pack("H2",$1)/eg' >/tmp/disasm && objdump -M intel -D -b binary -m i386 /tmp/disasm | tail -n+8 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ asm jmp esp | |
1 0000 FFE4 jmp esp | |
$ disas ff e4 | |
0: ff e4 jmp esp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment