Trait object::read::Object [−][src]
pub trait Object<'data: 'file, 'file>: Sealed { type Segment: ObjectSegment<'data>; type SegmentIterator: Iterator<Item = Self::Segment>; type Section: ObjectSection<'data>; type SectionIterator: Iterator<Item = Self::Section>; type Comdat: ObjectComdat<'data>; type ComdatIterator: Iterator<Item = Self::Comdat>; type Symbol: ObjectSymbol<'data>; type SymbolIterator: Iterator<Item = Self::Symbol>; type SymbolTable: ObjectSymbolTable<'data, Symbol = Self::Symbol, SymbolIterator = Self::SymbolIterator>; type DynamicRelocationIterator: Iterator<Item = (u64, Relocation)>;}Show methods
fn architecture(&self) -> Architecture; fn is_little_endian(&self) -> bool; fn is_64(&self) -> bool; fn segments(&'file self) -> Self::SegmentIterator; fn section_by_name(&'file self, section_name: &str) -> Option<Self::Section>; fn section_by_index(
&'file self,
index: SectionIndex
) -> Result<Self::Section>; fn sections(&'file self) -> Self::SectionIterator; fn comdats(&'file self) -> Self::ComdatIterator; fn symbol_table(&'file self) -> Option<Self::SymbolTable>; fn symbol_by_index(&'file self, index: SymbolIndex) -> Result<Self::Symbol>; fn symbols(&'file self) -> Self::SymbolIterator; fn dynamic_symbol_table(&'file self) -> Option<Self::SymbolTable>; fn dynamic_symbols(&'file self) -> Self::SymbolIterator; fn dynamic_relocations(
&'file self
) -> Option<Self::DynamicRelocationIterator>; fn imports(&self) -> Result<Vec<Import<'data>>>; fn exports(&self) -> Result<Vec<Export<'data>>>; fn has_debug_symbols(&self) -> bool; fn relative_address_base(&'file self) -> u64; fn entry(&'file self) -> u64; fn flags(&self) -> FileFlags; fn endianness(&self) -> Endianness { ... } fn symbol_map(&'file self) -> SymbolMap<SymbolMapName<'data>> { ... } fn object_map(&'file self) -> ObjectMap<'data> { ... } fn mach_uuid(&self) -> Result<Option<[u8; 16]>> { ... } fn build_id(&self) -> Result<Option<&'data [u8]>> { ... } fn gnu_debuglink(&self) -> Result<Option<(&'data [u8], u32)>> { ... } fn gnu_debugaltlink(&self) -> Result<Option<(&'data [u8], &'data [u8])>> { ... } fn pdb_info(&self) -> Result<Option<CodeView<'_>>> { ... }
Expand description
An object file.
Associated Types
type Segment: ObjectSegment<'data>
[src]
type Segment: ObjectSegment<'data>
[src]A segment in the object file.
type SegmentIterator: Iterator<Item = Self::Segment>
[src]
type SegmentIterator: Iterator<Item = Self::Segment>
[src]An iterator over the segments in the object file.
type Section: ObjectSection<'data>
[src]
type Section: ObjectSection<'data>
[src]A section in the object file.
type SectionIterator: Iterator<Item = Self::Section>
[src]
type SectionIterator: Iterator<Item = Self::Section>
[src]An iterator over the sections in the object file.
type Comdat: ObjectComdat<'data>
[src]
type Comdat: ObjectComdat<'data>
[src]A COMDAT section group in the object file.
type ComdatIterator: Iterator<Item = Self::Comdat>
[src]
type ComdatIterator: Iterator<Item = Self::Comdat>
[src]An iterator over the COMDAT section groups in the object file.
type Symbol: ObjectSymbol<'data>
[src]
type Symbol: ObjectSymbol<'data>
[src]A symbol in the object file.
type SymbolIterator: Iterator<Item = Self::Symbol>
[src]
type SymbolIterator: Iterator<Item = Self::Symbol>
[src]An iterator over symbols in the object file.
type SymbolTable: ObjectSymbolTable<'data, Symbol = Self::Symbol, SymbolIterator = Self::SymbolIterator>
[src]
type SymbolTable: ObjectSymbolTable<'data, Symbol = Self::Symbol, SymbolIterator = Self::SymbolIterator>
[src]A symbol table in the object file.
type DynamicRelocationIterator: Iterator<Item = (u64, Relocation)>
[src]
type DynamicRelocationIterator: Iterator<Item = (u64, Relocation)>
[src]An iterator over dynamic relocations in the file.
The first field in the item tuple is the address that the relocation applies to.
Required methods
fn architecture(&self) -> Architecture
[src]
fn architecture(&self) -> Architecture
[src]Get the architecture type of the file.
fn is_little_endian(&self) -> bool
[src]
fn is_little_endian(&self) -> bool
[src]Return true if the file is little endian, false if it is big endian.
fn segments(&'file self) -> Self::SegmentIterator
[src]
fn segments(&'file self) -> Self::SegmentIterator
[src]Get an iterator over the segments in the file.
fn section_by_name(&'file self, section_name: &str) -> Option<Self::Section>
[src]
fn section_by_name(&'file self, section_name: &str) -> Option<Self::Section>
[src]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 “.debug_str_offsets” is requested for a Mach-O object file, then the actual section name that is searched for is “__debug_str_offs”.
- 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.
This method skips over sections with invalid names.
fn section_by_index(&'file self, index: SectionIndex) -> Result<Self::Section>
[src]
fn section_by_index(&'file self, index: SectionIndex) -> Result<Self::Section>
[src]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.
Returns an error if the index is invalid.
fn sections(&'file self) -> Self::SectionIterator
[src]
fn sections(&'file self) -> Self::SectionIterator
[src]Get an iterator over the sections in the file.
fn comdats(&'file self) -> Self::ComdatIterator
[src]
fn comdats(&'file self) -> Self::ComdatIterator
[src]Get an iterator over the COMDAT section groups in the file.
fn symbol_table(&'file self) -> Option<Self::SymbolTable>
[src]
fn symbol_table(&'file self) -> Option<Self::SymbolTable>
[src]Get the symbol table, if any.
fn symbol_by_index(&'file self, index: SymbolIndex) -> Result<Self::Symbol>
[src]
fn symbol_by_index(&'file self, index: SymbolIndex) -> Result<Self::Symbol>
[src]Get the debugging symbol at the given index.
The meaning of the index depends on the object file.
Returns an error if the index is invalid.
fn symbols(&'file self) -> Self::SymbolIterator
[src]
fn symbols(&'file self) -> Self::SymbolIterator
[src]Get an iterator over the debugging symbols in the file.
This may skip over symbols that are malformed or unsupported.
For Mach-O files, this does not include STAB entries.
fn dynamic_symbol_table(&'file self) -> Option<Self::SymbolTable>
[src]
fn dynamic_symbol_table(&'file self) -> Option<Self::SymbolTable>
[src]Get the dynamic linking symbol table, if any.
Only ELF has a separate dynamic linking symbol table.
fn dynamic_symbols(&'file self) -> Self::SymbolIterator
[src]
fn dynamic_symbols(&'file self) -> Self::SymbolIterator
[src]Get an iterator over the dynamic linking symbols in the file.
This may skip over symbols that are malformed or unsupported.
Only ELF has separate dynamic linking symbols. Other file formats will return an empty iterator.
fn dynamic_relocations(&'file self) -> Option<Self::DynamicRelocationIterator>
[src]
fn dynamic_relocations(&'file self) -> Option<Self::DynamicRelocationIterator>
[src]Get the dynamic relocations for this file.
Symbol indices in these relocations refer to the dynamic symbol table.
Only ELF has dynamic relocations.
fn has_debug_symbols(&self) -> bool
[src]
fn has_debug_symbols(&self) -> bool
[src]Return true if the file contains debug information sections, false if not.
fn relative_address_base(&'file self) -> u64
[src]
fn relative_address_base(&'file self) -> u64
[src]Get the base address used for relative virtual addresses.
Currently this is only non-zero for PE.
Provided methods
fn endianness(&self) -> Endianness
[src]
fn endianness(&self) -> Endianness
[src]Get the endianness of the file.
fn symbol_map(&'file self) -> SymbolMap<SymbolMapName<'data>>
[src]
fn symbol_map(&'file self) -> SymbolMap<SymbolMapName<'data>>
[src]Construct a map from addresses to symbol names.
The map will only contain defined text and data symbols. The dynamic symbol table will only be used if there are no debugging symbols.
fn object_map(&'file self) -> ObjectMap<'data>
[src]
fn object_map(&'file self) -> ObjectMap<'data>
[src]Construct a map from addresses to symbol names and object file names.
This is derived from Mach-O STAB entries.
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.
Implementors
impl<'data, 'file, Elf, R> Object<'data, 'file> for ElfFile<'data, Elf, R> where
'data: 'file,
Elf: FileHeader,
R: 'file + ReadRef<'data>,
[src]
impl<'data, 'file, Elf, R> Object<'data, 'file> for ElfFile<'data, Elf, R> where
'data: 'file,
Elf: FileHeader,
R: 'file + ReadRef<'data>,
[src]type Segment = ElfSegment<'data, 'file, Elf, R>
type SegmentIterator = ElfSegmentIterator<'data, 'file, Elf, R>
type Section = ElfSection<'data, 'file, Elf, R>
type SectionIterator = ElfSectionIterator<'data, 'file, Elf, R>
type ComdatIterator = ElfComdatIterator<'data, 'file, Elf, R>
type SymbolIterator = ElfSymbolIterator<'data, 'file, Elf>
type SymbolTable = ElfSymbolTable<'data, 'file, Elf>
type DynamicRelocationIterator = ElfDynamicRelocationIterator<'data, 'file, Elf, R>
fn segments(&'file self) -> ElfSegmentIterator<'data, 'file, Elf, R>ⓘNotable traits for ElfSegmentIterator<'data, 'file, Elf, R>
impl<'data, 'file, Elf, R> Iterator for ElfSegmentIterator<'data, 'file, Elf, R> where
Elf: FileHeader,
R: ReadRef<'data>, type Item = ElfSegment<'data, 'file, Elf, R>;
[src]fn section_by_name(
&'file self,
section_name: &str
) -> Option<ElfSection<'data, 'file, Elf, R>>
[src]fn section_by_index(
&'file self,
index: SectionIndex
) -> Result<ElfSection<'data, 'file, Elf, R>>
[src]fn sections(&'file self) -> ElfSectionIterator<'data, 'file, Elf, R>ⓘNotable traits for ElfSectionIterator<'data, 'file, Elf, R>
impl<'data, 'file, Elf, R> Iterator for ElfSectionIterator<'data, 'file, Elf, R> where
Elf: FileHeader,
R: ReadRef<'data>, type Item = ElfSection<'data, 'file, Elf, R>;
[src]fn comdats(&'file self) -> ElfComdatIterator<'data, 'file, Elf, R>ⓘNotable traits for ElfComdatIterator<'data, 'file, Elf, R>
impl<'data, 'file, Elf, R> Iterator for ElfComdatIterator<'data, 'file, Elf, R> where
Elf: FileHeader,
R: ReadRef<'data>, type Item = ElfComdat<'data, 'file, Elf, R>;
[src]fn symbols(&'file self) -> ElfSymbolIterator<'data, 'file, Elf>ⓘNotable traits for ElfSymbolIterator<'data, 'file, Elf>
impl<'data, 'file, Elf: FileHeader> Iterator for ElfSymbolIterator<'data, 'file, Elf> type Item = ElfSymbol<'data, 'file, Elf>;
[src]fn dynamic_symbols(&'file self) -> ElfSymbolIterator<'data, 'file, Elf>ⓘNotable traits for ElfSymbolIterator<'data, 'file, Elf>
impl<'data, 'file, Elf: FileHeader> Iterator for ElfSymbolIterator<'data, 'file, Elf> type Item = ElfSymbol<'data, 'file, Elf>;
[src]fn dynamic_relocations(
&'file self
) -> Option<ElfDynamicRelocationIterator<'data, 'file, Elf, R>>
[src]impl<'data, 'file, Mach, R> Object<'data, 'file> for MachOFile<'data, Mach, R> where
'data: 'file,
Mach: MachHeader,
R: 'file + ReadRef<'data>,
[src]
impl<'data, 'file, Mach, R> Object<'data, 'file> for MachOFile<'data, Mach, R> where
'data: 'file,
Mach: MachHeader,
R: 'file + ReadRef<'data>,
[src]type Segment = MachOSegment<'data, 'file, Mach, R>
type SegmentIterator = MachOSegmentIterator<'data, 'file, Mach, R>
type Section = MachOSection<'data, 'file, Mach, R>
type SectionIterator = MachOSectionIterator<'data, 'file, Mach, R>
type Comdat = MachOComdat<'data, 'file, Mach, R>
type ComdatIterator = MachOComdatIterator<'data, 'file, Mach, R>
type Symbol = MachOSymbol<'data, 'file, Mach, R>
type SymbolIterator = MachOSymbolIterator<'data, 'file, Mach, R>
type SymbolTable = MachOSymbolTable<'data, 'file, Mach, R>
fn segments(&'file self) -> MachOSegmentIterator<'data, 'file, Mach, R>ⓘNotable traits for MachOSegmentIterator<'data, 'file, Mach, R>
impl<'data, 'file, Mach, R> Iterator for MachOSegmentIterator<'data, 'file, Mach, R> where
Mach: MachHeader,
R: ReadRef<'data>, type Item = MachOSegment<'data, 'file, Mach, R>;
[src]fn section_by_name(
&'file self,
section_name: &str
) -> Option<MachOSection<'data, 'file, Mach, R>>
[src]fn section_by_index(
&'file self,
index: SectionIndex
) -> Result<MachOSection<'data, 'file, Mach, R>>
[src]fn sections(&'file self) -> MachOSectionIterator<'data, 'file, Mach, R>ⓘNotable traits for MachOSectionIterator<'data, 'file, Mach, R>
impl<'data, 'file, Mach, R> Iterator for MachOSectionIterator<'data, 'file, Mach, R> where
Mach: MachHeader,
R: ReadRef<'data>, type Item = MachOSection<'data, 'file, Mach, R>;
[src]fn comdats(&'file self) -> MachOComdatIterator<'data, 'file, Mach, R>ⓘNotable traits for MachOComdatIterator<'data, 'file, Mach, R>
impl<'data, 'file, Mach, R> Iterator for MachOComdatIterator<'data, 'file, Mach, R> where
Mach: MachHeader,
R: ReadRef<'data>, type Item = MachOComdat<'data, 'file, Mach, R>;
[src]fn symbol_by_index(
&'file self,
index: SymbolIndex
) -> Result<MachOSymbol<'data, 'file, Mach, R>>
[src]fn symbols(&'file self) -> MachOSymbolIterator<'data, 'file, Mach, R>ⓘNotable traits for MachOSymbolIterator<'data, 'file, Mach, R>
impl<'data, 'file, Mach, R> Iterator for MachOSymbolIterator<'data, 'file, Mach, R> where
Mach: MachHeader,
R: ReadRef<'data>, type Item = MachOSymbol<'data, 'file, Mach, R>;
[src]fn dynamic_symbols(&'file self) -> MachOSymbolIterator<'data, 'file, Mach, R>ⓘNotable traits for MachOSymbolIterator<'data, 'file, Mach, R>
impl<'data, 'file, Mach, R> Iterator for MachOSymbolIterator<'data, 'file, Mach, R> where
Mach: MachHeader,
R: ReadRef<'data>, type Item = MachOSymbol<'data, 'file, Mach, R>;
[src]impl<'data, 'file, Pe, R> Object<'data, 'file> for PeFile<'data, Pe, R> where
'data: 'file,
Pe: ImageNtHeaders,
R: 'file + ReadRef<'data>,
[src]
impl<'data, 'file, Pe, R> Object<'data, 'file> for PeFile<'data, Pe, R> where
'data: 'file,
Pe: ImageNtHeaders,
R: 'file + ReadRef<'data>,
[src]type SegmentIterator = PeSegmentIterator<'data, 'file, Pe, R>
type SectionIterator = PeSectionIterator<'data, 'file, Pe, R>
type ComdatIterator = PeComdatIterator<'data, 'file, Pe, R>
type Symbol = CoffSymbol<'data, 'file>
type SymbolIterator = CoffSymbolIterator<'data, 'file>
type SymbolTable = CoffSymbolTable<'data, 'file>
fn segments(&'file self) -> PeSegmentIterator<'data, 'file, Pe, R>ⓘNotable traits for PeSegmentIterator<'data, 'file, Pe, R>
impl<'data, 'file, Pe, R> Iterator for PeSegmentIterator<'data, 'file, Pe, R> where
Pe: ImageNtHeaders,
R: ReadRef<'data>, type Item = PeSegment<'data, 'file, Pe, R>;
[src]fn section_by_index(
&'file self,
index: SectionIndex
) -> Result<PeSection<'data, 'file, Pe, R>>
[src]fn sections(&'file self) -> PeSectionIterator<'data, 'file, Pe, R>ⓘNotable traits for PeSectionIterator<'data, 'file, Pe, R>
impl<'data, 'file, Pe, R> Iterator for PeSectionIterator<'data, 'file, Pe, R> where
Pe: ImageNtHeaders,
R: ReadRef<'data>, type Item = PeSection<'data, 'file, Pe, R>;
[src]fn comdats(&'file self) -> PeComdatIterator<'data, 'file, Pe, R>ⓘNotable traits for PeComdatIterator<'data, 'file, Pe, R>
impl<'data, 'file, Pe, R> Iterator for PeComdatIterator<'data, 'file, Pe, R> where
Pe: ImageNtHeaders,
R: ReadRef<'data>, type Item = PeComdat<'data, 'file, Pe, R>;
[src]fn symbols(&'file self) -> CoffSymbolIterator<'data, 'file>ⓘNotable traits for CoffSymbolIterator<'data, 'file>
impl<'data, 'file> Iterator for CoffSymbolIterator<'data, 'file> type Item = CoffSymbol<'data, 'file>;
[src]fn dynamic_symbols(&'file self) -> CoffSymbolIterator<'data, 'file>ⓘNotable traits for CoffSymbolIterator<'data, 'file>
impl<'data, 'file> Iterator for CoffSymbolIterator<'data, 'file> type Item = CoffSymbol<'data, 'file>;
[src]type Segment = CoffSegment<'data, 'file, R>
type SegmentIterator = CoffSegmentIterator<'data, 'file, R>
type Section = CoffSection<'data, 'file, R>
type SectionIterator = CoffSectionIterator<'data, 'file, R>
type Comdat = CoffComdat<'data, 'file, R>
type ComdatIterator = CoffComdatIterator<'data, 'file, R>
type Symbol = CoffSymbol<'data, 'file>
type SymbolIterator = CoffSymbolIterator<'data, 'file>
type SymbolTable = CoffSymbolTable<'data, 'file>
fn segments(&'file self) -> CoffSegmentIterator<'data, 'file, R>ⓘNotable traits for CoffSegmentIterator<'data, 'file, R>
impl<'data, 'file, R: ReadRef<'data>> Iterator for CoffSegmentIterator<'data, 'file, R> type Item = CoffSegment<'data, 'file, R>;
[src]fn sections(&'file self) -> CoffSectionIterator<'data, 'file, R>ⓘNotable traits for CoffSectionIterator<'data, 'file, R>
impl<'data, 'file, R: ReadRef<'data>> Iterator for CoffSectionIterator<'data, 'file, R> type Item = CoffSection<'data, 'file, R>;
[src]fn comdats(&'file self) -> CoffComdatIterator<'data, 'file, R>ⓘNotable traits for CoffComdatIterator<'data, 'file, R>
impl<'data, 'file, R: ReadRef<'data>> Iterator for CoffComdatIterator<'data, 'file, R> type Item = CoffComdat<'data, 'file, R>;
[src]fn symbols(&'file self) -> CoffSymbolIterator<'data, 'file>ⓘNotable traits for CoffSymbolIterator<'data, 'file>
impl<'data, 'file> Iterator for CoffSymbolIterator<'data, 'file> type Item = CoffSymbol<'data, 'file>;
[src]fn dynamic_symbols(&'file self) -> CoffSymbolIterator<'data, 'file>ⓘNotable traits for CoffSymbolIterator<'data, 'file>
impl<'data, 'file> Iterator for CoffSymbolIterator<'data, 'file> type Item = CoffSymbol<'data, 'file>;
[src]type SegmentIterator = SegmentIterator<'data, 'file, R>
type SectionIterator = SectionIterator<'data, 'file, R>
type ComdatIterator = ComdatIterator<'data, 'file, R>
type SymbolIterator = SymbolIterator<'data, 'file, R>
type SymbolTable = SymbolTable<'data, 'file, R>
type DynamicRelocationIterator = DynamicRelocationIterator<'data, 'file, R>
fn segments(&'file self) -> SegmentIterator<'data, 'file, R>ⓘNotable traits for SegmentIterator<'data, 'file, R>
impl<'data, 'file, R: ReadRef<'data>> Iterator for SegmentIterator<'data, 'file, R> type Item = Segment<'data, 'file, R>;
[src]fn sections(&'file self) -> SectionIterator<'data, 'file, R>ⓘNotable traits for SectionIterator<'data, 'file, R>
impl<'data, 'file, R: ReadRef<'data>> Iterator for SectionIterator<'data, 'file, R> type Item = Section<'data, 'file, R>;
[src]fn comdats(&'file self) -> ComdatIterator<'data, 'file, R>ⓘNotable traits for ComdatIterator<'data, 'file, R>
impl<'data, 'file, R: ReadRef<'data>> Iterator for ComdatIterator<'data, 'file, R> type Item = Comdat<'data, 'file, R>;
[src]fn symbols(&'file self) -> SymbolIterator<'data, 'file, R>ⓘNotable traits for SymbolIterator<'data, 'file, R>
impl<'data, 'file, R: ReadRef<'data>> Iterator for SymbolIterator<'data, 'file, R> type Item = Symbol<'data, 'file, R>;
[src]fn dynamic_symbols(&'file self) -> SymbolIterator<'data, 'file, R>ⓘNotable traits for SymbolIterator<'data, 'file, R>
impl<'data, 'file, R: ReadRef<'data>> Iterator for SymbolIterator<'data, 'file, R> type Item = Symbol<'data, 'file, R>;
[src]