pub struct LoadCommandData<'data, E: Endian> { /* private fields */ }Expand description
The data for a macho::LoadCommand.
Implementations§
Source§impl<'data, E: Endian> LoadCommandData<'data, E>
impl<'data, E: Endian> LoadCommandData<'data, E>
Sourcepub fn cmd(&self) -> u32
pub fn cmd(&self) -> u32
Return the cmd field of the macho::LoadCommand.
This is one of the LC_ constants.
Sourcepub fn cmdsize(&self) -> u32
pub fn cmdsize(&self) -> u32
Return the cmdsize field of the macho::LoadCommand.
Sourcepub fn raw_data(&self) -> &'data [u8] ⓘ
pub fn raw_data(&self) -> &'data [u8] ⓘ
Raw bytes of this macho::LoadCommand structure.
Sourcepub fn string(&self, endian: E, s: LcStr<E>) -> Result<&'data [u8]>
pub fn string(&self, endian: E, s: LcStr<E>) -> Result<&'data [u8]>
Parse a load command string value.
Strings used by load commands are specified by offsets that are relative to the load command header.
Sourcepub fn variant(&self) -> Result<LoadCommandVariant<'data, E>>
pub fn variant(&self) -> Result<LoadCommandVariant<'data, E>>
Parse the command data according to the cmd field.
Sourcepub fn segment_32(
self,
) -> Result<Option<(&'data SegmentCommand32<E>, &'data [u8])>>
pub fn segment_32( self, ) -> Result<Option<(&'data SegmentCommand32<E>, &'data [u8])>>
Try to parse this command as a macho::SegmentCommand32.
Returns the segment command and the data containing the sections.
Sourcepub fn symtab(self) -> Result<Option<&'data SymtabCommand<E>>>
pub fn symtab(self) -> Result<Option<&'data SymtabCommand<E>>>
Try to parse this command as a macho::SymtabCommand.
Sourcepub fn dysymtab(self) -> Result<Option<&'data DysymtabCommand<E>>>
pub fn dysymtab(self) -> Result<Option<&'data DysymtabCommand<E>>>
Try to parse this command as a macho::DysymtabCommand.
Sourcepub fn dylib(self) -> Result<Option<&'data DylibCommand<E>>>
pub fn dylib(self) -> Result<Option<&'data DylibCommand<E>>>
Try to parse this command as a macho::DylibCommand.
See also Self::dylib_use_flags to read the optional flags field.
Sourcepub fn dylib_use_flags(
self,
endian: E,
dylib: &DylibCommand<E>,
) -> Result<Option<u32>>
pub fn dylib_use_flags( self, endian: E, dylib: &DylibCommand<E>, ) -> Result<Option<u32>>
Parse the optional flags field for a dylib load command.
macho::DylibCommand traditionally uses the load command type to distinguish
between dylib kinds. macho::DylibUseCommand replaces this by encoding the
kinds in a bitfield appended after the standard DylibCommand fields. Its
presence is signalled using sentinel values in some DylibCommand fields.
Returns None if the sentinels are absent. If Some is returned, the value of
macho::Dylib::timestamp should be ignored.
Sourcepub fn uuid(self) -> Result<Option<&'data UuidCommand<E>>>
pub fn uuid(self) -> Result<Option<&'data UuidCommand<E>>>
Try to parse this command as a macho::UuidCommand.
Sourcepub fn segment_64(
self,
) -> Result<Option<(&'data SegmentCommand64<E>, &'data [u8])>>
pub fn segment_64( self, ) -> Result<Option<(&'data SegmentCommand64<E>, &'data [u8])>>
Try to parse this command as a macho::SegmentCommand64.
Sourcepub fn dyld_info(self) -> Result<Option<&'data DyldInfoCommand<E>>>
pub fn dyld_info(self) -> Result<Option<&'data DyldInfoCommand<E>>>
Try to parse this command as a macho::DyldInfoCommand.
Sourcepub fn entry_point(self) -> Result<Option<&'data EntryPointCommand<E>>>
pub fn entry_point(self) -> Result<Option<&'data EntryPointCommand<E>>>
Try to parse this command as an macho::EntryPointCommand.
Sourcepub fn unix_thread(
self,
) -> Result<Option<(&'data ThreadCommand<E>, &'data [u8])>>
pub fn unix_thread( self, ) -> Result<Option<(&'data ThreadCommand<E>, &'data [u8])>>
Try to parse this command as an LC_UNIXTHREAD macho::ThreadCommand.
Returns the thread command and the thread state data that follows it.
Sourcepub fn build_version(self) -> Result<Option<&'data BuildVersionCommand<E>>>
pub fn build_version(self) -> Result<Option<&'data BuildVersionCommand<E>>>
Try to parse this command as a macho::BuildVersionCommand.
Trait Implementations§
Source§impl<'data, E: Clone + Endian> Clone for LoadCommandData<'data, E>
impl<'data, E: Clone + Endian> Clone for LoadCommandData<'data, E>
Source§fn clone(&self) -> LoadCommandData<'data, E>
fn clone(&self) -> LoadCommandData<'data, E>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more