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

System.Reflection.PortableExecutable.PEHeaders

public sealed class PEHeaders
Defines a type that reads PE (Portable Executable) and COFF (Common Object File Format) headers from a stream.
public CoffHeader CoffHeader { get; }

Gets the COFF header of the image.

public int CoffHeaderStartOffset { get; }

Gets the byte offset from the start of the PE image to the start of the COFF header.

public CorHeader CorHeader { get; }

Gets the COR header.

public int CorHeaderStartOffset { get; }

Gets the byte offset from the start of the image to the COR header.

public bool IsCoffOnly { get; }

Gets a value that indicates whether the image is Coff only.

public bool IsConsoleApplication { get; }

Gets a value that indicates whether the image represents a Windows console application.

public bool IsDll { get; }

Gets a value that indicates whether the image represents a dynamic link library.

public bool IsExe { get; }

Gets a value that indicates whether the image represents an executable.

public int MetadataSize { get; }

Gets the size of the CLI metadata.

public int MetadataStartOffset { get; }

Gets the offset (in bytes) from the start of the PE image to the start of the CLI metadata.

public PEHeader PEHeader { get; }

Gets the image's PE header.

public int PEHeaderStartOffset { get; }

Gets the byte offset of the header from the start of the image.

Gets the PE section headers.

public PEHeaders(Stream peStream)

Instantiates a new instance of the PEHeaders class that reads the PE headers from the current location in the specified stream.

public PEHeaders(Stream peStream, int size)

Instantiates a new instance of the PEHeaders class that reads the PE headers from a stream that represents a PE image of a specified size.

public PEHeaders(Stream peStream, int size, bool isLoadedImage)

Instantiates a new instance of the PEHeaders class that reads the PE headers from a stream that represents a PE image of a specified size and indicates whether the PE image has been loaded into memory.

public int GetContainingSectionIndex(int relativeVirtualAddress)

Searches sections of the PE image for the section that contains the specified Relative Virtual Address.

public bool TryGetDirectoryOffset(DirectoryEntry directory, out int offset)

Gets the offset (in bytes) from the start of the image to the given directory data.