Export more constants & minor cleanup

This commit is contained in:
Luke Street 2024-10-18 00:03:23 -06:00
parent d4bca2caa8
commit e0d735dd39
3 changed files with 9 additions and 7 deletions

View File

@ -170,6 +170,7 @@ pub(crate) fn read_part_meta(
reader
.read_exact(&mut raw_apploader[size_of::<ApploaderHeader>()..])
.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::<DolHeader>() as u32);
raw_dol.resize(dol_size as usize, 0);
reader.read_exact(&mut raw_dol[size_of::<DolHeader>()..]).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,

View File

@ -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<Box<[u8]>>,
/// TMD (tmd.bin, Wii only)

View File

@ -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},