From e0d735dd39a5dbead231daf7fdaf2b83559f6ec8 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Fri, 18 Oct 2024 00:03:23 -0600 Subject: [PATCH] Export more constants & minor cleanup --- nod/src/disc/gcn.rs | 6 ++++-- nod/src/disc/mod.rs | 6 +++--- nod/src/lib.rs | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/nod/src/disc/gcn.rs b/nod/src/disc/gcn.rs index 3d39b6c..dcc58fc 100644 --- a/nod/src/disc/gcn.rs +++ b/nod/src/disc/gcn.rs @@ -170,6 +170,7 @@ pub(crate) fn read_part_meta( reader .read_exact(&mut raw_apploader[size_of::()..]) .context("Reading apploader")?; + let raw_apploader = raw_apploader.into_boxed_slice(); // fst.bin reader @@ -207,13 +208,14 @@ pub(crate) fn read_part_meta( .unwrap_or(size_of::() as u32); raw_dol.resize(dol_size as usize, 0); reader.read_exact(&mut raw_dol[size_of::()..]).context("Reading DOL")?; + let raw_dol = raw_dol.into_boxed_slice(); Ok(Box::new(PartitionMeta { raw_boot, raw_bi2, - raw_apploader: raw_apploader.into_boxed_slice(), + raw_apploader, raw_fst, - raw_dol: raw_dol.into_boxed_slice(), + raw_dol, raw_ticket: None, raw_tmd: None, raw_cert_chain: None, diff --git a/nod/src/disc/mod.rs b/nod/src/disc/mod.rs index 5438c20..144f961 100644 --- a/nod/src/disc/mod.rs +++ b/nod/src/disc/mod.rs @@ -26,7 +26,7 @@ pub use fst::{Fst, Node, NodeKind}; pub use streams::{FileStream, OwnedFileStream, WindowedStream}; pub use wii::{SignedHeader, Ticket, TicketLimit, TmdHeader, REGION_SIZE}; -/// Size in bytes of a disc sector. +/// Size in bytes of a disc sector. (32 KiB) pub const SECTOR_SIZE: usize = 0x8000; /// Magic bytes for Wii discs. Located at offset 0x18. @@ -361,10 +361,10 @@ pub struct PartitionMeta { pub raw_bi2: Box<[u8; BI2_SIZE]>, /// Apploader (apploader.bin) pub raw_apploader: Box<[u8]>, - /// File system table (fst.bin) - pub raw_fst: Box<[u8]>, /// Main binary (main.dol) pub raw_dol: Box<[u8]>, + /// File system table (fst.bin) + pub raw_fst: Box<[u8]>, /// Ticket (ticket.bin, Wii only) pub raw_ticket: Option>, /// TMD (tmd.bin, Wii only) diff --git a/nod/src/lib.rs b/nod/src/lib.rs index ed280f5..4ae0f66 100644 --- a/nod/src/lib.rs +++ b/nod/src/lib.rs @@ -66,8 +66,8 @@ use std::{ pub use disc::{ ApploaderHeader, DiscHeader, DolHeader, FileStream, Fst, Node, NodeKind, OwnedFileStream, PartitionBase, PartitionHeader, PartitionKind, PartitionMeta, SignedHeader, Ticket, - TicketLimit, TmdHeader, WindowedStream, BI2_SIZE, BOOT_SIZE, GCN_MAGIC, REGION_SIZE, - SECTOR_SIZE, WII_MAGIC, + TicketLimit, TmdHeader, WindowedStream, BI2_SIZE, BOOT_SIZE, DL_DVD_SIZE, GCN_MAGIC, + MINI_DVD_SIZE, REGION_SIZE, SECTOR_SIZE, SL_DVD_SIZE, WII_MAGIC, }; pub use io::{ block::{DiscStream, PartitionInfo},