pub trait ImageNtHeaders: Debug + Pod {
type ImageOptionalHeader: ImageOptionalHeader;
fn is_type_64(&self) -> bool;
fn is_valid_optional_magic(&self) -> bool;
fn signature(&self) -> u32;
fn file_header(&self) -> &ImageFileHeader;
fn optional_header(&self) -> &Self::ImageOptionalHeader;
fn parse<'data>(
dos_header: &ImageDosHeader,
data: Bytes<'data>
) -> Result<(&'data Self, &'data [ImageDataDirectory], Bytes<'data>)> { ... }
fn sections<'data>(
&self,
nt_tail: Bytes<'data>
) -> Result<SectionTable<'data>> { ... }
fn symbols<'data>(&self, data: Bytes<'data>) -> Result<SymbolTable<'data>> { ... }
}
Expand description
A trait for generic access to ImageNtHeaders32
and ImageNtHeaders64
.
Associated Types
Required methods
fn is_type_64(&self) -> bool
fn is_type_64(&self) -> bool
Return true if this type is a 64-bit header.
This is a property of the type, not a value in the header data.
fn is_valid_optional_magic(&self) -> bool
fn is_valid_optional_magic(&self) -> bool
Return true if the magic field in the optional header is valid.
fn file_header(&self) -> &ImageFileHeader
fn file_header(&self) -> &ImageFileHeader
Return the file header.
fn optional_header(&self) -> &Self::ImageOptionalHeader
fn optional_header(&self) -> &Self::ImageOptionalHeader
Return the optional header.
Provided methods
Read the NT headers, including the data directories.
The DOS header is required to determine the NT headers offset.
The given data must be for the entire file. Returns the data following the NT headers, which will contain the section headers.
Also checks that the signature
and magic
fields in the headers are valid.
fn sections<'data>(&self, nt_tail: Bytes<'data>) -> Result<SectionTable<'data>>
fn sections<'data>(&self, nt_tail: Bytes<'data>) -> Result<SectionTable<'data>>
Read the section table.
nt_tail
must be the data following the NT headers.
fn symbols<'data>(&self, data: Bytes<'data>) -> Result<SymbolTable<'data>>
fn symbols<'data>(&self, data: Bytes<'data>) -> Result<SymbolTable<'data>>
Read the symbol table and string table.
data
must be the entire file data.