pub struct MachoFile<'data> { /* private fields */ }Expand description
The MachoFile type.
Implementations§
Source§impl<'data> MachoFile<'data>
impl<'data> MachoFile<'data>
Sourcepub fn header(&self) -> &MachoHeader
pub fn header(&self) -> &MachoHeader
Performs header.
Sourcepub fn load_commands(&self) -> &[ParsedLoadCommand]
pub fn load_commands(&self) -> &[ParsedLoadCommand]
Performs load_commands.
Sourcepub fn all_sections(&self) -> impl Iterator<Item = &Section>
pub fn all_sections(&self) -> impl Iterator<Item = &Section>
Flat iterator over all sections across all segments.
Sourcepub fn find_load_command(
&self,
pred: impl Fn(&LoadCommand) -> bool,
) -> Option<&ParsedLoadCommand>
pub fn find_load_command( &self, pred: impl Fn(&LoadCommand) -> bool, ) -> Option<&ParsedLoadCommand>
Find the first load command whose kind matches the predicate.
Sourcepub fn load_command_code(
&self,
command: &ParsedLoadCommand,
) -> Result<u32, ParseError>
pub fn load_command_code( &self, command: &ParsedLoadCommand, ) -> Result<u32, ParseError>
Return the exact numeric command word retained in the input.
Sourcepub fn address_map(&self) -> &AddressMap
pub fn address_map(&self) -> &AddressMap
Performs address_map.
Sourcepub fn image_base(&self) -> Va
pub fn image_base(&self) -> Va
Performs image_base.
Sourcepub fn section_bytes(
&self,
seg_name: &str,
sect_name: &str,
) -> Result<&'data [u8], ParseError>
pub fn section_bytes( &self, seg_name: &str, sect_name: &str, ) -> Result<&'data [u8], ParseError>
Performs section_bytes.
Sourcepub fn read_bytes_at(
&self,
offset: ThinFileOffset,
len: usize,
) -> Result<&'data [u8], ParseError>
pub fn read_bytes_at( &self, offset: ThinFileOffset, len: usize, ) -> Result<&'data [u8], ParseError>
Performs read_bytes_at.
Sourcepub fn read_bytes_at_va(
&self,
va: Va,
len: usize,
) -> Result<&'data [u8], ParseError>
pub fn read_bytes_at_va( &self, va: Va, len: usize, ) -> Result<&'data [u8], ParseError>
Performs read_bytes_at_va.
Sourcepub fn read_bytes_at_rva(
&self,
rva: Rva,
len: usize,
) -> Result<&'data [u8], ParseError>
pub fn read_bytes_at_rva( &self, rva: Rva, len: usize, ) -> Result<&'data [u8], ParseError>
Performs read_bytes_at_rva.
Trait Implementations§
Auto Trait Implementations§
impl<'data> Freeze for MachoFile<'data>
impl<'data> RefUnwindSafe for MachoFile<'data>
impl<'data> Send for MachoFile<'data>
impl<'data> Sync for MachoFile<'data>
impl<'data> Unpin for MachoFile<'data>
impl<'data> UnsafeUnpin for MachoFile<'data>
impl<'data> UnwindSafe for MachoFile<'data>
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