/N64LoaderWV-DinoPlanet

Ghidra Loader Module for N64 ROMs

Primary LanguageJava

N64 ROM Loader for Ghidra by Warranty Voider

this is a loader module for ghidra for the Dinosaur Planet ROM

  • fixes endianess (little, big, mixed) at loading
  • loads ram, rom and boot section into ghidra
  • it can use a signature/pattern file to scan for symbol hints for ghidra

Dinosaur Planet specific functionality

  • resolves DLL import tables so that DLL-local code is properly referencing function addresses, strings, and other constants
  • initializes each DLL function named after their DLL, as well as object name if any
  • sets up GP register for each DLL so it can read stuff. the game patches its own assembly for this at runtime
  • attempts to make decent-ish references for global DLLs using a fake redirection table in-place of the runtime DLL table - however results may vary
  • also note this is the first thing i wrote in java (and hopefully the last) so apologies for inconsistencies in naming conventions etc.

this allows a rom to be labeled, disassembled and decompiled

credits:

requires JDK 13

Build from Source (Mac)

brew install java
brew install gradle
brew cask install ghidra

export GHIDRA_INSTALL_DIR=`brew cask ls ghidra | grep ghidra | sed 's/^.*-> \(.*\)ghidraRun.*/\1/'`

Then whenever you're ready to build, run

gradle

and it will create a zip file in /dist that you can use that file as the extension in Ghidra

Build from Source (Linux)

install java15, gradle, and ghidra, on arch linux (substitute as needed for apt, yum, or what have you):

pacman -S jdk15-openjdk gradle ghidra

Clone the repo and cd to the N64LoaderWV directory

git clone https://github.com/zeroKilo/N64LoaderWV.git

if ghidra is in your PATH (you may need to use ghidraRun instead of ghidra depending on distro):

GHIDRA_INSTALL_DIR=$(dirname $(readlink -fe $(which ghidra))) gradle

else set GHIDRA_INSTALL_DIR to where you manually installed ghidra to (e.g $HOME/bin) or add ghidra's location to PATH

Example Videos

Alt text

Alt text