#99174 - DimondEdge - Sat Aug 19, 2006 10:53 pm
Hi!
I have the arm9.bin from ndstool, and I'd like to dissassemble/reassemble it.
I've been looking around, and none of the programs I've found will disassemble a .bin.
Are there any programs that can do that?
Thanks,
DimondEdge
#99175 - tepples - Sat Aug 19, 2006 10:56 pm
arm-eabi-objdump can be configured to do this.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#99176 - Sausage Boy - Sat Aug 19, 2006 10:59 pm
To quote chishm:
Quote: |
For ARM compiled files I use the command:
arm-elf-objdump -D -b binary -m arm infile.bin > outfile.s
and for THUMB compiled files I use:
arm-elf-objdump -D -b binary -m arm -M force-thumb infile.bin > outfile.s |
_________________
"no offense, but this is the gayest game ever"
#99182 - dexter0 - Sat Aug 19, 2006 11:29 pm
Anyway to tell if the code is THUMB or ARM?
#99234 - chishm - Sun Aug 20, 2006 5:32 am
Those will be arm-eabi-objdump in the latest versions of DevkitPro. You can usually tell ARM code from Thumb code / data by using a hex edittor. The highest nibble of the 4-byte, little-endian instructions is usually 0xE, (ARM condition code for "always") in ARM code, so you'll see many E's in that position. Thumb code and data are more tightly packed than that, so don't have any pattern that I've noticed.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com
#99251 - AnalogMan - Sun Aug 20, 2006 8:47 am
And to reassemble it?
#99264 - LiraNuna - Sun Aug 20, 2006 10:43 am
arm-eabi-as
_________________
Private property.
Violators will be shot, survivors will be shot again.
#99303 - DimondEdge - Sun Aug 20, 2006 4:24 pm
Thanks Everyone!
That all works great!
DE
#99363 - DimondEdge - Mon Aug 21, 2006 2:32 am
Hmm... when trying to reassemle with arm-eabi-as, it gives me about
20000 errors (no exageration).
I'm guessing I need a few flags, but I don't know which.
#99372 - HyperHacker - Mon Aug 21, 2006 4:19 am
Disassemblers rarely produce re-assembleable code. They like to add addresses and junk. Not sure about this one, but if you see incrementing numbers on each line, it probably is.
_________________
I'm a PSP hacker now, but I still <3 DS.
#99376 - tepples - Mon Aug 21, 2006 4:47 am
If so, this might be your opportunity to sit down and learn Sed.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#99398 - chishm - Mon Aug 21, 2006 9:30 am
Rather than reassembling disassembled output, I generally write a small amount of code, compile it, then use a hex editor to patch the binary with it.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com
#99420 - DimondEdge - Mon Aug 21, 2006 2:42 pm
chishm wrote: |
Rather than reassembling disassembled output, I generally write a small amount of code, compile it, then use a hex editor to patch the binary with it. |
I'll try that, but is there a spesific patching program I should use? I'm
thinking IPSwin or bspatch, unless theres a better one...
Ok, now I gotta debug :P ...
DE