Struct goblin::pe::symbol::SymbolTable

source ·
pub struct SymbolTable<'a> { /* private fields */ }
Expand description

A COFF symbol table.

Implementations§

source§

impl<'a> SymbolTable<'a>

source

pub fn parse( bytes: &'a [u8], offset: usize, number: usize ) -> Result<SymbolTable<'a>>

Parse a COFF symbol table at the given offset.

The offset and number of symbols should be from the COFF header.

source

pub fn size(number: usize) -> usize

Get the size in bytes of the symbol table.

source

pub fn get(&self, index: usize) -> Option<(Option<&'a str>, Symbol)>

Get the symbol at the given index.

If the symbol has an inline name, then also returns a reference to the name’s location in bytes.

source

pub fn aux_function_definition( &self, index: usize ) -> Option<AuxFunctionDefinition>

Get the auxiliary symbol record for a function definition.

source

pub fn aux_begin_and_end_function( &self, index: usize ) -> Option<AuxBeginAndEndFunction>

Get the auxiliary symbol record for a .bf or .ef symbol record.

source

pub fn aux_weak_external(&self, index: usize) -> Option<AuxWeakExternal>

Get the auxiliary symbol record for a weak external.

source

pub fn aux_file(&self, index: usize, number: usize) -> Option<&'a str>

Get the file name from the auxiliary symbol record for a file symbol record.

source

pub fn aux_section_definition( &self, index: usize ) -> Option<AuxSectionDefinition>

Get the auxiliary symbol record for a section definition.

source

pub fn iter(&self) -> SymbolIterator<'a>

Return an iterator for the COFF symbols.

This iterator skips over auxiliary symbol records.

Trait Implementations§

source§

impl<'a> Debug for SymbolTable<'a>

source§

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

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

impl<'a> TryIntoCtx<Endian> for SymbolTable<'a>

§

type Error = Error

source§

fn try_into_ctx( self, bytes: &mut [u8], _ctx: Endian ) -> Result<usize, Self::Error>

Auto Trait Implementations§

§

impl<'a> Freeze for SymbolTable<'a>

§

impl<'a> RefUnwindSafe for SymbolTable<'a>

§

impl<'a> Send for SymbolTable<'a>

§

impl<'a> Sync for SymbolTable<'a>

§

impl<'a> Unpin for SymbolTable<'a>

§

impl<'a> UnwindSafe for SymbolTable<'a>

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.