mirror of https://github.com/encounter/nod-rs.git
Export more constants & minor cleanup
This commit is contained in:
parent
d4bca2caa8
commit
e0d735dd39
|
@ -170,6 +170,7 @@ pub(crate) fn read_part_meta(
|
||||||
reader
|
reader
|
||||||
.read_exact(&mut raw_apploader[size_of::<ApploaderHeader>()..])
|
.read_exact(&mut raw_apploader[size_of::<ApploaderHeader>()..])
|
||||||
.context("Reading apploader")?;
|
.context("Reading apploader")?;
|
||||||
|
let raw_apploader = raw_apploader.into_boxed_slice();
|
||||||
|
|
||||||
// fst.bin
|
// fst.bin
|
||||||
reader
|
reader
|
||||||
|
@ -207,13 +208,14 @@ pub(crate) fn read_part_meta(
|
||||||
.unwrap_or(size_of::<DolHeader>() as u32);
|
.unwrap_or(size_of::<DolHeader>() as u32);
|
||||||
raw_dol.resize(dol_size as usize, 0);
|
raw_dol.resize(dol_size as usize, 0);
|
||||||
reader.read_exact(&mut raw_dol[size_of::<DolHeader>()..]).context("Reading DOL")?;
|
reader.read_exact(&mut raw_dol[size_of::<DolHeader>()..]).context("Reading DOL")?;
|
||||||
|
let raw_dol = raw_dol.into_boxed_slice();
|
||||||
|
|
||||||
Ok(Box::new(PartitionMeta {
|
Ok(Box::new(PartitionMeta {
|
||||||
raw_boot,
|
raw_boot,
|
||||||
raw_bi2,
|
raw_bi2,
|
||||||
raw_apploader: raw_apploader.into_boxed_slice(),
|
raw_apploader,
|
||||||
raw_fst,
|
raw_fst,
|
||||||
raw_dol: raw_dol.into_boxed_slice(),
|
raw_dol,
|
||||||
raw_ticket: None,
|
raw_ticket: None,
|
||||||
raw_tmd: None,
|
raw_tmd: None,
|
||||||
raw_cert_chain: None,
|
raw_cert_chain: None,
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub use fst::{Fst, Node, NodeKind};
|
||||||
pub use streams::{FileStream, OwnedFileStream, WindowedStream};
|
pub use streams::{FileStream, OwnedFileStream, WindowedStream};
|
||||||
pub use wii::{SignedHeader, Ticket, TicketLimit, TmdHeader, REGION_SIZE};
|
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;
|
pub const SECTOR_SIZE: usize = 0x8000;
|
||||||
|
|
||||||
/// Magic bytes for Wii discs. Located at offset 0x18.
|
/// Magic bytes for Wii discs. Located at offset 0x18.
|
||||||
|
@ -361,10 +361,10 @@ pub struct PartitionMeta {
|
||||||
pub raw_bi2: Box<[u8; BI2_SIZE]>,
|
pub raw_bi2: Box<[u8; BI2_SIZE]>,
|
||||||
/// Apploader (apploader.bin)
|
/// Apploader (apploader.bin)
|
||||||
pub raw_apploader: Box<[u8]>,
|
pub raw_apploader: Box<[u8]>,
|
||||||
/// File system table (fst.bin)
|
|
||||||
pub raw_fst: Box<[u8]>,
|
|
||||||
/// Main binary (main.dol)
|
/// Main binary (main.dol)
|
||||||
pub raw_dol: Box<[u8]>,
|
pub raw_dol: Box<[u8]>,
|
||||||
|
/// File system table (fst.bin)
|
||||||
|
pub raw_fst: Box<[u8]>,
|
||||||
/// Ticket (ticket.bin, Wii only)
|
/// Ticket (ticket.bin, Wii only)
|
||||||
pub raw_ticket: Option<Box<[u8]>>,
|
pub raw_ticket: Option<Box<[u8]>>,
|
||||||
/// TMD (tmd.bin, Wii only)
|
/// TMD (tmd.bin, Wii only)
|
||||||
|
|
|
@ -66,8 +66,8 @@ use std::{
|
||||||
pub use disc::{
|
pub use disc::{
|
||||||
ApploaderHeader, DiscHeader, DolHeader, FileStream, Fst, Node, NodeKind, OwnedFileStream,
|
ApploaderHeader, DiscHeader, DolHeader, FileStream, Fst, Node, NodeKind, OwnedFileStream,
|
||||||
PartitionBase, PartitionHeader, PartitionKind, PartitionMeta, SignedHeader, Ticket,
|
PartitionBase, PartitionHeader, PartitionKind, PartitionMeta, SignedHeader, Ticket,
|
||||||
TicketLimit, TmdHeader, WindowedStream, BI2_SIZE, BOOT_SIZE, GCN_MAGIC, REGION_SIZE,
|
TicketLimit, TmdHeader, WindowedStream, BI2_SIZE, BOOT_SIZE, DL_DVD_SIZE, GCN_MAGIC,
|
||||||
SECTOR_SIZE, WII_MAGIC,
|
MINI_DVD_SIZE, REGION_SIZE, SECTOR_SIZE, SL_DVD_SIZE, WII_MAGIC,
|
||||||
};
|
};
|
||||||
pub use io::{
|
pub use io::{
|
||||||
block::{DiscStream, PartitionInfo},
|
block::{DiscStream, PartitionInfo},
|
||||||
|
|
Loading…
Reference in New Issue