Giter Site home page Giter Site logo

ndstrim's Introduction

ndstrim

ndstrim is a program to trim the excess padding space found in Nintendo DS(i) ROMs, created as a project to familiarize myself with Rust.

It takes into account whether a game bundles a RSA certificate in order for Download Play functionality to work, and preserves it while trimming the excess space from the ROM file.


Usage

Standard

ndstrim can trim any amount of files in a single run. To execute it, use:

ndstrim foo.nds bar.nds baz.nds

This will produce three files called foo.trim.nds, bar.trim.nds and baz.trim.nds in the same directory as the original ROM files.

You can optionally provide a custom extension to use in place of trim.nds by passing the -e flag. Ensure that the extension you provide contains no leading dot.

In-place

If you don't care about preserving the original ROMs, you can run:

ndstrim -i foo.nds bar.nds baz.nds

This will trim the files in-place, and is irreversible.

Simulated

If you want to check what ndstrim would do, you can use:

ndstrim -s foo.nds bar.nds baz.nds

This option can be combined with -i.

Help

Launching ndstrim without arguments will display a brief usage message, but you can get a more helpful one by passing the -h flag.


Building

Building ndstrim is a straightforward process that can be done using cargo.

For a debug build, run:

cargo b

For a release build, which produces an optimized and stripped binary with full LTO, run:

cargo b --release

Detection as malware

On Windows, it might happen that Defender quarantines the prebuilt .exe as a malware. Likewise, some VirusTotal engines may flag the binary, even if sandbox analysis shows that the file is clean.

This is a false positive, most likely triggered by the use of UPX to minify the binary's size. If you don't trust the binary, however, you can always review the source and build ndstrim on your system by following the instructions above.


Credits

This program is based on an adaptation of the trimming algorithm included in GodMode9.

Additionally, to validate NDS ROMs, it adapts the CRC-16 algorithm included in TWiLightMenu.


License

This program is licensed under the terms of the MIT license.

See LICENSE.txt for further info.

ndstrim's People

Contributors

nemris avatar thiagokokada avatar

Stargazers

 avatar Samuele avatar Larson T. avatar

Watchers

 avatar

Forkers

thiagokokada

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.