View Full Version : ARM Thumb disassembler library

11-07-2003, 07:21 AM
For a tool I am making I need to disassemble Thumb instructions, I'm currently using IDA but I need something I can link into my own program.
Does anyone have a link to a (preferably open source) library or program that can do just that?

11-07-2003, 08:40 AM
Download source code of binutils from http://www.gnu.org/software/binutils/
and there is a target for ARM (it can assemble and dissamble ARM/Thumb instructions). You must find it in source code and use it. I have used this way an ARM emulator from GNU GCC and there was no problem to use it.

11-07-2003, 08:47 AM
Yup, Gnu GDB armulator was already on my list of things to try out, if I only knew enough anout the Nokia hardware to make a phone simulator :-)

Does that binutils ARM (dis)assembler have the same braindead syntax as the gas 80x86 assembler? I mean, that the arguments on MOV instructions are reversed.
MOV <source>,<destination> instead of MOV <destination>,<source>

That's confusing at least.

11-07-2003, 09:23 AM
For ARM it looks like this:
200040: e3a01602 mov r1, #2097152 ; 0x200000
200044: e5910000 ldr r0, [r1]
200048: e0201860 eor r1, r0, r0, ror #16
20004c: e3c118ff bic r1, r1, #16711680 ; 0xff0000
200050: e1a00460 mov r0, r0, ror #8
200054: e0200421 eor r0, r0, r1, lsr #8
200058: e3a01701 mov r1, #262144 ; 0x40000
20005c: e5810000 str r0, [r1]
200060: e10f2000 mrs r2, CPSR
And for Thumb:
2000f4: 481f ldr r0, [pc, #124] (0x200174)
2000f6: 4920 ldr r1, [pc, #128] (0x200178 )
2000f8: 1a09 sub r1, r1, r0
2000fa: 2200 mov r2, #0
2000fc: 2300 mov r3, #0
2000fe: 2400 mov r4, #0
200100: 2500 mov r5, #0
200102: 2600 mov r6, #0
200104: 2700 mov r7, #0
200106: e007 b 0x200118

11-07-2003, 09:33 AM
Wow, then it's exactly what I need - thanks

29-07-2003, 11:54 PM
you also can use the GBA-emu source...
its "somewhat" smaller ;))
its a gameboy advance emulator which has the same cpu
it also allows to disassemble the code (ARM/THUMB)