Struct object::read::coff::SymbolTable

source ·
pub struct SymbolTable<'data, R = &'data [u8], Coff = ImageFileHeader>
where R: ReadRef<'data>, Coff: CoffHeader,
{ /* private fields */ }
Expand description

A table of symbol entries in a COFF or PE file.

Also includes the string table used for the symbol names.

Returned by CoffHeader::symbols and ImageNtHeaders::symbols.

Implementations§

source§

impl<'data, R: ReadRef<'data>, Coff: CoffHeader> SymbolTable<'data, R, Coff>

source

pub fn parse(header: &Coff, data: R) -> Result<Self>

Read the symbol table.

source

pub fn strings(&self) -> StringTable<'data, R>

Return the string table used for the symbol names.

source

pub fn is_empty(&self) -> bool

Return true if the symbol table is empty.

source

pub fn len(&self) -> usize

The number of symbol table entries.

This includes auxiliary symbol table entries.

source

pub fn iter<'table>(&'table self) -> SymbolIterator<'data, 'table, R, Coff>

Iterate over the symbols.

source

pub fn symbol(&self, index: SymbolIndex) -> Result<&'data Coff::ImageSymbol>

Return the symbol table entry at the given index.

source

pub fn aux_function( &self, index: SymbolIndex, ) -> Result<&'data ImageAuxSymbolFunction>

Return the auxiliary function symbol for the symbol table entry at the given index.

Note that the index is of the symbol, not the first auxiliary record.

source

pub fn aux_section( &self, index: SymbolIndex, ) -> Result<&'data ImageAuxSymbolSection>

Return the auxiliary section symbol for the symbol table entry at the given index.

Note that the index is of the symbol, not the first auxiliary record.

source

pub fn aux_file_name( &self, index: SymbolIndex, aux_count: u8, ) -> Result<&'data [u8]>

Return the auxiliary file name for the symbol table entry at the given index.

Note that the index is of the symbol, not the first auxiliary record.

source

pub fn get<T: Pod>(&self, index: SymbolIndex, offset: usize) -> Result<&'data T>

Return the symbol table entry or auxiliary record at the given index and offset.

source

pub fn map<Entry: SymbolMapEntry, F: Fn(&'data Coff::ImageSymbol) -> Option<Entry>>( &self, f: F, ) -> SymbolMap<Entry>

Construct a map from addresses to a user-defined map entry.

Trait Implementations§

source§

impl<'data, R, Coff> Debug for SymbolTable<'data, R, Coff>
where R: ReadRef<'data> + Debug, Coff: CoffHeader + Debug, Coff::ImageSymbolBytes: Debug,

source§

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

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

impl<'data, R: ReadRef<'data>, Coff: CoffHeader> Default for SymbolTable<'data, R, Coff>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'data, R, Coff> Freeze for SymbolTable<'data, R, Coff>
where R: Freeze,

§

impl<'data, R, Coff> RefUnwindSafe for SymbolTable<'data, R, Coff>

§

impl<'data, R, Coff> Send for SymbolTable<'data, R, Coff>
where <Coff as CoffHeader>::ImageSymbolBytes: Sync, R: Send,

§

impl<'data, R, Coff> Sync for SymbolTable<'data, R, Coff>
where <Coff as CoffHeader>::ImageSymbolBytes: Sync, R: Sync,

§

impl<'data, R, Coff> Unpin for SymbolTable<'data, R, Coff>
where R: Unpin,

§

impl<'data, R, Coff> UnwindSafe for SymbolTable<'data, R, Coff>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.