Skip to content

Instantly share code, notes, and snippets.

@michaeljclark
Last active May 4, 2021 03:02
Show Gist options
  • Save michaeljclark/edefa9955798640a0433a038e0c99206 to your computer and use it in GitHub Desktop.
Save michaeljclark/edefa9955798640a0433a038e0c99206 to your computer and use it in GitHub Desktop.
script that uses xxd and objdump to allow interactive decode of x86 instructions
#!/bin/sh
T=$(mktemp fooXXXXXX)
echo $* | xxd -r -p - > ${T}
objdump -D -bbinary -mi386:x86-64 -Mintel ${T} | \
sed -n '/<.data>:/{n;s/0://g p}'
rm -f ${T}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment