]> snippets.scripts.mit.edu Git - Scripts/git/.git/blobdiff - programming/disasm
disasm: Disassemble hex bytes given on the command line as x86
[Scripts/git/.git] / programming / disasm
diff --git a/programming/disasm b/programming/disasm
new file mode 100755 (executable)
index 0000000..0531dc5
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+file=$(mktemp)
+echo "$*" | xxd -r -p > "$file"
+objdump -D -b binary -m i386 "$file" | tail -n +7
+rm "$file"