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>

source

pub fn parse(data: &'data [u8], virtual_address: u32) -> Result<Self>

Parse the export table given its section data and address.

source

pub fn parse_directory(data: &'data [u8]) -> Result<&'data ImageExportDirectory>

Parse the export directory given its section data.

source

pub fn directory(&self) -> &'data ImageExportDirectory

Returns the header of the export table.

source

pub fn ordinal_base(&self) -> u32

Returns the base value of ordinals.

Adding this to an address index will give an ordinal.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn target_by_ordinal(&self, ordinal: u32) -> Result<ExportTarget<'data>>

Returns the target of the export at the given ordinal.

source

pub fn target_from_address(&self, address: u32) -> Result<ExportTarget<'data>>

Convert an export address table entry into a target.

source

pub fn is_forward(&self, address: u32) -> bool

Return true if the export address table entry is a forward.

source

pub fn forward_string(&self, address: u32) -> Result<Option<&'data [u8]>>

Return the forward string if the export address table entry is a forward.

source

pub fn name_from_pointer(&self, name_pointer: u32) -> Result<&'data [u8]>

Convert an export name pointer table entry into a name.

source

pub fn exports(&self) -> Result<Vec<Export<'data>>>

Returns the parsed exports in this table.

Trait Implementations§

source§

impl<'data> Clone for ExportTable<'data>

source§

fn clone(&self) -> ExportTable<'data>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'data> Debug for ExportTable<'data>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'data> Freeze for ExportTable<'data>

§

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§

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.