Skip to main content

MachoFile

Struct MachoFile 

Source
pub struct MachoFile<'data> { /* private fields */ }
Expand description

The MachoFile type.

Implementations§

Source§

impl<'data> MachoFile<'data>

Source

pub fn header(&self) -> &MachoHeader

Performs header.

Source

pub fn load_commands(&self) -> &[ParsedLoadCommand]

Performs load_commands.

Source

pub fn segments(&self) -> &[Segment]

Performs segments.

Source

pub fn endian(&self) -> Endian

Performs endian.

Source

pub fn bitness(&self) -> Bitness

Performs bitness.

Source

pub fn bytes(&self) -> &'data [u8] ⓘ

Performs bytes.

Source

pub fn file_size(&self) -> usize

Performs file_size.

Source

pub fn is_64bit(&self) -> bool

Performs is_64bit.

Source

pub fn all_sections(&self) -> impl Iterator<Item = &Section>

Flat iterator over all sections across all segments.

Source

pub fn find_load_command( &self, pred: impl Fn(&LoadCommand) -> bool, ) -> Option<&ParsedLoadCommand>

Find the first load command whose kind matches the predicate.

Source

pub fn load_command_code( &self, command: &ParsedLoadCommand, ) -> Result<u32, ParseError>

Return the exact numeric command word retained in the input.

Source

pub fn address_map(&self) -> &AddressMap

Performs address_map.

Source

pub fn uuid(&self) -> Option<&[u8; 16]>

Performs uuid.

Source

pub fn image_base(&self) -> Va

Performs image_base.

Source

pub fn section(&self, seg_name: &str, sect_name: &str) -> Option<&Section>

Performs section.

Source

pub fn section_bytes( &self, seg_name: &str, sect_name: &str, ) -> Result<&'data [u8], ParseError>

Performs section_bytes.

Source

pub fn read_bytes_at( &self, offset: ThinFileOffset, len: usize, ) -> Result<&'data [u8], ParseError>

Performs read_bytes_at.

Source

pub fn read_bytes_at_va( &self, va: Va, len: usize, ) -> Result<&'data [u8], ParseError>

Performs read_bytes_at_va.

Source

pub fn read_bytes_at_rva( &self, rva: Rva, len: usize, ) -> Result<&'data [u8], ParseError>

Performs read_bytes_at_rva.

Source§

impl<'data> MachoFile<'data>

Source

pub fn ext<E>(&self) -> Result<E, <E as MachoExt<'data>>::Error>
where E: MachoExt<'data>,

Performs ext.

Trait Implementations§

Source§

impl Debug for MachoFile<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.