Struct object::read::pe::ExportTable
source · pub struct ExportTable<'data> { /* private fields */ }
Expand description
A partially parsed PE export table.
Implementations§
source§impl<'data> ExportTable<'data>
impl<'data> ExportTable<'data>
sourcepub fn parse(data: &'data [u8], virtual_address: u32) -> Result<Self>
pub fn parse(data: &'data [u8], virtual_address: u32) -> Result<Self>
Parse the export table given its section data and address.
sourcepub fn parse_directory(data: &'data [u8]) -> Result<&'data ImageExportDirectory>
pub fn parse_directory(data: &'data [u8]) -> Result<&'data ImageExportDirectory>
Parse the export directory given its section data.
sourcepub fn directory(&self) -> &'data ImageExportDirectory
pub fn directory(&self) -> &'data ImageExportDirectory
Returns the header of the export table.
sourcepub fn ordinal_base(&self) -> u32
pub fn ordinal_base(&self) -> u32
Returns the base value of ordinals.
Adding this to an address index will give an ordinal.
sourcepub fn addresses(&self) -> &'data [U32Bytes<LE>]
pub fn addresses(&self) -> &'data [U32Bytes<LE>]
Returns the unparsed address table.
An address table entry may be a local address, or the address of a forwarded export entry.
See Self::is_forward
and Self::target_from_address
.
sourcepub fn name_pointers(&self) -> &'data [U32Bytes<LE>]
pub fn name_pointers(&self) -> &'data [U32Bytes<LE>]
Returns the unparsed name pointer table.
A name pointer table entry can be used with Self::name_from_pointer
.
sourcepub fn name_ordinals(&self) -> &'data [U16Bytes<LE>]
pub fn name_ordinals(&self) -> &'data [U16Bytes<LE>]
Returns the unparsed ordinal table.
An ordinal table entry is a 0-based index into the address table.
See Self::address_by_index
and Self::target_by_index
.
sourcepub fn name_iter(&self) -> impl Iterator<Item = (u32, u16)> + 'data
pub fn name_iter(&self) -> impl Iterator<Item = (u32, u16)> + 'data
Returns an iterator for the entries in the name pointer table and ordinal table.
A name pointer table entry can be used with Self::name_from_pointer
.
An ordinal table entry is a 0-based index into the address table.
See Self::address_by_index
and Self::target_by_index
.
sourcepub fn address_by_index(&self, index: u32) -> Result<u32>
pub fn address_by_index(&self, index: u32) -> Result<u32>
Returns the export address table entry at the given address index.
This may be a local address, or the address of a forwarded export entry.
See Self::is_forward
and Self::target_from_address
.
index
is a 0-based index into the export address table.
sourcepub fn address_by_ordinal(&self, ordinal: u32) -> Result<u32>
pub fn address_by_ordinal(&self, ordinal: u32) -> Result<u32>
Returns the export address table entry at the given ordinal.
This may be a local address, or the address of a forwarded export entry.
See Self::is_forward
and Self::target_from_address
.
sourcepub fn target_by_index(&self, index: u32) -> Result<ExportTarget<'data>>
pub fn target_by_index(&self, index: u32) -> Result<ExportTarget<'data>>
Returns the target of the export at the given address index.
index
is a 0-based index into the export address table.
sourcepub fn target_by_ordinal(&self, ordinal: u32) -> Result<ExportTarget<'data>>
pub fn target_by_ordinal(&self, ordinal: u32) -> Result<ExportTarget<'data>>
Returns the target of the export at the given ordinal.
sourcepub fn target_from_address(&self, address: u32) -> Result<ExportTarget<'data>>
pub fn target_from_address(&self, address: u32) -> Result<ExportTarget<'data>>
Convert an export address table entry into a target.
sourcepub fn is_forward(&self, address: u32) -> bool
pub fn is_forward(&self, address: u32) -> bool
Return true if the export address table entry is a forward.
sourcepub fn forward_string(&self, address: u32) -> Result<Option<&'data [u8]>>
pub fn forward_string(&self, address: u32) -> Result<Option<&'data [u8]>>
Return the forward string if the export address table entry is a forward.
sourcepub fn name_from_pointer(&self, name_pointer: u32) -> Result<&'data [u8]>
pub fn name_from_pointer(&self, name_pointer: u32) -> Result<&'data [u8]>
Convert an export name pointer table entry into a name.
Trait Implementations§
source§impl<'data> Clone for ExportTable<'data>
impl<'data> Clone for ExportTable<'data>
source§fn clone(&self) -> ExportTable<'data>
fn clone(&self) -> ExportTable<'data>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more