mirror of https://github.com/encounter/nod-rs.git
More fixes
This commit is contained in:
parent
a8bc312dd9
commit
75e6f09b24
|
@ -653,7 +653,7 @@ impl<W> WriteCursor<W>
|
||||||
where W: Write
|
where W: Write
|
||||||
{
|
{
|
||||||
fn write_zeroes_until(&mut self, until: u64) -> io::Result<()> {
|
fn write_zeroes_until(&mut self, until: u64) -> io::Result<()> {
|
||||||
const ZEROES: [u8; 0x1000] = [0u8; 0x1000];
|
static ZEROES: [u8; 0x1000] = [0u8; 0x1000];
|
||||||
let mut remaining = until.saturating_sub(self.position);
|
let mut remaining = until.saturating_sub(self.position);
|
||||||
while remaining > 0 {
|
while remaining > 0 {
|
||||||
let write_len = remaining.min(ZEROES.len() as u64) as usize;
|
let write_len = remaining.min(ZEROES.len() as u64) as usize;
|
||||||
|
|
|
@ -47,7 +47,7 @@ pub const REGION_OFFSET: u64 = 0x4E000;
|
||||||
// ppki (Retail)
|
// ppki (Retail)
|
||||||
pub(crate) const RVL_CERT_ISSUER_PPKI_TICKET: &str = "Root-CA00000001-XS00000003";
|
pub(crate) const RVL_CERT_ISSUER_PPKI_TICKET: &str = "Root-CA00000001-XS00000003";
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
pub(crate) const RETAIL_COMMON_KEYS: [KeyBytes; 3] = [
|
pub(crate) static RETAIL_COMMON_KEYS: [KeyBytes; 3] = [
|
||||||
/* RVL_KEY_RETAIL */
|
/* RVL_KEY_RETAIL */
|
||||||
[0xeb, 0xe4, 0x2a, 0x22, 0x5e, 0x85, 0x93, 0xe4, 0x48, 0xd9, 0xc5, 0x45, 0x73, 0x81, 0xaa, 0xf7],
|
[0xeb, 0xe4, 0x2a, 0x22, 0x5e, 0x85, 0x93, 0xe4, 0x48, 0xd9, 0xc5, 0x45, 0x73, 0x81, 0xaa, 0xf7],
|
||||||
/* RVL_KEY_KOREAN */
|
/* RVL_KEY_KOREAN */
|
||||||
|
@ -59,7 +59,7 @@ pub(crate) const RETAIL_COMMON_KEYS: [KeyBytes; 3] = [
|
||||||
// dpki (Debug)
|
// dpki (Debug)
|
||||||
pub(crate) const RVL_CERT_ISSUER_DPKI_TICKET: &str = "Root-CA00000002-XS00000006";
|
pub(crate) const RVL_CERT_ISSUER_DPKI_TICKET: &str = "Root-CA00000002-XS00000006";
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
pub(crate) const DEBUG_COMMON_KEYS: [KeyBytes; 3] = [
|
pub(crate) static DEBUG_COMMON_KEYS: [KeyBytes; 3] = [
|
||||||
/* RVL_KEY_DEBUG */
|
/* RVL_KEY_DEBUG */
|
||||||
[0xa1, 0x60, 0x4a, 0x6a, 0x71, 0x23, 0xb5, 0x29, 0xae, 0x8b, 0xec, 0x32, 0xc8, 0x16, 0xfc, 0xaa],
|
[0xa1, 0x60, 0x4a, 0x6a, 0x71, 0x23, 0xb5, 0x29, 0xae, 0x8b, 0xec, 0x32, 0xc8, 0x16, 0xfc, 0xaa],
|
||||||
/* RVL_KEY_KOREAN_DEBUG */
|
/* RVL_KEY_KOREAN_DEBUG */
|
||||||
|
|
|
@ -222,7 +222,10 @@ impl dyn PartitionReader + '_ {
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// use std::io::Read;
|
/// use std::io::Read;
|
||||||
///
|
///
|
||||||
/// use nod::read::{DiscOptions, DiscReader, PartitionKind, PartitionOptions};
|
/// use nod::{
|
||||||
|
/// common::PartitionKind,
|
||||||
|
/// read::{DiscOptions, DiscReader, PartitionOptions},
|
||||||
|
/// };
|
||||||
///
|
///
|
||||||
/// fn main() -> nod::Result<()> {
|
/// fn main() -> nod::Result<()> {
|
||||||
/// let disc = DiscReader::new("path/to/file.iso", &DiscOptions::default())?;
|
/// let disc = DiscReader::new("path/to/file.iso", &DiscOptions::default())?;
|
||||||
|
@ -262,7 +265,10 @@ impl dyn PartitionReader {
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// use std::io::Read;
|
/// use std::io::Read;
|
||||||
///
|
///
|
||||||
/// use nod::read::{DiscOptions, DiscReader, OwnedFileReader, PartitionKind, PartitionOptions};
|
/// use nod::{
|
||||||
|
/// common::PartitionKind,
|
||||||
|
/// read::{DiscOptions, DiscReader, OwnedFileReader, PartitionOptions},
|
||||||
|
/// };
|
||||||
///
|
///
|
||||||
/// fn main() -> nod::Result<()> {
|
/// fn main() -> nod::Result<()> {
|
||||||
/// let disc = DiscReader::new("path/to/file.iso", &DiscOptions::default())?;
|
/// let disc = DiscReader::new("path/to/file.iso", &DiscOptions::default())?;
|
||||||
|
|
|
@ -721,7 +721,7 @@ where W: Write
|
||||||
fn flush(&mut self) -> io::Result<()> { self.inner.flush() }
|
fn flush(&mut self) -> io::Result<()> { self.inner.flush() }
|
||||||
}
|
}
|
||||||
|
|
||||||
const ZERO_SECTOR: [u8; SECTOR_SIZE] = [0; SECTOR_SIZE];
|
static ZERO_SECTOR: [u8; SECTOR_SIZE] = [0; SECTOR_SIZE];
|
||||||
|
|
||||||
impl<W> Seek for HashStream<W>
|
impl<W> Seek for HashStream<W>
|
||||||
where W: Write
|
where W: Write
|
||||||
|
|
Loading…
Reference in New Issue