Struct object::read::pe::data_directory::DataDirectories

source ·
pub struct DataDirectories<'data> {
    entries: &'data [ImageDataDirectory],
}
Expand description

The table of data directories in a PE file.

Returned by ImageNtHeaders::parse.

Fields§

§entries: &'data [ImageDataDirectory]

Implementations§

source§

impl<'data> DataDirectories<'data>

source

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

Parse the data directory table.

data must be the remaining optional data following the optional header. number must be from the number_of_rva_and_sizes field of the optional header.

source

pub fn len(&self) -> usize

The number of data directories.

source

pub fn iter(&self) -> Iter<'data, ImageDataDirectory>

Iterator over the data directories.

source

pub fn enumerate(&self) -> Enumerate<Iter<'data, ImageDataDirectory>>

Iterator which gives the directories as well as their index (one of the IMAGE_DIRECTORY_ENTRY_* constants).

source

pub fn get(&self, index: usize) -> Option<&'data ImageDataDirectory>

Returns the data directory at the given index.

Index should be one of the IMAGE_DIRECTORY_ENTRY_* constants.

Returns None if the index is larger than the table size, or if the entry at the index has a zero virtual address.

source

pub fn export_directory<R: ReadRef<'data>>( &self, data: R, sections: &SectionTable<'data>, ) -> Result<Option<&'data ImageExportDirectory>>

Returns the unparsed export directory.

data must be the entire file data.

source

pub fn export_table<R: ReadRef<'data>>( &self, data: R, sections: &SectionTable<'data>, ) -> Result<Option<ExportTable<'data>>>

Returns the partially parsed export directory.

data must be the entire file data.

source

pub fn import_table<R: ReadRef<'data>>( &self, data: R, sections: &SectionTable<'data>, ) -> Result<Option<ImportTable<'data>>>

Returns the partially parsed import directory.

data must be the entire file data.

source

pub fn delay_load_import_table<R: ReadRef<'data>>( &self, data: R, sections: &SectionTable<'data>, ) -> Result<Option<DelayLoadImportTable<'data>>>

Returns the partially parsed delay-load import directory.

data must be the entire file data.

source

pub fn relocation_blocks<R: ReadRef<'data>>( &self, data: R, sections: &SectionTable<'data>, ) -> Result<Option<RelocationBlockIterator<'data>>>

Returns the blocks in the base relocation directory.

data must be the entire file data.

source

pub fn resource_directory<R: ReadRef<'data>>( &self, data: R, sections: &SectionTable<'data>, ) -> Result<Option<ResourceDirectory<'data>>>

Returns the resource directory.

data must be the entire file data.

Trait Implementations§

source§

impl<'data> Clone for DataDirectories<'data>

source§

fn clone(&self) -> DataDirectories<'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 DataDirectories<'data>

source§

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

Formats the value using the given formatter. Read more
source§

impl<'data> Copy for DataDirectories<'data>

Auto Trait Implementations§

§

impl<'data> Freeze for DataDirectories<'data>

§

impl<'data> RefUnwindSafe for DataDirectories<'data>

§

impl<'data> Send for DataDirectories<'data>

§

impl<'data> Sync for DataDirectories<'data>

§

impl<'data> Unpin for DataDirectories<'data>

§

impl<'data> UnwindSafe for DataDirectories<'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.