Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 485 Bytes

compile_asm.md

File metadata and controls

18 lines (13 loc) · 485 Bytes

Compile:

as shell.s -o hello.o

Link:

ld -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem hello.o -e _main -o hello

Extract Shell code:

for i in $(objdump -d ./hello | grep ": " | cut -f2 -d : | cut -f1);do echo -n $i; done; echo

Base64 encode it:

echo -n | xxd -r -p | base64encode