Skip to content

Ghidra setup

Gong Xian edited this page Aug 19, 2024 · 13 revisions

Hacking and disassembly is done with Ghidra and its extensions for the SuperH4 architecture. This setup procedure will need to be done only once, as 1ST_READ.BIN and SKFONT.CG are identical across all discs.

Requirements

Though Ghidra 10.0.4 is known to contain the log4j vulnerability, it is the most recent version that can support ghidra_sdc_ldr, which is required to load Dreamcast binaries. ghidra_sdc_ldr targeted version 10.0, but modifying the properties file will allow it to be loaded in the latest 10.0.x version of Ghidra. If the log4j vulnerability is a concern, follow the instructions in the release notes of version 10.1 to patch version 10.0.4.


After extracting assets:

  1. Follow the instructions to install Ghidra on your system.
  2. In the SuperH4 language data directory in the Ghidra repository, download SuperH4.sinc and replace the same file in Ghidra/Processors/SuperH4/data/languages in your Ghidra 10.0.4 directory with this new version.
  3. After downloading ghidra_sdc_ldr, extract ghidra_sdc_ldr/extension.properties and open it in a text editor. Change the version=10.0 line to version=10.0.4, and replace the original file in the copy of ghidra_sdc_ldr you downloaded.
  4. Install the modified ghidra_sdc_ldr extension zip in Ghidra by opening File > Install Extension... and clicking the green + button at the top of the window.
  5. Create a new Ghidra non-shared project and import 1ST_READ.BIN. For the Language, select "SuperH4, default, 32, little, default". The description should read "SuperH-4(a) (SH4) little endian". Click the Options button and set the Base Address to 8c010000.

0005151 0005152

  1. Open 1ST_READ.BIN by double clicking it. Begin auto analysis with the default settings when prompted. After the analysis is complete, save the file.
  2. Repeat steps 4 and 5 with SKFONT.CG, but use a Base Address of 8ccd7ec0. Do not perform auto analysis, as it contains no code.

As you make changes, it is recommended that you save different copies of 1ST_READ.BIN with different names rather than save over the initial copy. Use a naming scheme such as the current date to keep track of changes.

Additional Resources