Difference between revisions of "Working with binaries"

From freemyipod.org
Jump to: navigation, search
(Added section about IDA)
Line 22: Line 22:
 
arm-elf-objcopy --set-section-flags .data=code dump.elf
 
arm-elf-objcopy --set-section-flags .data=code dump.elf
 
</pre>
 
</pre>
 +
 +
==Helpful pages==
 +
http://chdk.wikia.com/wiki/GPL_Disassembling
 +
 +
http://www.dwelch.com/ipod/

Revision as of 03:35, 13 July 2010

Compiling for the ARM platform requires a special toolchain. The GNU ARM toolchain has all the basic tools needed to build and examine software on the iPod.

Obtaining

The GNU ARM toolchain can be downloaded from http://www.gnuarm.com/. You can either download source or binaries. Put the binaries in your system path.

Assembling

arm-elf-as -o test.o test.asm
arm-elf-ld -e 0 -Ttext=0 -o test.elf test.o
arm-elf-objcopy -O binary test.elf test.bin

Disassembling

arm-elf-objdump -bbinary -marmv4 -D test.bin > test.asm

Preparing for IDA Pro demo

The IDA Pro demo can't open raw ARM files but it can open ELF files. We need to convert the raw binaries to ELF binaries as a workaround. Assuming the input file is called "dump.bin" and the output will be called "dump.elf", run these commands:

arm-elf-objcopy --change-addresses=0xff810000 -I binary -O elf32-littlearm -B arm dump.bin dump.elf
arm-elf-objcopy --set-section-flags .data=code dump.elf

Helpful pages

http://chdk.wikia.com/wiki/GPL_Disassembling

http://www.dwelch.com/ipod/