pub struct DataDirectories<'data> { /* private fields */ }
Expand description
The table of data directories in a PE file.
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 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