A decompilation project of New Super Mario Bros. Wii, based on the PALv1 binaries.
This project aims to produce an accurate reconstruction of New Super Mario Bros. Wii's code by decompiling the original binaries. The build process consists of three major stages:
All decompiled source files are compiled into object files in bin/compiled/.
Parts of the binary without corresponding source files are extracted from the original binaries using slicing. This produces object files in bin/sliced/, using slice information defined in the slices/ directory.
Compiled and sliced object files are linked together to reconstruct the final .dol and .rel files that match the originals byte-for-byte.
alias_db.txt: Contains relocation helpers for rebuilding the.relfiles.syms.txt: Contains known symbol names formain.dol. Will eventually be replaced by a proper symbol map.
- Obtain
main.doland the four.rel.LZfiles from a dumped PALv1 disc of New Super Mario Bros. Wii. A tutorial to do so can be found here. - Use
tools/uncompress_lz.pyto decompress the.rel.LZfiles into.rel. - Rename
main.doltowiimj2d.dol, and place it along with the decompressed.relfiles into theoriginal/directory. - Verify the following checksums:
$ md5sum original/*
17096d0ed441d44a0c31039138a8d7f8 original/d_basesNP.rel
f8cffd634edbec6c1bc210dab02c1e32 original/d_en_bossNP.rel
458f1aa94706dde1a8f2f9d97ff1f35c original/d_enemiesNP.rel
393bf12ef4254dd1ea1366d5b06fbebb original/d_profileNP.rel
ddab9e5dca53d8c18bf4051b927e822e original/wiimj2d.dol-
Download the CodeWarrior for Embedded PowerPC binaries from here and extract it into the
compilers/directory. The compiler should be located atcompilers/Wii/1.1/mwcceppc.exe. -
Install
ninja(if not already installed):
pip install ninja- Generate the build script:
./configure.py- Run the build using
ninja:
ninja- (Optional) Verify that the rebuilt binaries match the originals:
./progress.py --verify-binYou can generate source documentation using Doxygen.
- Install Doxygen.
- If not already present, download the doxygen-awesome-css theme and place its contents into the following directory:
website/doxygen/doxygen-awesome-css/
- Generate the documentation:
doxygenThe generated HTML documentation will be placed in the doxygen directory.
We welcome contributions to this project! Please see CONTRIBUTING.md for detailed guidelines.
Usage of objdiff is recommended for decompilation work.
To prepare the repository for use with objdiff, run:
./prepare_objdiff.pyThis sets up the necessary files and configuration.