Skip to content

EXTRACT

scurest edited this page Jan 15, 2021 · 13 revisions

Extracting with apicula

apicula can scan a file and extract all of the .nsbXX files it finds in it

apicula extract <file to scan> -o <output dir>

This just looks at every offset in a file and checks if there is a valid .nsbXX file there. Any blocks in the file that have been compressed with the DS's LZ77 algorithms are also decompressed and searched.

Note: Not all games use NSBMD files for models. If you can't get any from a game, it might not have any.

Ideas for extracting files

Use a program like ConsoleTool

Programs like Console Tool let you browse and extract files from a GUI.

apicula extract a ROM file

You can often get everything from a game by just scanning the ROM directly

apicula extract <your rom file> -o <output dir>

Dump the filesystem off a ROM

You can dump the filesystem off of a ROM with ndstool

ndstool -x ROM.nds -d <dump dir>

Then look for any Nitro files in the dump folder. This preserves the original folder structure.

Recursively extract from a filesystem dump

This Python script will dump a ROM with ndstool, then recursively run apicula extract on each file, saving anything it finds. Make sure you edit it with the correct path to apicula and ndstool on your system.

This combines the benefit of ndstool (preserves the original folder structure) with apciula extract (scans inside of files).

Extract from a memory dump

You can take a memory dump while the game is running in an emulator and extract from that. In DeSmuME, you can do this through the Memory Viewer (Windows only), or by connecting to a gdb stub and dumping with dump binary memory <mem dump file> 0x0 0x4000000.

You should be able to get any models that are on-screen when you dump the memory. Since at run-time any special compression or headers should be removed, you might be able to extract models from a memory dump that you couldn't get from the static ROM.

WARNING: Extracting from memory dumps usually results in corrupted textures. My guess is because the memory is reused after copying texture data to VRAM.