<PackageReference Include="System.Reflection.Metadata" Version="11.0.0-preview.7.26381.103" />

System.Reflection.PortableExecutable.PEHeaderBuilder

public sealed class PEHeaderBuilder
Defines the header for a portable executable (PE) file.

Returns the dynamic linker library characteristics.

public int FileAlignment { get; }

The alignment factor (in bytes) that is used to align the raw data of sections in the image file. The value should be a power of 2 between 512 and 64K, inclusive. The default is 512. If the section alignment is less than the architecture's page size, then file alignment must match the section alignment.

public ulong ImageBase { get; }

The preferred address of the first byte of image when loaded into memory; must be a multiple of 64K.

Returns the image characteristics.

public Machine Machine { get; }

The target machine's CPU architecture.

public ushort MajorImageVersion { get; }

The major version number of the image.

public byte MajorLinkerVersion { get; }

The linker major version number.

public ushort MajorOperatingSystemVersion { get; }

The major version number of the required operating system.

public ushort MajorSubsystemVersion { get; }

The major version number of the subsystem.

public ushort MinorImageVersion { get; }

The minor version number of the image.

public byte MinorLinkerVersion { get; }

The linker minor version number.

public ushort MinorOperatingSystemVersion { get; }

The minor version number of the required operating system.

public ushort MinorSubsystemVersion { get; }

The minor version number of the subsystem.

public int SectionAlignment { get; }

The alignment (in bytes) of sections when they are loaded into memory.

public ulong SizeOfHeapCommit { get; }

The size of the local heap space to commit.

public ulong SizeOfHeapReserve { get; }

The size of the local heap space to reserve. Only SizeOfHeapCommit is committed; the rest is made available one page at a time until the reserve size is reached.

public ulong SizeOfStackCommit { get; }

The size of the stack to commit.

public ulong SizeOfStackReserve { get; }

The size of the stack to reserve. Only SizeOfStackCommit is committed; the rest is made available one page at a time until the reserve size is reached.

public Subsystem Subsystem { get; }

The subsystem that is required to run this image.

public PEHeaderBuilder(Machine machine = 0, int sectionAlignment = 8192, int fileAlignment = 512, ulong imageBase = 4194304, byte majorLinkerVersion = 48, byte minorLinkerVersion = 0, ushort majorOperatingSystemVersion = 4, ushort minorOperatingSystemVersion = 0, ushort majorImageVersion = 0, ushort minorImageVersion = 0, ushort majorSubsystemVersion = 4, ushort minorSubsystemVersion = 0, Subsystem subsystem = 3, DllCharacteristics dllCharacteristics = 34112, Characteristics imageCharacteristics = 8192, ulong sizeOfStackReserve = 1048576, ulong sizeOfStackCommit = 4096, ulong sizeOfHeapReserve = 1048576, ulong sizeOfHeapCommit = 4096)

Initializes a new instance of the PEHeader class.

Creates an executable header.

Creates a library header.