Setup

Prerequisites

Note

All of the commands below should be run from the root of the repository.

Setup

To setup a development Conda environment with Undertale and all of its dependencies:

conda env create -f environment.yml
conda env update -f environment.development.yml

Youc an then activate the environment:

conda activate undertale

Code Style

Pre-commit hooks are available for automatic code formatting, linting, and type checking. To enable them (after installing development dependencies) run:

pre-commit install

Documentation

To build the documentation (after Setup), from the root of the repository run:

sphinx-build -b html docs build/documentation/

Or other supported sphinx output formats.

Testing

To run tests, run:

python tests/unit.py --verbose

Extras

Binary Ninja Setup

To work with binary data, you’ll need to have a Binary Ninja license (Commercial or Ultimate). In general, you should follow their installation instructions.

Once Binary Ninja is installed, to set up the API bindings, locate install_api.py in the scripts directory in your Binary Ninja installation path. For example:

# Ubuntu
<install-path>/scripts/install_api.py

# MacOS
/Applications/Binary\ Ninja.app/Contents/Resources/scripts/install_api.py

Important

The version of the Binary Ninja API bindings you install must match your license (Commercial, Ultimate, etc.).

Run this script with the same Python environment where Undertale is installed to set up Binary Ninja’s Python API bindings.

You’ll also need to ensure your Binary Ninja license key is set up. Typically this is done by starting Binary Ninja for the first time and using the license file you were given when you purchased the product. In a headless environment (where you cannot start the GUI application), you can simply place this license file in the following location and the API will work as expected (this is not well documented):

~/.binaryninja/license.dat

Finally, to verify that everything is working correctly, run the binary unit tests:

python tests/unit.py --verbose TestPipelineBinary

Verify that the binary analysis tests pass and are not skipped.