Installation
Follow these steps to set up the project.
Set up dependencies
You'll need to install the following programming tools:
- Python 3.6 or newer with pip
- Ninja
- CMake 3.13+
- If you are on Ubuntu 18.04, you must first update CMake by using the official CMake APT repository.
- ccache (to speed up builds)
- xdelta3
- Clang (not for compiling BotW code, but for compiling Rust tools)
Ubuntu users can install those dependencies by running:
sudo apt install python3 ninja-build cmake ccache xdelta3 clang libssl-dev pkg-config
Additionally, you'll also need:
A Rust toolchain (follow the instructions here)
The following Python modules:
capstone colorama cxxfilt pyelftools ansiwrap watchdog python-Levenshtein toml
(install them withpip install ...
)
Dump the executable from a Switch
Next, you'll need to acquire the original 1.5.0 or 1.6.0 main
NSO executable.
- To dump it from a Switch, follow the instructions on the wiki.
- You do not need to dump the entire game (RomFS + ExeFS + DLC). Just dumping the 1.5.0 or 1.6.0 ExeFS is sufficient.
- The decompressed 1.5.0 NSO has the following SHA256 hash:
d9fa308d0ee7c0ab081c66d987523385e1afe06f66731bbfa32628438521c106
Set up the repo
Clone this repository. If you are using WSL, please clone the repo inside WSL, not on the Windows side (for performance reasons).
git clone [email protected]:zeldaret/botw
cd botwRun
git submodule update --init --recursive
Run
tools/setup.py [path to the dumped 'main' file]
- This will:
- install a check tool (
tools/check
) to check for differences in decompiled code - convert the executable if necessary
- set up Clang 4.0.1 by downloading it from the official LLVM website
- create a build directory in
build/
- install a check tool (
- If something goes wrong, follow the instructions given to you by the script.
- This will:
Build
To start the build, just run
ninja -C build
Note that Ninja will perform a multithreaded build by default. There is no need to pass -j
manually.
After the build completes, run the checker to make sure everything built correctly:
tools/check
If you see an OK
message, congrats! You have successfully set up the project.
Problems?
Ask for help on the Zelda Decompilation Discord server in the #botw-decomp channel.