Struct object::read::pe::DataDirectories
source · pub struct DataDirectories<'data> { /* private fields */ }
Expand description
The table of data directories in a PE file.
Returned by ImageNtHeaders::parse
.
Implementations§
source§impl<'data> DataDirectories<'data>
impl<'data> DataDirectories<'data>
sourcepub fn parse(data: &'data [u8], number: u32) -> Result<Self>
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.
sourcepub fn iter(&self) -> Iter<'data, ImageDataDirectory>
pub fn iter(&self) -> Iter<'data, ImageDataDirectory>
Iterator over the data directories.
sourcepub fn enumerate(&self) -> Enumerate<Iter<'data, ImageDataDirectory>>
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).
sourcepub fn get(&self, index: usize) -> Option<&'data ImageDataDirectory>
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.
sourcepub fn export_directory<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<&'data ImageExportDirectory>>
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.
sourcepub fn export_table<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<ExportTable<'data>>>
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.
sourcepub fn import_table<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<ImportTable<'data>>>
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.
sourcepub fn delay_load_import_table<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<DelayLoadImportTable<'data>>>
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.
sourcepub fn relocation_blocks<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<RelocationBlockIterator<'data>>>
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.
sourcepub fn resource_directory<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<ResourceDirectory<'data>>>
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>
impl<'data> Clone for DataDirectories<'data>
source§fn clone(&self) -> DataDirectories<'data>
fn clone(&self) -> DataDirectories<'data>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more