#25666 - ^pb^ - Thu Aug 26, 2004 7:42 pm
someone have a program that show the code of GBA? i mean something like
convert GBA to ASM
can you?
#25668 - Lord Graga - Thu Aug 26, 2004 8:18 pm
It is possible. Yet, there's still a large amount of "garbage" code (i.e, code which is actually graphics, etc) which has to be taken care of. Disassembling larger programs is very hard.
I don't know any binary disassemblers, sorry.
#25680 - tepples - Thu Aug 26, 2004 10:56 pm
Lord Graga wrote: |
Yet, there's still a large amount of "garbage" code (i.e, code which is actually graphics, etc) which has to be taken care of. |
There exist tracing emulators for some platforms such as the NES. I don't know whether there exists a VBA fork to do this nor whether one of the paid versions of no$gba can do this, but by watching a program run, such an emulator could identify code segments (code to be disassembled), data referred to in CpuSet/CpuFastSet/DMA (uncompressed data, with the destination address distinguishing the various types of data), data referred to in *UncompVram (compressed graphics data), data read from ROM in a typical audio mixer access pattern (LDRSBs to ROM in a generally increasing pattern), and the like. Then it would distinguish among them in the disassembly.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#25705 - gb_feedback - Fri Aug 27, 2004 2:05 pm
IDA http://www.datarescue.com will certainly do this. Not cheap, and in my experience, struggles rather when telling it to switch between ARM and THUMB.
It disassembles by following the code, including calls and jumps.
_________________
http://www.bookreader.co.uk/
#25711 - MumblyJoe - Fri Aug 27, 2004 4:39 pm
Actually, I set up a set of batch files and vba sdl version and so forth to disassemble gba roms for me a while back, I'm not at my house right now so I cant remember the exact code or test it but it used I/O redirection to do it.
I wrote a program that took the size of a file and divided it by 2 for thumb and 4 for arm and generated batch files to run vba sdl version and used I/O redirection to send text files for input and take output as asm. It always had a bit of shit at the start but I didn't want to compile it anyway, just look at it, so whatever.
If I get home tomorow I will post the code for what I originally did...
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#25731 - torne - Fri Aug 27, 2004 7:24 pm
I've never had any problems with ARM/Thumb switches using IDA...
#25735 - gb_feedback - Fri Aug 27, 2004 10:10 pm
Quote: |
I've never had any problems with ARM/Thumb switches using IDA... |
The effect I seemed to get when I tried it was that IDA didn't automatically switch to arm or thumb. When it followed calls it stayed in the same mode that it was in. Which meant that you got something disassembled to your satisfaction in say ARM mode, and then IDA followed another path to the same bit of code and switched it all back to thumb (effectively trashing it).
This was a couple of years ago. It may not be the same now. Or more likely I just didn't know what I was doing, as the documentation is slightly sparse. If you have any tips, I love to hear them. Also which version are you using? My support ran out before I downloaded any updates.
_________________
http://www.bookreader.co.uk/
#25742 - MumblyJoe - Fri Aug 27, 2004 11:32 pm
I was under the impression that IDA was commercial software, or am I wrong?
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#25743 - sajiimori - Fri Aug 27, 2004 11:34 pm
It is commercial.
#25747 - MumblyJoe - Sat Aug 28, 2004 1:59 am
Anyway, as I was saying earlier, I use batch files etc to disassemble. Give this a shot if you want (Windows batch but easily done with linux etc):
disasm.bat:
Code: |
set size=%2
set /A thumbsize=size/2
echo dt 8000000 %thumbsize% > in.txt
echo q >> in.txt
echo y >> in.txt
VisualBoyAdvance-SDL.exe -d %1 < in.txt > thumb.S
set /A armsize=size/4
echo da 8000000 %thumbsize% > in.txt
echo q >> in.txt
echo y >> in.txt
VisualBoyAdvance-SDL.exe -d %1 < in.txt > arm.S |
usage:
Code: |
disasm somerom.gba 34823
|
where the number is the size of the rom in bytes (or less if you only want the start etc).
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#25780 - torne - Sat Aug 28, 2004 9:56 am
gb_feedback wrote: |
The effect I seemed to get when I tried it was that IDA didn't automatically switch to arm or thumb. When it followed calls it stayed in the same mode that it was in. Which meant that you got something disassembled to your satisfaction in say ARM mode, and then IDA followed another path to the same bit of code and switched it all back to thumb (effectively trashing it). |
That's fixed now. It correctly handles bx when it's possible to determine the low bit of the register branched to, and it doesn't seem to change its mind about whether code is ARM or Thumb any more. ;)
I don't have many specific tips; I don't use it for the GBA much, I mostly use the PowerPC mode to disassemble GCN stuff. I use the latest version of Pro Advanced, 4.6 SP1 (complete with fruity 64-bit support for my AMD64, yay) because I have it through a group licence which I don't pay for =)
#25781 - gb_feedback - Sat Aug 28, 2004 11:22 am
Thanks for that info. I'll have to see if I can persuade my company to cough up again.
_________________
http://www.bookreader.co.uk/
#25782 - ^pb^ - Sat Aug 28, 2004 2:08 pm
i isnt realy understand what i need to do to compailer form GBA to ASM?
#25785 - f(DarkAngel) - Sat Aug 28, 2004 3:09 pm
Do you mean converting binary to assembly code?
GNU toolchain has objdump which can do disassembling.
objdump -d binary_file
To see the asm code generated by gcc for a input, you can use -S.
Or do you mean a simulator? Then VBA/GDB or CowBite (not as accurate as VBA) will do this.
_________________
death scream...
#25822 - Miked0801 - Sun Aug 29, 2004 1:44 am
Just stop. This thread is very similiar to a previous question that he/she asked. There is no clue level here high enough to justify going too deep into the discussion. He wants to hack and translate a game he likes from English to Hebrew. The general answer there was good luck as well...