ds-rom
Library for extracting and building matching Nintendo DS ROMs. DSi/DSiware not supported yet.
Contents
Goals
- Extract all components of a ROM to files on disk.
- Build ROMs using those files.
- The files should be modifiable so that a modded ROM can be built.
- The built ROMs should exactly match the originals when the files are unmodified.
Extraction
ds-rom has two representations of the ROM: raw and plain. To extract files from a ROM, it first reads the raw ROM, with the exact byte-for-byte content of the ROM file. Then, the plain ROM can extract all the components out of the raw ROM. Lastly, the plain ROM can be saved to files on disk.
use ;
let raw_rom = from_file?;
let rom = extract?;
rom.save?;
[!IMPORTANT] If the raw ROM is encrypted, you must pass an encryption key to
Rom::savein place of theNonevalue. See an example of this here.
Building
Building a ROM is exactly the opposite of extracting. ds-rom starts by loading a plain ROM from files on disk, the same files generated by Rom::save. Then, the raw ROM can be built and saved as a single ROM file.
use Rom;
let rom = load?;
let raw_rom = rom.build?;
raw_rom.save?;
[!IMPORTANT] If the ROM is encrypted, you must pass an encryption key to
Rom::loadand optionallyRom::buildin place of theNonevalue. See an example of this here.
(It is optional forRom::buildas it is only for computing a CRC checksum in the ROM header.)You can configure whether a ROM should be encrypted by editing the YAML files inside the extraction directory.
Command-line interface
ds-rom is also available as a CLI, and you can download the latest release here. Use dsrom --help for a list of subcommands.