A Ghidra extension to support disassembling and analyzing NES (Nintendo Entertainment System) and Famicom ROMs.
- Import NES ROMs in the iNES format. The following mappers are supported:
- NROM (mapper 0)
- Add labels and memory blocks in disassembly, making it easier to jump around a disassembled ROM!
- Install a Compatible version of Java and Ghidra (Java 11+, tested with Ghidra 10.0.3).
- Download the latest GhidraNesRom release.
- Go to "File" > "Install Extensions...". Click "+" in the top-right corner and choose the GhidraNes Zip. Click "OK" to install the extension.
- Restart Ghidra.
- In Ghidra, create a new project by following the wizard under "File" > "New Project...".
- Drag-and-drop an iNES
.nes
ROM onto the project. Set the format to "NES ROM" and click "OK". - Double-click the ROM in the project to open Ghidra's CodeBrowser.
- Analyze the file when prompted (or go to "Analysis" > "Auto Analyze..."). Leave the settings as default and click "Analyze".
- Done, the game will be disassembled! On the left-hand side, under "Symbol Tree" > "Functions", open
reset
to jump to the reset vector (where execution starts), orvblank
to jump to the NMI vector (where execution goes during VBlank).
- Install Java and Ghidra.
- install Eclipse.
- Install the GhidraDev Eclipse plugin. Instructions can be found in your Ghidra install directory, under
Extensions/Eclipse/GhidraDev/GhidraDev_README.html
. - In Eclipse, open the GhidraNes repo by going to "File" > "Open Projects from File System...".
- Open "GhidraDev" > "Link Ghidra...". Add your Ghidra installation, click "Next >", then select the "GhidraNes" as the Java project. Click "Finish".
- Run the project in Eclipse to start Ghidra and the GhidraNes extension.
- Install gradle
export GHIDRA_INSTALL_DIR=/path/to/ghidra
gradle assemble
NOTE: Ensure the GhidraNes Eclipse project is set up with the earliest version of Java that should be targeted. Using a later version of Java can cause compatibility issues!
- Install Gradle (with SDKMAN, this can be done with
sdk install gradle
). - In Eclipse, open "GhidraDev" > "Export" > "Ghidra Module Extension...". Choose "GhidraNes" as the project, click "Next >", then choose "Local installation directory:" and browse to your Gradle installation dir (with SDKMAN, this will be at
~/.sdkman/candidates/gradle/$GRADLE_VERSION
). Click "Finish". - The built zip file will be saved in the
dist/
directory.