Rust crate for reading GameCube and Wii disc images
Go to file
Luke Street 4f794f06cb WIP WIA/RVZ & more 2024-02-02 16:21:05 -07:00
.github/workflows WIP WIA/RVZ & more 2024-02-02 16:21:05 -07:00
src WIP WIA/RVZ & more 2024-02-02 16:21:05 -07:00
.gitignore Release 0.1.1: Improvements to windowed stream API, minor fixes 2021-08-23 16:51:05 -04:00
Cargo.toml WIP WIA/RVZ & more 2024-02-02 16:21:05 -07:00
LICENSE-APACHE Fix LICENSE copyright 2021-08-25 14:54:52 -04:00
LICENSE-MIT Fix LICENSE copyright 2021-08-25 14:54:52 -04:00
README.md WIP WIA/RVZ & more 2024-02-02 16:21:05 -07:00
clippy.toml clippy config & fixes; enable LTO 2022-02-03 02:36:41 -05:00
deny.toml Migrate to binrw; update cargo deny config; update deps 2022-02-03 02:03:21 -05:00
rustfmt.toml WIP WIA/RVZ & more 2024-02-02 16:21:05 -07:00

README.md

nod-rs Build Status Latest Version Api Rustdoc Rust Version

Library for traversing & reading GameCube and Wii disc images.

Based on the C++ library nod, but does not currently support authoring.

Currently supported file formats:

  • ISO (GCM)
  • WIA / RVZ
  • WBFS
  • NFS (Wii U VC files, e.g. hif_000000.nfs)

CLI tool

This crate includes a CLI tool nodtool, which can be used to extract disc images to a specified directory:

nodtool extract /path/to/game.iso [outdir]

For Wii U VC titles, use content/hif_*.nfs:

nodtool extract /path/to/game/content/hif_000000.nfs [outdir]

Library example

Opening a disc image and reading a file:

use std::io::Read;

use nod::{
    disc::{new_disc_base, PartHeader},
    fst::NodeType,
    io::{new_disc_io, DiscIOOptions},
};

fn main() -> nod::Result<()> {
    let options = DiscIOOptions::default();
    let mut disc_io = new_disc_io("path/to/file.iso".as_ref(), &options)?;
    let disc_base = new_disc_base(disc_io.as_mut())?;
    let mut partition = disc_base.get_data_partition(disc_io.as_mut(), false)?;
    let header = partition.read_header()?;
    if let Some(NodeType::File(node)) = header.find_node("/MP3/Worlds.txt") {
        let mut s = String::new();
        partition.begin_file_stream(node)?.read_to_string(&mut s).expect("Failed to read file");
        println!("{}", s);
    }
    Ok(())
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.