pub struct ExportTable<'data> { /* private fields */ }
Expand description
A partially parsed PE export table.
Implementations
sourceimpl<'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.
Trait Implementations
sourceimpl<'data> Clone for ExportTable<'data>
impl<'data> Clone for ExportTable<'data>
sourcefn clone(&self) -> ExportTable<'data>
fn clone(&self) -> ExportTable<'data>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<'data> RefUnwindSafe for ExportTable<'data>
impl<'data> Send for ExportTable<'data>
impl<'data> Sync for ExportTable<'data>
impl<'data> Unpin for ExportTable<'data>
impl<'data> UnwindSafe for ExportTable<'data>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more