Last active
October 7, 2019 06:55
-
-
Save jdonszelmann/b74bc5f99c535eedbc87ff020d9f741c to your computer and use it in GitHub Desktop.
compile semicolon seperated assembly instructions and hexdump
This file contains hidden or 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
#!/usr/bin/bash | |
if [ -p /dev/stdin ]; then | |
stdinput=`cat` | |
else | |
stdinput="" | |
fi | |
params="${@}" | |
echo "$stdinput; $params" | sed -e $'s/;/\\\n/g' | as -o tmp.o | |
ld --entry=0x0 -Ttext 200000 --oformat binary -o tmp.bin tmp.o | |
rm tmp.o | |
objdump -D -b binary -mi386:x86-64 tmp.bin | |
rm tmp.bin | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example:
echo "inc %al | dumpasm"
dumpasm inc %al
dumpasm inc %al; inc %ah