Trait object::Object
[−]
[src]
pub trait Object<'data, 'file> { type Segment: ObjectSegment<'data>; type SegmentIterator: Iterator<Item = Self::Segment>; type Section: ObjectSection<'data>; type SectionIterator: Iterator<Item = Self::Section>; type SymbolIterator: Iterator<Item = Symbol<'data>>; fn machine(&self) -> Machine; fn segments(&'file self) -> Self::SegmentIterator; fn section_data_by_name(&self, section_name: &str) -> Option<&'data [u8]>; fn sections(&'file self) -> Self::SectionIterator; fn symbols(&'file self) -> Self::SymbolIterator; fn dynamic_symbols(&'file self) -> Self::SymbolIterator; fn symbol_map(&self) -> SymbolMap<'data>; fn is_little_endian(&self) -> bool; }
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 = 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 section_data_by_name(&self, section_name: &str) -> Option<&'data [u8]>
Get the contents of 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.
For example, if ".text" is requested for a Mach-O object file, then the actual
section name that is searched for is "__text".
For some object files, multiple segments may contain sections with the same name. In this case, the first matching section will be used.
fn sections(&'file self) -> Self::SectionIterator
Get an iterator over the sections in the file.
fn symbols(&'file self) -> Self::SymbolIterator
Get an iterator over the debugging symbols in the file.
fn dynamic_symbols(&'file self) -> Self::SymbolIterator
Get an iterator over the dynamic linking symbols in the file.
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.
Implementors
impl<'data, 'file> Object<'data, 'file> for ElfFile<'data> where
'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>;impl<'data, 'file> Object<'data, 'file> for MachOFile<'data> where
'data: 'file, type Segment = MachOSegment<'data, 'file>; type SegmentIterator = MachOSegmentIterator<'data, 'file>; type Section = MachOSection<'data>; type SectionIterator = MachOSectionIterator<'data, 'file>; type SymbolIterator = MachOSymbolIterator<'data>;impl<'data, 'file> Object<'data, 'file> for PeFile<'data> where
'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>;impl<'data, 'file> Object<'data, 'file> for File<'data> where
'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>;