-
Notifications
You must be signed in to change notification settings - Fork 80
Tooling for reverse engineering
BGB is a really nice GameBoy emulator, with a powerful debugger. It can set breakpoints on code and on memory access, and help you track the execution of the code.
BGB is originally written for Windows, but it works also well on macOS and Linux using Wine.
Here is how to use BGB for reverse-engineering the game:
-
Compile the game (
make all
).It produces
game.gbc
(a compiled rom identical to the original) and more importantlygame.sym
, the debug symbols. -
Open
game.gbc
in the BGB emulator. -
Open the debugger, and jump to the
0000:0150
address. You'll see a function namedStart
. Notice how BGB knows the name of this function from the debug symbols. -
You can now trace the execution of the code, set breakpoints, watchers, edit the memory, etc.
Awake is a static GameBoy assembly explorer, specially tuned for exploring ZeldaGB and ZeldaDX. It allows to identify functions, loops, and to jump easily from functions to function. It makes much easier to follow the flow of the code and data during the game.
The tool was initially developed by @devdri. @kemenaran is currently writing some improvement to this tools, so that it can read debug symbols (otherwise no functions are labelled), and label functions from within the explorer.
mgbdis is a powerful Game Boy disassembler. It produces high-quality and compilable disassembly.
This tool can't infer which locations are data, but is still produces a very good starting point for disassembling a new bank.
See tools/generate-disassembly.sh
for how LADX configures and uses mgbdis
.