Created
March 22, 2017 15:37
-
-
Save walac/11b9579378ee83f1eedd40b8d402768c to your computer and use it in GitHub Desktop.
Generate the assembly code for firefox binaries
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
!/bin/bash | |
set -euxv | |
mount() { | |
hdiutil attach -noautofsck -mountpoint $2 $1 \ | |
| tail -1 \ | |
| awk '{print substr($0, index($0,$3))}' | |
} | |
umount() { | |
hdiutil detach $1 | |
} | |
obj_assembly_dump() { | |
objdump -disassemble -no-show-raw-insn -no-leading-addr $1 \ | |
| sed -e 's/[0-9a-f]*://' | |
} | |
tc_dmg=target.dmg | |
bb_dmg=$(ls -1 firefox*.mac.dmg | tail -1) | |
tc_mount_point="$(mount $tc_dmg /Volumes/Nightly_tc)" | |
bb_mount_point="$(mount $bb_dmg /Volumes/Nightly_bb)" | |
for i in firefox-bin XUL; do | |
obj_assembly_dump "$tc_mount_point/Nightly.app/Contents/MacOS/$i" > $i.tc.s | |
obj_assembly_dump "$bb_mount_point/Nightly.app/Contents/MacOS/$i" > $i.bb.s | |
done | |
umount "$tc_mount_point" | |
umount "$bb_mount_point" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment