Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2016-04-22 11:24:08

Luca91
New member
Registered: 2013-02-26
Post 8/8

What disassebler have you used on pokered/pokecrystall ?

Hello,
I'd like to know what disassembler have you used to disassemble pokered and pokecrystall.

Thank you!

Last edited by Luca91 (2016-04-22 11:25:21)

Offline

#2 2016-04-22 16:12:51

ShantyTown
Member
Registered: 2013-12-04
Post 284/341

Re: What disassebler have you used on pokered/pokecrystall ?

In the pokemon-reverse-engineering-tools project (the 'extras' submodule in pokered and pokecrystal), there is a script called:
https://github.com/pret/pokemon-reverse … 0disasm.py

This script is a generic disassembler, so you can use it to dump code from any GameBoy ROM.

Offline

#3 2016-04-24 00:43:15

Fotomac
Member
Registered: 2015-10-25
Post 203/294

Re: What disassebler have you used on pokered/pokecrystall ?

How do you use this script?

Offline

#4 2016-04-24 04:01:33

ShantyTown
Member
Registered: 2013-12-04
Post 285/341

Re: What disassebler have you used on pokered/pokecrystall ?

Fotomac wrote:

How do you use this script?

python gbz80disasm.py <ROM address>

Offline

#5 2016-04-24 06:25:27

Fotomac
Member
Registered: 2015-10-25
Post 204/294

Re: What disassebler have you used on pokered/pokecrystall ?

And you type it in Cygwin, right? Or is there a different program you gotta use to load the script?

Also, what does <ROM address> stand for, for example?

Offline

#6 2016-04-24 10:35:20

Miksy91
Member
Registered: 2010-10-16
Post 2,252/2,308

Re: What disassebler have you used on pokered/pokecrystall ?

Fotomac wrote:

And you type it in Cygwin, right? Or is there a different program you gotta use to load the script?

Also, what does <ROM address> stand for, for example?

You type that in command line. It needs to know command 'python' for running python code though.


if __name__ == "__main__":
    conf = configuration.Config()
    disasm = Disassembler(conf)
    disasm.initialize()

    addr = sys.argv[1]
    if ":" in addr:
        addr = addr.split(":")
        addr = int(addr[0], 16)*0x4000+(int(addr[1], 16)%0x4000)
    else:
        label_addr = disasm.find_address_from_label(addr)
        if label_addr:
            addr = label_addr
        else:
            addr = int(addr, 16)

For example these three lines

if ":" in addr:
        addr = addr.split(":")
        addr = int(addr[0], 16)*0x4000+(int(addr[1], 16)%0x4000)

here stand for the fact that if <ROM address> is form "bank":"pointer", it produces address "bank * 0x4000 + pointer % 0x4000" based on that. So you can for example give the address in that (big indian) format. Also, I'd assume you can also give a label from disassembly as the address based on the "else" branch.

Last edited by Miksy91 (2016-04-24 10:39:08)

Offline

#7 2016-04-24 23:24:18

Fotomac
Member
Registered: 2015-10-25
Post 205/294

Re: What disassebler have you used on pokered/pokecrystall ?

I still think there's stuff I need to learn before even attempting to disassemble the Japanese versions of the games. Is there anything else I need to know?

Offline

#8 2016-04-25 00:13:33

ShantyTown
Member
Registered: 2013-12-04
Post 289/341

Re: What disassebler have you used on pokered/pokecrystall ?

Fotomac wrote:

Is there anything else I need to know?

GameBoy CPU Manual: http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf
GameBoy Pan Docs: http://bgb.bircd.org/pandocs.htm

These are the 2 main resources I used to get a good understanding of the GameBoy.

Offline

Board footer

Powered by FluxBB