Table of Contents

Class FileHeader

Namespace
AsmResolver.PE.File
Assembly
AsmResolver.PE.File.dll

Represents the COFF file header of a portable executable file.

public class FileHeader : SegmentBase, ISegment, IOffsetProvider, IWritable
Inheritance
FileHeader
Implements
Inherited Members

Fields

FileHeaderSize

Indicates the static size of the COFF file header.

public const int FileHeaderSize = 20

Field Value

int

Properties

Characteristics

Gets or sets the characteristics of the portable executable file.

public Characteristics Characteristics { get; set; }

Property Value

Characteristics

Machine

Gets or sets the machine the portable executable file is compiled for.

public MachineType Machine { get; set; }

Property Value

MachineType

NumberOfSections

Gets or sets the number of sections defined in the portable executable file.

public ushort NumberOfSections { get; set; }

Property Value

ushort

NumberOfSymbols

Gets or sets the number of symbols defined in the portable executable file.

public uint NumberOfSymbols { get; set; }

Property Value

uint

PointerToSymbolTable

Gets or sets the absolute file offset to the symbol table.

public uint PointerToSymbolTable { get; set; }

Property Value

uint

SizeOfOptionalHeader

Gets or sets the size of the optional header.

public ushort SizeOfOptionalHeader { get; set; }

Property Value

ushort

TimeDateStamp

Gets or sets the time stamp of the portable executable file.

public uint TimeDateStamp { get; set; }

Property Value

uint

Remarks

This timestamp is encoded as the number of seconds since 00:00 January 1, 1970.

Methods

FromReader(ref BinaryStreamReader)

Reads a COFF file header from an input stream.

public static FileHeader FromReader(ref BinaryStreamReader reader)

Parameters

reader BinaryStreamReader

The input stream.

Returns

FileHeader

The read file header.

GetPhysicalSize()

Computes the number of bytes that the structure contains.

public override uint GetPhysicalSize()

Returns

uint

The number of bytes.

Write(BinaryStreamWriter)

Serializes the structure to an output stream.

public override void Write(BinaryStreamWriter writer)

Parameters

writer BinaryStreamWriter

The output stream to write the data to.