Struct goblin::pe::optional_header::StandardFields
source · pub struct StandardFields {
pub magic: u16,
pub major_linker_version: u8,
pub minor_linker_version: u8,
pub size_of_code: u64,
pub size_of_initialized_data: u64,
pub size_of_uninitialized_data: u64,
pub address_of_entry_point: u64,
pub base_of_code: u64,
pub base_of_data: u32,
}
Expand description
Unified 32/64-bit standard COFF fields (for PE32
and PE32+
).
Notably, a value of this type is a member of
goblin::pe::optional_header::OptionalHeader
,
which in turn represents either
from winnt.h
, depending on the value of StandardFields::magic
.
§Position in PE binary
Standard COFF fields are located at the beginning of the OptionalHeader
and before the
WindowsFields
.
§Related structures
- For 32-bit version, see
StandardFields32
. - For 64-bit version, see
StandardFields64
.
Fields§
§magic: u16
The state of the image file. This member can be one of the following values:
major_linker_version: u8
The major version number of the linker.
minor_linker_version: u8
The minor version number of the linker.
size_of_code: u64
The size of the code section (.text), in bytes, or the sum of all such sections if there are multiple code sections.
size_of_initialized_data: u64
The size of the initialized data section (.data), in bytes, or the sum of all such sections if there are multiple initialized data sections.
size_of_uninitialized_data: u64
The size of the uninitialized data section (.bss), in bytes, or the sum of all such sections if there are multiple uninitialized data sections.
address_of_entry_point: u64
A pointer to the entry point function, relative to the image base address.
- For executable files, this is the starting address.
- For device drivers, this is the address of the initialization function.
The entry point function is optional for DLLs. When no entry point is present, this member is zero.
base_of_code: u64
A pointer to the beginning of the code section (.text), relative to the image base.
base_of_data: u32
A pointer to the beginning of the data section (.data), relative to the image base. Absent in 64-bit PE32+.
In other words, it is a Relative virtual address (RVA) of the start of the data (.data) section when the PE is loaded into memory.
Trait Implementations§
source§impl Clone for StandardFields
impl Clone for StandardFields
source§fn clone(&self) -> StandardFields
fn clone(&self) -> StandardFields
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StandardFields
impl Debug for StandardFields
source§impl Default for StandardFields
impl Default for StandardFields
source§fn default() -> StandardFields
fn default() -> StandardFields
source§impl From<StandardFields> for StandardFields32
impl From<StandardFields> for StandardFields32
source§fn from(fields: StandardFields) -> Self
fn from(fields: StandardFields) -> Self
source§impl From<StandardFields> for StandardFields64
impl From<StandardFields> for StandardFields64
source§fn from(fields: StandardFields) -> Self
fn from(fields: StandardFields) -> Self
source§impl From<StandardFields32> for StandardFields
impl From<StandardFields32> for StandardFields
source§fn from(fields: StandardFields32) -> Self
fn from(fields: StandardFields32) -> Self
source§impl From<StandardFields64> for StandardFields
impl From<StandardFields64> for StandardFields
source§fn from(fields: StandardFields64) -> Self
fn from(fields: StandardFields64) -> Self
source§impl PartialEq for StandardFields
impl PartialEq for StandardFields
source§fn eq(&self, other: &StandardFields) -> bool
fn eq(&self, other: &StandardFields) -> bool
self
and other
values to be equal, and is used
by ==
.