Expand description
Library for traversing & reading Nintendo Optical Disc (GameCube and Wii) images.
Originally based on the C++ library nod, but does not currently support authoring.
Currently supported file formats:
- ISO (GCM)
- WIA / RVZ
- WBFS (+ NKit 2 lossless)
- CISO (+ NKit 2 lossless)
- NFS (Wii U VC)
- GCZ
§Examples
Opening a disc image and reading a file:
use std::io::Read;
// Open a disc image and the first data partition.
let disc = nod::Disc::new("path/to/file.iso")
.expect("Failed to open disc");
let mut partition = disc.open_partition_kind(nod::PartitionKind::Data)
.expect("Failed to open data partition");
// Read partition metadata and the file system table.
let meta = partition.meta()
.expect("Failed to read partition metadata");
let fst = meta.fst()
.expect("File system table is invalid");
// Find a file by path and read it into a string.
if let Some((_, node)) = fst.find("/MP3/Worlds.txt") {
let mut s = String::new();
partition
.open_file(node)
.expect("Failed to open file stream")
.read_to_string(&mut s)
.expect("Failed to read file");
println!("{}", s);
}
Converting a disc image to raw ISO:
// Enable `rebuild_encryption` to ensure the output is a valid ISO.
let options = nod::OpenOptions { rebuild_encryption: true, ..Default::default() };
let mut disc = nod::Disc::new_with_options("path/to/file.rvz", &options)
.expect("Failed to open disc");
// Read directly from the open disc and write to the output file.
let mut out = std::fs::File::create("output.iso")
.expect("Failed to create output file");
std::io::copy(&mut disc, &mut out)
.expect("Failed to write data");
Macros§
- array_
ref - Creates a fixed-size array reference from a slice.
- array_
ref_ mut - Creates a mutable fixed-size array reference from a slice.
- static_
assert - Compile-time assertion.
Structs§
- Apploader
Header - Apploader header.
- Disc
- An open disc image and read stream.
- Disc
Header - Shared GameCube & Wii disc header.
- Disc
Meta - Extra metadata about the underlying disc file format.
- DolHeader
- Dolphin executable (DOL) header.
- Fst
- A view into the file system table (FST).
- Lagged
Fibonacci - Lagged Fibonacci generator for GC / Wii partition junk data.
- Node
- An individual file system node.
- Open
Options - Options for opening a disc image.
- Partition
Header - A header describing the contents of a disc partition.
- Partition
Info - Wii partition information.
- Partition
Meta - Extra disc partition data. (DOL, FST, etc.)
- Signed
Header - Signed blob header
- Ticket
- Wii ticket
- Ticket
Limit - Ticket limit
- TmdHeader
- Title metadata header
- Windowed
Stream - A read stream with a fixed window.
Enums§
- Compression
- The disc file format’s compression algorithm.
- Error
- Error types for nod.
- Format
- The disc file format.
- Node
Kind - File system node kind.
- Partition
Kind - The kind of disc partition.
Constants§
- BI2_
SIZE - Size of the debug and region information (bi2.bin)
- BOOT_
SIZE - Size of the disc header and partition header (boot.bin)
- DL_
DVD_ SIZE - The size of a dual-layer DVD. (8.5 GB)
- GCN_
MAGIC - Magic bytes for GameCube discs. Located at offset 0x1C.
- MINI_
DVD_ SIZE - The size of a single-layer MiniDVD. (1.4 GB)
- REGION_
SIZE - Size of the disc region info (region.bin)
- SECTOR_
SIZE - Size in bytes of a disc sector. (32 KiB)
- SL_
DVD_ SIZE - The size of a single-layer DVD. (4.7 GB)
- WII_
MAGIC - Magic bytes for Wii discs. Located at offset 0x18.
Traits§
- Disc
Stream - Required trait bounds for reading disc images.
- Error
Context - Helper trait for adding context to errors.
- Partition
Base - An open disc partition.
- Result
Context - Helper trait for adding context to result errors.
Type Aliases§
- File
Stream - A file read stream borrowing a
PartitionBase
. - KeyBytes
- AES key bytes
- Magic
Bytes - Magic bytes
- Owned
File Stream - A file read stream owning a
PartitionBase
. - Result
- Helper result type for
Error
.