pub struct OptionalHeader {
pub standard_fields: StandardFields,
pub windows_fields: WindowsFields,
pub data_directories: DataDirectories,
}Expand description
Unified 32/64-bit optional header (for PE32 and PE32+).
Optional header is the most important of the NT headers. Although it’s called “optional”, it’s actually required for PE image files.
It is meant to represent either
Whether it’s 32 or 64-bit is determined by the StandardFields::magic and by the value
CoffHeader::size_of_optional_header.
§Position in PE binary
The optional header is located after CoffHeader and before
section table.
Fields§
§standard_fields: StandardFieldsUnified standard (COFF) fields. See StandardFields to learn more.
windows_fields: WindowsFieldsUnified Windows fields. See WindowsFields to learn more.
data_directories: DataDirectoriesData directories. See DataDirectories to learn more.
Implementations§
Trait Implementations§
Source§impl Clone for OptionalHeader
impl Clone for OptionalHeader
Source§fn clone(&self) -> OptionalHeader
fn clone(&self) -> OptionalHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for OptionalHeader
Source§impl Debug for OptionalHeader
impl Debug for OptionalHeader
Source§impl PartialEq for OptionalHeader
impl PartialEq for OptionalHeader
Source§fn eq(&self, other: &OptionalHeader) -> bool
fn eq(&self, other: &OptionalHeader) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OptionalHeader
Source§impl<'a> TryFromCtx<'a, Endian> for OptionalHeader
impl<'a> TryFromCtx<'a, Endian> for OptionalHeader
Auto Trait Implementations§
impl Freeze for OptionalHeader
impl RefUnwindSafe for OptionalHeader
impl Send for OptionalHeader
impl Sync for OptionalHeader
impl Unpin for OptionalHeader
impl UnsafeUnpin for OptionalHeader
impl UnwindSafe for OptionalHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more