Created
March 2, 2020 20:51
-
-
Save Ddorda/ae9ee21abfe35b569cb5e3b2a726cd15 to your computer and use it in GitHub Desktop.
Convert assembly to shellcode. include in your bashrc file.
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 asmbler() | |
{ | |
f=$(mktemp) | |
cat<<EOF>${f}.s | |
.globl _main | |
.intel_syntax noprefix | |
_main: | |
EOF | |
while read -r line; do | |
echo "$line" >> ${f}.s | |
done | |
gcc -o $f -c ${f}.s | |
objdump -d $f | tail -n +8 | cut -f2 -d:|cut -f1-6 -d' '|tr -s ' '|tr '\t' ' '|sed 's/ $//g'|sed 's/ /\\x/g'|paste -d '' -s | |
rm ${f}.s ${f} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment