assemble arm/x86 instruction

My first blog post ^^

here is command line to assemble one arm instruction to get it’s memory representation

echo "sub pc,pc,pc" > /tmp/aa.txt ; arm-linux-gnueabi-as /tmp/aa.txt -o/tmp/a.o; arm-linux-gnueabi-objdump -d /tmp/a.o | sed -rn "s/.*\s+([a-f0-9]{8})\s+.*/\1/p"

what it might be useful for? maybe patching arm binary in memory or on disk


this is the x86 version

echo "call 0xffffffff" > /tmp/aa.txt ; as /tmp/aa.txt -o/tmp/a.o; objdump -d /tmp/a.o | sed -rn "s/.*[0-9]+:\s+(([a-f0-9]+\s+)+)\s+.*/\1/p"

Leave a Comment