pub struct Overlay<'a> { /* private fields */ }Expand description
An overlay module for ARM9/ARM7.
Implementations§
Source§impl<'a> Overlay<'a>
impl<'a> Overlay<'a>
Sourcepub fn new<T: Into<Cow<'a, [u8]>>>(
data: T,
options: OverlayOptions,
) -> Result<Self, OverlayError>
pub fn new<T: Into<Cow<'a, [u8]>>>( data: T, options: OverlayOptions, ) -> Result<Self, OverlayError>
Creates a new Overlay from plain data.
Sourcepub fn parse_arm9(
overlay: &Overlay,
rom: &'a Rom<'_>,
arm9: &Arm9<'_>,
) -> Result<Self, OverlayError>
pub fn parse_arm9( overlay: &Overlay, rom: &'a Rom<'_>, arm9: &Arm9<'_>, ) -> Result<Self, OverlayError>
Sourcepub fn parse_arm7(
overlay: &Overlay,
rom: &'a Rom<'_>,
) -> Result<Self, OverlayError>
pub fn parse_arm7( overlay: &Overlay, rom: &'a Rom<'_>, ) -> Result<Self, OverlayError>
Sourcepub fn base_address(&self) -> u32
pub fn base_address(&self) -> u32
Returns the base address of this Overlay.
Sourcepub fn end_address(&self) -> u32
pub fn end_address(&self) -> u32
Returns the end address of this Overlay.
Sourcepub fn ctor_start(&self) -> u32
pub fn ctor_start(&self) -> u32
Returns the offset to the start of the .ctor section.
Sourcepub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
Returns whether this Overlay is compressed. See Self::originally_compressed for whether this overlay was
compressed originally.
Sourcepub fn decompress(&mut self) -> Result<(), Lz77DecompressError>
pub fn decompress(&mut self) -> Result<(), Lz77DecompressError>
Decompresses this Overlay, but does nothing if already decompressed.
Sourcepub fn info(&self) -> &OverlayInfo
pub fn info(&self) -> &OverlayInfo
Returns a reference to the info of this Overlay.
Sourcepub fn originally_compressed(&self) -> bool
pub fn originally_compressed(&self) -> bool
Returns whether this Overlay was compressed originally. See Self::is_compressed for the current state.
Sourcepub fn compute_signature(
&self,
hmac_sha1: &HmacSha1,
) -> Result<HmacSha1Signature, OverlayError>
pub fn compute_signature( &self, hmac_sha1: &HmacSha1, ) -> Result<HmacSha1Signature, OverlayError>
Computes the signature of this Overlay using the given HMAC-SHA1 key.
Sourcepub fn signature(&self) -> Option<HmacSha1Signature>
pub fn signature(&self) -> Option<HmacSha1Signature>
Returns the signature of this Overlay, if it exists.
Sourcepub fn verify_signature(
&self,
hmac_sha1: &HmacSha1,
) -> Result<bool, OverlayError>
pub fn verify_signature( &self, hmac_sha1: &HmacSha1, ) -> Result<bool, OverlayError>
Verifies the signature of this Overlay using the given HMAC-SHA1 key.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Overlay<'a>
impl<'a> RefUnwindSafe for Overlay<'a>
impl<'a> Send for Overlay<'a>
impl<'a> Sync for Overlay<'a>
impl<'a> Unpin for Overlay<'a>
impl<'a> UnsafeUnpin for Overlay<'a>
impl<'a> UnwindSafe for Overlay<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more