GithubHelp home page GithubHelp logo

nod's Introduction

NOD

NOD is a library and utility (nodtool) for traversing, dumping, and authoring GameCube and Wii optical disc images.

Library

The primary motivation of NOD is to supply a uniform C++11 API for accessing data from image files directly. nod::DiscBase provides a common interface for traversing partitions and individual files. Files may be individually streamed, or the whole partition may be extracted to the user's filesystem. Raw ISO and WBFS images are supported read sources.

bool isWii; /* Set by reference next line */
std::unique_ptr<nod::DiscBase> disc = nod::OpenDiscFromImage(path, isWii);
if (!disc)
    return FAILURE;

/* Access first data-partition on Wii, or full GameCube disc */
nod::Partition* dataPart = disc->getDataPartition();
if (!dataPart)
    return FAILURE;

/* One-shot extraction to filesystem */
if (!dataPart->extractToDirectory(outDir, ctx))
    return FAILURE;

return SUCCESS;

Image authoring is always done from the user's filesystem and may be integrated into a content pipeline using the nod::DiscBuilderBase interface.

/* Sample logging lambda for progress feedback */
size_t lastIdx = -1;
auto progFunc = [&](size_t idx, const nod::SystemString& name, size_t bytes)
{
    if (idx != lastIdx)
    {
        lastIdx = idx;
        /* NOD provides I/O wrappers using wchar_t on Windows;
         * _S() conditionally makes string-literals wide */
        nod::Printf(_S("\n"));
    }
    if (bytes != -1)
        nod::Printf(_S("\r%s %" PRISize " B"), name.c_str(), bytes);
    else
        nod::Printf(_S("\r%s"), name.c_str());
    fflush(stdout);
};

/* Making a GCN image */
nod::DiscBuilderGCN b(isoOutPath, progFunc);
ret = b.buildFromDirectory(fsRootDirPath);

/* Making a Wii image */
nod::DiscBuilderWii b(isoOutPath, dualLayer, progFunc);
ret = b.buildFromDirectory(fsRootDirPath);

Wii images are fakesigned using a commonly-applied signing bug.

Additionally, any *.dol files added to the disc are patched to bypass the #001 error caused by invalid signature checks. This allows games with multiple .dols to inter-boot without extensive loader-patching.

Tool

The library usage mentioned above is provided by a command-line tool called nodtool.

An extract/repack works like so:

>$ nodtool extract <image-in> [<dir-out>]
>$ cd <dir-out>

# Then one of:
>$ nodtool makegcn fsroot [<image-out>]
>$ nodtool makewii fsroot [<image-out>]

nod's People

Contributors

jackoalan avatar antidote avatar pupperuki avatar

Watchers

 avatar

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.