Skip to content

Binary Disassembly

Allison Mackenzie edited this page Oct 8, 2023 · 32 revisions

This page is a stub. WIP.

Although is is the goal of the administrators to disassemble all of the game's binaries long before having everyone rush to match functions, perhaps the information contained here is useful to those of you who are curious how we went about this process. This information can be used for many of your favorite games.

This page is a stub. WIP.

Start by Adding the Binary to the Makefile

The first thing done is adding the binary extraction to the Makefile. Let's take the overlay Pumpkin Gorge as an example. Pumpkin Gorge is obviously shortened to PG/pg.

Note: For this section, you'll want to ignore the *'s in the actual Makefile, this is added for emphasis!

The following can be added at the top in the appropriate place.

OVL_PG			:= pg

In the case of an overlay, you can find the overlays instruction and add it as part of the necessary overlays (this is obviously not necessary in cases of things which are not overlays).

overlays: ac ag cc ch cr credits dc ee eh gg gs gy1 gy2 hh hr ia la landmap pd **pg** ps sf sv td tl zl

A little bit further down in the make file you should add the instruction for that particular overlay.

pg: ovlpg_dirs $(BUILD_DIR)/PG.BIN
$(BUILD_DIR)/PG.BIN: $(BUILD_DIR)/ovlpg.elf
	$(OBJCOPY) -O binary $< $@

Next, you'll add it to the extract instruction.

extract: extract_main extract_game extract_ovlac extract_ovlag extract_ovlcc extract_ovlch extract_ovlcr extract_ovlcredits extract_ovldc extract_ovlee extract_ovleh extract_ovlgy1 extract_ovlgy2 extract_ovlhh extract_ovlhr extract_ovlia extract_ovlla extract_ovllandmap extract_ovlpd **extract_ovlpg** extract_ovlps extract_ovlsf extract_ovlsv extract_ovltd extract_ovltl extract_ovlzl

Finally, you'll want to add it to the phony at the bottom of the make file.

.PHONY: main game ac ag cc ch cr credits dc ee eh gg gs gy1 gy2 hh hr ia la landmap pd **pg** ps sf sv td tl zl

disasm_unknown: true

You can add disasm_unknown: true as an option to the YAML configuration file to force all data to be extracted as assembly.

Clone this wiki locally