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
Properties
Characteristics
Gets or sets the characteristics of the portable executable file.
public Characteristics Characteristics { get; set; }
Property Value
Machine
Gets or sets the machine the portable executable file is compiled for.
public MachineType Machine { get; set; }
Property Value
NumberOfSections
Gets or sets the number of sections defined in the portable executable file.
public ushort NumberOfSections { get; set; }
Property Value
NumberOfSymbols
Gets or sets the number of symbols defined in the portable executable file.
public uint NumberOfSymbols { get; set; }
Property Value
PointerToSymbolTable
Gets or sets the absolute file offset to the symbol table.
public uint PointerToSymbolTable { get; set; }
Property Value
SizeOfOptionalHeader
Gets or sets the size of the optional header.
public ushort SizeOfOptionalHeader { get; set; }
Property Value
TimeDateStamp
Gets or sets the time stamp of the portable executable file.
public uint TimeDateStamp { get; set; }
Property Value
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
BinaryStreamReaderThe 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
BinaryStreamWriterThe output stream to write the data to.