Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,481,827
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-25-24 01:08 PM
Guest: Register | Login

0 users currently in ROM Hacking | 2 guests

Main - ROM Hacking - Working on a GB disassembler New thread | New reply


Dwedit
Posted on 04-07-09 07:54 AM Link | Quote | ID: 104690


Red Paratroopa
Level: 30

Posts: 149/162
EXP: 163129
Next: 2740

Since: 03-07-07
From: Chicago

Last post: 3517 days
Last view: 1612 days
I'm working on a Gameboy disassembler. I've already made a Z80 disassembler for the TI calculators, so converting it to GB shouldn't be too hard.
It will crawl all over the file to locate where the code is, and everything else is tagged as "data". It makes labels for all 16 bit values, whether jumped there or used as a 16 bit load.
It will also let you rename the labels, and re-disassemble to use the new names.
Any features you want to see in the program?

____________________

blackhole89
Posted on 04-07-09 02:10 PM Link | Quote | ID: 104698


The Guardian
Moloch whose eyes are a thousand blind windows!
Level: 124

Posts: 2420/4196
EXP: 21531385
Next: 305216

Since: 02-19-07
From: Ithaca, NY, US

Last post: 470 days
Last view: 83 days



That sounds like it would be similar to IDA's disassembler.

This "crawling" you are talking about... would it just scan through the flat file for anything that looks like code or instead try to trace jumps and branches from interrupt vectors or anything similar?

____________________



Dwedit
Posted on 04-07-09 02:41 PM Link | Quote | ID: 104700


Red Paratroopa
Level: 30

Posts: 150/162
EXP: 163129
Next: 2740

Since: 03-07-07
From: Chicago

Last post: 3517 days
Last view: 1612 days
It follows jumps and calls, and interrupt vectors.

____________________

Kawa
Posted on 04-07-09 06:23 PM Link | Quote | ID: 104707


CHIKKN NI A BAAZZKIT!!!
80's Cheerilee is best pony
Level: 138

Posts: 1748/5344
EXP: 30942631
Next: 720350

Since: 02-20-07
From: The Netherlands

Last post: 4497 days
Last view: 2632 days
So... like IDA, then.

This should be interesting.

____________________
Wife make lunch - Shampoo
Opera - give it a spin
Spare some of your free time?
<GreyMaria> I walked around the Lake so many goddamn times that my sex drive was brutally murdered
Kawa rocks — byuu

Raccoon Sam
Posted on 04-07-09 08:57 PM Link | Quote | ID: 104718


Cobrat
Level: 56

Posts: 617/672
EXP: 1379926
Next: 18250

Since: 02-19-07
From: Hi

Last post: 3467 days
Last view: 2698 days
Sounds very snazzy.
I'm also assuming you're going with wxWidgets with this one as well, which is a spark that might light the fire of cross-platform portability yet again.

____________________


Dwedit
Posted on 04-07-09 11:37 PM Link | Quote | ID: 104727


Red Paratroopa
Level: 30

Posts: 151/162
EXP: 163129
Next: 2740

Since: 03-07-07
From: Chicago

Last post: 3517 days
Last view: 1612 days
I've just noticed that Catrap performs indirect jumps by moving the stack pointer around, and returning.
That's gotta be really hard to add detection for that kind of thing to any disassembler.

____________________

RT-55J
Posted on 04-08-09 05:26 AM Link | Quote | ID: 104745

Armor Guardian
Level: 81

Posts: 1115/1562
EXP: 4888847
Next: 104002

Since: 02-23-07
From: Wild Side Arcade

Last post: 313 days
Last view: 54 days
Have you figured out how to deal with games that execute code from RAM, or is the GB unable of actually doing that?

smkdan
Posted on 04-08-09 07:37 AM Link | Quote | ID: 104751


Ninji
Level: 36

Posts: 210/238
EXP: 288628
Next: 19482

Since: 05-26-07

Last post: 4061 days
Last view: 4011 days
Posted by RT-55J
Have you figured out how to deal with games that execute code from RAM, or is the GB unable of actually doing that?


there's no reason the GB can't do it, it's actually required to DMA sprite data if it's not in video memory (mostly it isn't).

dwedit do you have any details of how comprehensive your code crawl is, i mean something as a common as a jump table i can't see being accountable unless it's a brilliant disassembler that can somehow make sense of the logic used to calculate the addresses used to jump to, or if the disassembler has some help from the user to tag the address tables (if that's what the game uses) and the locations of the code to jump to to disassemble.

Dwedit
Posted on 04-08-09 07:38 AM (rev. 2 of 04-08-09 07:39 AM) Link | Quote | ID: 104752


Red Paratroopa
Level: 30

Posts: 152/162
EXP: 163129
Next: 2740

Since: 03-07-07
From: Chicago

Last post: 3517 days
Last view: 1612 days
Whenever the gameboy does sprite DMA, which is the way to get sprites into OAM (sprite memory), the CPU will only correctly execute code stored into high ram at FF80+ until the sprite DMA is complete. So games will always load some delay code into FF80.

Since it's all relative jumps inside, I don't think that little procedure which every game loads is worth automatically disassembling. Besides, you can always add it to the disassembly list for everything it misses.

In general though, games don't often load code into ram.




Right now, I just added support for simple jump tables (detected as long as they use RST 28, and code is sandwiched between there and the next label)

____________________

Main - ROM Hacking - Working on a GB disassembler New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.022 seconds. (339KB of memory used)
MySQL - queries: 62, rows: 90/91, time: 0.016 seconds.