[−][src]Trait object::Object
An object file.
Associated Types
type Segment: ObjectSegment<'data>
A segment in the object file.
type SegmentIterator: Iterator<Item = Self::Segment>
An iterator over the segments in the object file.
type Section: ObjectSection<'data>
A section in the object file.
type SectionIterator: Iterator<Item = Self::Section>
An iterator over the sections in the object file.
type SymbolIterator: Iterator<Item = (SymbolIndex, Symbol<'data>)>
An iterator over the symbols in the object file.
Required methods
fn machine(&self) -> Machine
Get the machine type of the file.
fn segments(&'file self) -> Self::SegmentIterator
Get an iterator over the segments in the file.
fn entry(&'file self) -> u64
Get the entry point address of the binary
fn section_by_name(&'file self, section_name: &str) -> Option<Self::Section>
Get the section named section_name
, if such a section exists.
If section_name
starts with a '.' then it is treated as a system section name,
and is compared using the conventions specific to the object file format. This
includes:
- if ".text" is requested for a Mach-O object file, then the actual section name that is searched for is "__text".
- if ".debug_info" is requested for an ELF object file, then ".zdebug_info" may be returned (and similarly for other debug sections).
For some object files, multiple segments may contain sections with the same name. In this case, the first matching section will be used.
fn section_by_index(&'file self, index: SectionIndex) -> Option<Self::Section>
Get the section at the given index.
The meaning of the index depends on the object file.
For some object files, this requires iterating through all sections.
fn sections(&'file self) -> Self::SectionIterator
Get an iterator over the sections in the file.
fn symbol_by_index(&self, index: SymbolIndex) -> Option<Symbol<'data>>
Get the debugging symbol at the given index.
This is similar to self.symbols().nth(index)
, except that
the index will take into account malformed or unsupported symbols.
fn symbols(&'file self) -> Self::SymbolIterator
Get an iterator over the debugging symbols in the file.
This may skip over symbols that are malformed or unsupported.
fn dynamic_symbols(&'file self) -> Self::SymbolIterator
Get an iterator over the dynamic linking symbols in the file.
This may skip over symbols that are malformed or unsupported.
fn symbol_map(&self) -> SymbolMap<'data>
Construct a map from addresses to symbols.
fn is_little_endian(&self) -> bool
Return true if the file is little endian, false if it is big endian.
fn has_debug_symbols(&self) -> bool
Return true if the file contains debug information sections, false if not.
Provided methods
fn section_data_by_name(
&'file self,
section_name: &str
) -> Option<Cow<'data, [u8]>>
&'file self,
section_name: &str
) -> Option<Cow<'data, [u8]>>
Get the contents of the section named section_name
, if such
a section exists.
The section_name
is interpreted according to Self::section_by_name
.
This may decompress section data.
fn symbol_data(&'file self, symbol: &Symbol<'data>) -> Option<&'data [u8]>
Get the data for the given symbol.
fn mach_uuid(&self) -> Option<Uuid>
The UUID from a Mach-O LC_UUID
load command.
fn build_id(&self) -> Option<&'data [u8]>
The build ID from an ELF NT_GNU_BUILD_ID
note.
fn gnu_debuglink(&self) -> Option<(&'data [u8], u32)>
The filename and CRC from a .gnu_debuglink
section.
Implementors
impl<'data, 'file> Object<'data, 'file> for ElfFile<'data> where
'data: 'file,
[src]
'data: 'file,
type Segment = ElfSegment<'data, 'file>
type SegmentIterator = ElfSegmentIterator<'data, 'file>
type Section = ElfSection<'data, 'file>
type SectionIterator = ElfSectionIterator<'data, 'file>
type SymbolIterator = ElfSymbolIterator<'data, 'file>
fn machine(&self) -> Machine
[src]
ⓘImportant traits for ElfSegmentIterator<'data, 'file>fn segments(&'file self) -> ElfSegmentIterator<'data, 'file>
[src]
fn section_by_name(
&'file self,
section_name: &str
) -> Option<ElfSection<'data, 'file>>
[src]
&'file self,
section_name: &str
) -> Option<ElfSection<'data, 'file>>
fn section_by_index(
&'file self,
index: SectionIndex
) -> Option<ElfSection<'data, 'file>>
[src]
&'file self,
index: SectionIndex
) -> Option<ElfSection<'data, 'file>>
ⓘImportant traits for ElfSectionIterator<'data, 'file>fn sections(&'file self) -> ElfSectionIterator<'data, 'file>
[src]
fn symbol_by_index(&self, index: SymbolIndex) -> Option<Symbol<'data>>
[src]
ⓘImportant traits for ElfSymbolIterator<'data, 'file>fn symbols(&'file self) -> ElfSymbolIterator<'data, 'file>
[src]
ⓘImportant traits for ElfSymbolIterator<'data, 'file>fn dynamic_symbols(&'file self) -> ElfSymbolIterator<'data, 'file>
[src]
fn symbol_map(&self) -> SymbolMap<'data>
[src]
fn is_little_endian(&self) -> bool
[src]
fn has_debug_symbols(&self) -> bool
[src]
fn build_id(&self) -> Option<&'data [u8]>
[src]
fn gnu_debuglink(&self) -> Option<(&'data [u8], u32)>
[src]
fn entry(&self) -> u64
[src]
impl<'data, 'file> Object<'data, 'file> for File<'data> where
'data: 'file,
[src]
'data: 'file,
type Segment = Segment<'data, 'file>
type SegmentIterator = SegmentIterator<'data, 'file>
type Section = Section<'data, 'file>
type SectionIterator = SectionIterator<'data, 'file>
type SymbolIterator = SymbolIterator<'data, 'file>
fn machine(&self) -> Machine
[src]
ⓘImportant traits for SegmentIterator<'data, 'file>fn segments(&'file self) -> SegmentIterator<'data, 'file>
[src]
fn section_by_name(
&'file self,
section_name: &str
) -> Option<Section<'data, 'file>>
[src]
&'file self,
section_name: &str
) -> Option<Section<'data, 'file>>
fn section_by_index(
&'file self,
index: SectionIndex
) -> Option<Section<'data, 'file>>
[src]
&'file self,
index: SectionIndex
) -> Option<Section<'data, 'file>>
fn section_data_by_name(&self, section_name: &str) -> Option<Cow<'data, [u8]>>
[src]
ⓘImportant traits for SectionIterator<'data, 'file>fn sections(&'file self) -> SectionIterator<'data, 'file>
[src]
fn symbol_by_index(&self, index: SymbolIndex) -> Option<Symbol<'data>>
[src]
ⓘImportant traits for SymbolIterator<'data, 'file>fn symbols(&'file self) -> SymbolIterator<'data, 'file>
[src]
ⓘImportant traits for SymbolIterator<'data, 'file>fn dynamic_symbols(&'file self) -> SymbolIterator<'data, 'file>
[src]
fn symbol_map(&self) -> SymbolMap<'data>
[src]
fn is_little_endian(&self) -> bool
[src]
fn has_debug_symbols(&self) -> bool
[src]
fn mach_uuid(&self) -> Option<Uuid>
[src]
fn build_id(&self) -> Option<&'data [u8]>
[src]
fn gnu_debuglink(&self) -> Option<(&'data [u8], u32)>
[src]
fn entry(&self) -> u64
[src]
impl<'data, 'file> Object<'data, 'file> for MachOFile<'data> where
'data: 'file,
[src]
'data: 'file,
type Segment = MachOSegment<'data, 'file>
type SegmentIterator = MachOSegmentIterator<'data, 'file>
type Section = MachOSection<'data, 'file>
type SectionIterator = MachOSectionIterator<'data, 'file>
type SymbolIterator = MachOSymbolIterator<'data>
fn machine(&self) -> Machine
[src]
ⓘImportant traits for MachOSegmentIterator<'data, 'file>fn segments(&'file self) -> MachOSegmentIterator<'data, 'file>
[src]
fn section_by_name(
&'file self,
section_name: &str
) -> Option<MachOSection<'data, 'file>>
[src]
&'file self,
section_name: &str
) -> Option<MachOSection<'data, 'file>>
fn section_by_index(
&'file self,
index: SectionIndex
) -> Option<MachOSection<'data, 'file>>
[src]
&'file self,
index: SectionIndex
) -> Option<MachOSection<'data, 'file>>
ⓘImportant traits for MachOSectionIterator<'data, 'file>fn sections(&'file self) -> MachOSectionIterator<'data, 'file>
[src]
fn symbol_by_index(&self, index: SymbolIndex) -> Option<Symbol<'data>>
[src]
ⓘImportant traits for MachOSymbolIterator<'data>fn symbols(&'file self) -> MachOSymbolIterator<'data>
[src]
ⓘImportant traits for MachOSymbolIterator<'data>fn dynamic_symbols(&'file self) -> MachOSymbolIterator<'data>
[src]
fn symbol_map(&self) -> SymbolMap<'data>
[src]
fn is_little_endian(&self) -> bool
[src]
fn has_debug_symbols(&self) -> bool
[src]
fn mach_uuid(&self) -> Option<Uuid>
[src]
fn entry(&self) -> u64
[src]
impl<'data, 'file> Object<'data, 'file> for PeFile<'data> where
'data: 'file,
[src]
'data: 'file,
type Segment = PeSegment<'data, 'file>
type SegmentIterator = PeSegmentIterator<'data, 'file>
type Section = PeSection<'data, 'file>
type SectionIterator = PeSectionIterator<'data, 'file>
type SymbolIterator = PeSymbolIterator<'data, 'file>
fn machine(&self) -> Machine
[src]
ⓘImportant traits for PeSegmentIterator<'data, 'file>fn segments(&'file self) -> PeSegmentIterator<'data, 'file>
[src]
fn section_by_name(
&'file self,
section_name: &str
) -> Option<PeSection<'data, 'file>>
[src]
&'file self,
section_name: &str
) -> Option<PeSection<'data, 'file>>
fn section_by_index(
&'file self,
index: SectionIndex
) -> Option<PeSection<'data, 'file>>
[src]
&'file self,
index: SectionIndex
) -> Option<PeSection<'data, 'file>>
ⓘImportant traits for PeSectionIterator<'data, 'file>fn sections(&'file self) -> PeSectionIterator<'data, 'file>
[src]
fn symbol_by_index(&self, _index: SymbolIndex) -> Option<Symbol<'data>>
[src]
ⓘImportant traits for PeSymbolIterator<'data, 'file>fn symbols(&'file self) -> PeSymbolIterator<'data, 'file>
[src]
ⓘImportant traits for PeSymbolIterator<'data, 'file>fn dynamic_symbols(&'file self) -> PeSymbolIterator<'data, 'file>
[src]
fn symbol_map(&self) -> SymbolMap<'data>
[src]
fn is_little_endian(&self) -> bool
[src]
fn has_debug_symbols(&self) -> bool
[src]
fn entry(&self) -> u64
[src]
impl<'file> Object<'static, 'file> for WasmFile
[src]
type Segment = WasmSegment<'file>
type SegmentIterator = WasmSegmentIterator<'file>
type Section = WasmSection<'file>
type SectionIterator = WasmSectionIterator<'file>
type SymbolIterator = WasmSymbolIterator<'file>
fn machine(&self) -> Machine
[src]
fn segments(&'file self) -> Self::SegmentIterator
[src]
fn entry(&'file self) -> u64
[src]
fn section_by_name(
&'file self,
section_name: &str
) -> Option<WasmSection<'file>>
[src]
&'file self,
section_name: &str
) -> Option<WasmSection<'file>>
fn section_by_index(
&'file self,
index: SectionIndex
) -> Option<WasmSection<'file>>
[src]
&'file self,
index: SectionIndex
) -> Option<WasmSection<'file>>