Class IMAGE_OPTIONAL_HEADER
Represents the optional header in the NT header.
Inherited Members
Namespace: PeNet.Structures
Assembly: PeNet.dll
Syntax
public class IMAGE_OPTIONAL_HEADER : AbstractStructure
Constructors
| Improve this Doc View SourceIMAGE_OPTIONAL_HEADER(Byte[], UInt32, Boolean)
Create a new IMAGE_OPTIONAL_HEADER object.
Declaration
public IMAGE_OPTIONAL_HEADER(byte[] buff, uint offset, bool is64Bit)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buff | A PE file as a byte array. |
System.UInt32 | offset | Raw offset to the optional header. |
System.Boolean | is64Bit | Set to true, if header is for a x64 application. |
Fields
| Improve this Doc View SourceDataDirectory
The Data Directories.
Declaration
public readonly IMAGE_DATA_DIRECTORY[] DataDirectory
Field Value
Type | Description |
---|---|
IMAGE_DATA_DIRECTORY[] |
Properties
| Improve this Doc View SourceAddressOfEntryPoint
RVA of the entry point function.
Declaration
public uint AddressOfEntryPoint { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
BaseOfCode
RVA to the beginning of the code section.
Declaration
public uint BaseOfCode { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
BaseOfData
RVA to the beginning of the data section.
Declaration
public uint BaseOfData { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
CheckSum
Image checksum validated at runtime for drivers, DLLs loaded at boot time and DLLs loaded into a critical system.
Declaration
public uint CheckSum { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
DllCharacteristics
DLL characteristics of the image.
Declaration
public ushort DllCharacteristics { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
FileAlignment
File alignment of the raw data of the sections in bytes.
Declaration
public uint FileAlignment { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
ImageBase
Preferred address of the image when it's loaded to memory.
Declaration
public ulong ImageBase { get; set; }
Property Value
Type | Description |
---|---|
System.UInt64 |
LoaderFlags
Obsolete
Declaration
public uint LoaderFlags { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Magic
Flag if the file is x32, x64 or a ROM image.
Declaration
public ushort Magic { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
MajorImageVersion
Major image version.
Declaration
public ushort MajorImageVersion { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
MajorLinkerVersion
Major linker version.
Declaration
public byte MajorLinkerVersion { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
MajorOperatingSystemVersion
Major operation system version to run the file.
Declaration
public ushort MajorOperatingSystemVersion { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
MajorSubsystemVersion
Major version of the subsystem.
Declaration
public ushort MajorSubsystemVersion { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
MinorImageVersion
Minor image version.
Declaration
public ushort MinorImageVersion { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
MinorLinkerVersion
Minor linker version.
Declaration
public byte MinorLinkerVersion { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
MinorOperatingSystemVersion
Minor operation system version to run the file.
Declaration
public ushort MinorOperatingSystemVersion { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
MinorSubsystemVersion
Minor version of the subsystem.
Declaration
public ushort MinorSubsystemVersion { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
NumberOfRvaAndSizes
Number of directory entries in the remainder of the optional header.
Declaration
public uint NumberOfRvaAndSizes { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
SectionAlignment
Section alignment in memory in bytes. Must be greater or equal to the file alignment.
Declaration
public uint SectionAlignment { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
SizeOfCode
Size of all code sections together.
Declaration
public uint SizeOfCode { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
SizeOfHeaders
Sum of the e_lfanwe from the DOS header, the 4 byte signature, size of the file header, size of the optional header and size of all section. Rounded to the next file alignment.
Declaration
public uint SizeOfHeaders { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
SizeOfHeapCommit
Size of the heap commit in bytes.
Declaration
public ulong SizeOfHeapCommit { get; set; }
Property Value
Type | Description |
---|---|
System.UInt64 |
SizeOfHeapReserve
Size of the heap to reserve in bytes.
Declaration
public ulong SizeOfHeapReserve { get; set; }
Property Value
Type | Description |
---|---|
System.UInt64 |
SizeOfImage
Size of the image including all headers in bytes. Must be a multiple of the section alignment.
Declaration
public uint SizeOfImage { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
SizeOfInitializedData
Size of all initialized data sections together.
Declaration
public uint SizeOfInitializedData { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
SizeOfStackCommit
Size of bytes committed for the stack in bytes.
Declaration
public ulong SizeOfStackCommit { get; set; }
Property Value
Type | Description |
---|---|
System.UInt64 |
SizeOfStackReserve
Size of stack reserve in bytes.
Declaration
public ulong SizeOfStackReserve { get; set; }
Property Value
Type | Description |
---|---|
System.UInt64 |
SizeOfUninitializedData
Size of all uninitialized data sections together.
Declaration
public uint SizeOfUninitializedData { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Subsystem
The subsystem required to run the image e.g., Windows GUI, XBOX etc. Can be resolved to a string with Utility.ResolveSubsystem(subsystem=
Declaration
public ushort Subsystem { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
Win32VersionValue
Reserved and must be 0.
Declaration
public uint Win32VersionValue { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |