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

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.
namespace System.Reflection.PortableExecutable { public sealed class PEHeaders { public int MetadataStartOffset { get; } public int MetadataSize { get; } public CoffHeader CoffHeader { get; } public int CoffHeaderStartOffset { get; } public bool IsCoffOnly { get; } public PEHeader PEHeader { get; } public int PEHeaderStartOffset { get; } public ImmutableArray<SectionHeader> SectionHeaders { get; } public CorHeader CorHeader { get; } public int CorHeaderStartOffset { get; } public bool IsConsoleApplication { get; } public bool IsDll { get; } public bool IsExe { get; } public PEHeaders(Stream peStream); public PEHeaders(Stream peStream, int size); public PEHeaders(Stream peStream, int size, bool isLoadedImage); public bool TryGetDirectoryOffset(DirectoryEntry directory, out int offset); public int GetContainingSectionIndex(int relativeVirtualAddress); } }