pub struct SymbolTable<'data, R = &'data [u8], Coff = ImageFileHeader>where
R: ReadRef<'data>,
Coff: CoffHeader,{
symbols: &'data [Coff::ImageSymbolBytes],
strings: StringTable<'data, R>,
}
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
.
Fields§
§symbols: &'data [Coff::ImageSymbolBytes]
§strings: StringTable<'data, R>
Implementations§
source§impl<'data, R: ReadRef<'data>, Coff: CoffHeader> SymbolTable<'data, R, Coff>
impl<'data, R: ReadRef<'data>, Coff: CoffHeader> SymbolTable<'data, R, Coff>
sourcepub fn strings(&self) -> StringTable<'data, R>
pub fn strings(&self) -> StringTable<'data, R>
Return the string table used for the symbol names.
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
The number of symbol table entries.
This includes auxiliary symbol table entries.
sourcepub fn iter<'table>(&'table self) -> SymbolIterator<'data, 'table, R, Coff> ⓘ
pub fn iter<'table>(&'table self) -> SymbolIterator<'data, 'table, R, Coff> ⓘ
Iterate over the symbols.
sourcepub fn symbol(&self, index: SymbolIndex) -> Result<&'data Coff::ImageSymbol>
pub fn symbol(&self, index: SymbolIndex) -> Result<&'data Coff::ImageSymbol>
Return the symbol table entry at the given index.
sourcepub fn aux_function(
&self,
index: SymbolIndex,
) -> Result<&'data ImageAuxSymbolFunction>
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.
sourcepub fn aux_section(
&self,
index: SymbolIndex,
) -> Result<&'data ImageAuxSymbolSection>
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.
sourcepub fn aux_file_name(
&self,
index: SymbolIndex,
aux_count: u8,
) -> Result<&'data [u8]>
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.
sourcepub fn get<T: Pod>(&self, index: SymbolIndex, offset: usize) -> Result<&'data T>
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.
sourcepub fn map<Entry: SymbolMapEntry, F: Fn(&'data Coff::ImageSymbol) -> Option<Entry>>(
&self,
f: F,
) -> SymbolMap<Entry>
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.