pub struct ImportTable<'data> { /* private fields */ }
Expand description
Information for parsing a PE import table.
Implementations
sourceimpl<'data> ImportTable<'data>
impl<'data> ImportTable<'data>
sourcepub fn new(
section_data: &'data [u8],
section_address: u32,
import_address: u32
) -> Self
pub fn new(
section_data: &'data [u8],
section_address: u32,
import_address: u32
) -> Self
Create a new import table parser.
The import descriptors start at import_address
.
The size declared in the IMAGE_DIRECTORY_ENTRY_IMPORT
data directory is
ignored by the Windows loader, and so descriptors will be parsed until a null entry.
section_data
should be from the section containing import_address
, and
section_address
should be the address of that section. Pointers within the
descriptors and thunks may point to anywhere within the section data.
sourcepub fn descriptors(&self) -> Result<ImportDescriptorIterator<'data>>
pub fn descriptors(&self) -> Result<ImportDescriptorIterator<'data>>
Return an iterator for the import descriptors.
sourcepub fn name(&self, address: u32) -> Result<&'data [u8]>
pub fn name(&self, address: u32) -> Result<&'data [u8]>
Return a library name given its address.
This address may be from pe::ImageImportDescriptor::name
.
sourcepub fn thunks(&self, address: u32) -> Result<ImportThunkList<'data>>
pub fn thunks(&self, address: u32) -> Result<ImportThunkList<'data>>
Return a list of thunks given its address.
This address may be from pe::ImageImportDescriptor::original_first_thunk
or pe::ImageImportDescriptor::first_thunk
.
sourcepub fn import<Pe: ImageNtHeaders>(
&self,
thunk: Pe::ImageThunkData
) -> Result<Import<'data>>
pub fn import<Pe: ImageNtHeaders>(
&self,
thunk: Pe::ImageThunkData
) -> Result<Import<'data>>
Parse a thunk.
Trait Implementations
sourceimpl<'data> Clone for ImportTable<'data>
impl<'data> Clone for ImportTable<'data>
sourcefn clone(&self) -> ImportTable<'data>
fn clone(&self) -> ImportTable<'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 ImportTable<'data>
impl<'data> Send for ImportTable<'data>
impl<'data> Sync for ImportTable<'data>
impl<'data> Unpin for ImportTable<'data>
impl<'data> UnwindSafe for ImportTable<'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