object::read::macho

Type Alias MachOFile32

Source
pub type MachOFile32<'data, Endian = Endianness, R = &'data [u8]> = MachOFile<'data, MachHeader32<Endian>, R>;
Expand description

A 32-bit Mach-O object file.

Aliased Type§

struct MachOFile32<'data, Endian = Endianness, R = &'data [u8]> { /* private fields */ }

Implementations

Source§

impl<'data, Mach, R> MachOFile<'data, Mach, R>
where Mach: MachHeader, R: ReadRef<'data>,

Source

pub fn parse(data: R) -> Result<Self>

Parse the raw Mach-O file data.

Source

pub fn parse_dyld_cache_image<'cache, E: Endian>( image: &DyldCacheImage<'data, 'cache, E, R>, ) -> Result<Self>

Parse the Mach-O file for the given image from the dyld shared cache. This will read different sections from different subcaches, if necessary.

Trait Implementations

Source§

impl<'data, Mach, R> Debug for MachOFile<'data, Mach, R>
where Mach: MachHeader + Debug, R: ReadRef<'data> + Debug, Mach::Endian: Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'data, 'file, Mach, R> Object<'data, 'file> for MachOFile<'data, Mach, R>
where Mach: MachHeader, R: 'file + ReadRef<'data>, 'data: 'file,

Source§

type Segment = MachOSegment<'data, 'file, Mach, R>

A segment in the object file.
Source§

type SegmentIterator = MachOSegmentIterator<'data, 'file, Mach, R>

An iterator over the segments in the object file.
Source§

type Section = MachOSection<'data, 'file, Mach, R>

A section in the object file.
Source§

type SectionIterator = MachOSectionIterator<'data, 'file, Mach, R>

An iterator over the sections in the object file.
Source§

type Comdat = MachOComdat<'data, 'file, Mach, R>

A COMDAT section group in the object file.
Source§

type ComdatIterator = MachOComdatIterator<'data, 'file, Mach, R>

An iterator over the COMDAT section groups in the object file.
Source§

type Symbol = MachOSymbol<'data, 'file, Mach, R>

A symbol in the object file.
Source§

type SymbolIterator = MachOSymbolIterator<'data, 'file, Mach, R>

An iterator over symbols in the object file.
Source§

type SymbolTable = MachOSymbolTable<'data, 'file, Mach, R>

A symbol table in the object file.
Source§

type DynamicRelocationIterator = NoDynamicRelocationIterator

An iterator over dynamic relocations in the file. Read more
Source§

fn architecture(&self) -> Architecture

Get the architecture type of the file.
Source§

fn is_little_endian(&self) -> bool

Return true if the file is little endian, false if it is big endian.
Source§

fn is_64(&self) -> bool

Return true if the file can contain 64-bit addresses.
Source§

fn kind(&self) -> ObjectKind

Return the kind of this object.
Source§

fn segments(&'file self) -> MachOSegmentIterator<'data, 'file, Mach, R>

Get an iterator over the segments in the file.
Source§

fn section_by_name_bytes( &'file self, section_name: &[u8], ) -> Option<MachOSection<'data, 'file, Mach, R>>

Like Self::section_by_name, but allows names that are not UTF-8.
Source§

fn section_by_index( &'file self, index: SectionIndex, ) -> Result<MachOSection<'data, 'file, Mach, R>>

Get the section at the given index. Read more
Source§

fn sections(&'file self) -> MachOSectionIterator<'data, 'file, Mach, R>

Get an iterator over the sections in the file.
Source§

fn comdats(&'file self) -> MachOComdatIterator<'data, 'file, Mach, R>

Get an iterator over the COMDAT section groups in the file.
Source§

fn symbol_by_index( &'file self, index: SymbolIndex, ) -> Result<MachOSymbol<'data, 'file, Mach, R>>

Get the debugging symbol at the given index. Read more
Source§

fn symbols(&'file self) -> MachOSymbolIterator<'data, 'file, Mach, R>

Get an iterator over the debugging symbols in the file. Read more
Source§

fn symbol_table(&'file self) -> Option<MachOSymbolTable<'data, 'file, Mach, R>>

Get the symbol table, if any.
Source§

fn dynamic_symbols(&'file self) -> MachOSymbolIterator<'data, 'file, Mach, R>

Get an iterator over the dynamic linking symbols in the file. Read more
Source§

fn dynamic_symbol_table( &'file self, ) -> Option<MachOSymbolTable<'data, 'file, Mach, R>>

Get the dynamic linking symbol table, if any. Read more
Source§

fn object_map(&'file self) -> ObjectMap<'data>

Construct a map from addresses to symbol names and object file names. Read more
Source§

fn imports(&self) -> Result<Vec<Import<'data>>>

Get the imported symbols.
Source§

fn exports(&self) -> Result<Vec<Export<'data>>>

Get the exported symbols that expose both a name and an address. Read more
Source§

fn dynamic_relocations(&'file self) -> Option<NoDynamicRelocationIterator>

Get the dynamic relocations for this file. Read more
Source§

fn has_debug_symbols(&self) -> bool

Return true if the file contains debug information sections, false if not.
Source§

fn mach_uuid(&self) -> Result<Option<[u8; 16]>>

The UUID from a Mach-O LC_UUID load command.
Source§

fn relative_address_base(&self) -> u64

Get the base address used for relative virtual addresses. Read more
Source§

fn entry(&self) -> u64

Get the virtual address of the entry point of the binary
Source§

fn flags(&self) -> FileFlags

File flags that are specific to each file format.
Source§

fn endianness(&self) -> Endianness

Get the endianness of the file.
Source§

fn section_by_name(&'file self, section_name: &str) -> Option<Self::Section>

Get the section named section_name, if such a section exists. Read more
Source§

fn symbol_map(&'file self) -> SymbolMap<SymbolMapName<'data>>

Construct a map from addresses to symbol names. Read more
Source§

fn build_id(&self) -> Result<Option<&'data [u8]>>

The build ID from an ELF NT_GNU_BUILD_ID note.
The filename and CRC from a .gnu_debuglink section.
The filename and build ID from a .gnu_debugaltlink section.
Source§

fn pdb_info(&self) -> Result<Option<CodeView<'_>>>

The filename and GUID from the PE CodeView section