Skip to content
Vincent edited this page Sep 10, 2022 · 2 revisions

Decompiling NOB0 scripts is a tedious process as they reference class methods using short IDs rather than their prototypes. This prevents us from knowing the types of passed arguments. These script classes and methods are defined in native code, so the only way to extract those is to either have the source code of the game, or to decompile it.

Extracting class model

Note: if you wish to decompile scripts from Project Nomads, you can use the class model provided in this repo

First you need to decompile the DLLs, I've used Ghidra (10.1.2) for this, other decompiling tools may or may not work. I recommend decompiling all DLLs including both generic engine ones, and game specific ones (nkernel.dll, nparticle.dll, nnomads.dll, etc...). Once decompiled, export generated C files to a folder.

Once C files ready, run the extract-classes command of the extractor. Using option -i to point the folder with the C files, and -o to point the generated class model JSON.

Decompiling scripts

Once you have the class model, decompiling is straight forward, use the script command of the extractor with option -i to select the .n script, and -m to point to the class model JSON.

You can also use the -m option with the extract command if you wish to decompile scripts for an entire NPK0 archive.

Clone this wiki locally