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

System.Reflection.PortableExecutable.PEReader

public sealed class PEReader : IDisposable
Provides a reader for Portable Executable format (PE) files.
public bool HasMetadata { get; }

Gets a value that indicates if the PE image contains CLI metadata.

public bool IsEntireImageAvailable { get; }

Gets a value that indicates if the reader can access the entire PE image.

public bool IsLoadedImage { get; }

Gets a value that indicates if the PE image has been loaded into memory by the OS loader.

public PEHeaders PEHeaders { get; }

Gets the PE headers.

public PEReader(Byte* peImage, int size)

Creates a Portable Executable reader over a PE image stored in memory.

public PEReader(Byte* peImage, int size, bool isLoadedImage)

Creates a Portable Executable reader over a PE image stored in memory. A flag indicates whether the image has already been loaded into memory.

public PEReader(Stream peStream)

Creates a Portable Executable reader over a PE image stored in a stream.

public PEReader(Stream peStream, PEStreamOptions options)

Creates a Portable Executable reader over a PE image stored in a stream beginning at its current position and ending at the end of the stream.

public PEReader(Stream peStream, PEStreamOptions options, int size)

Creates a Portable Executable reader over a PE image of the given size beginning at the stream's current position.

public PEReader(ImmutableArray<byte> peImage)

Creates a Portable Executable reader over a PE image stored in a byte array.

public void Dispose()

Disposes all memory allocated by the reader.

Gets a PEMemoryBlock object containing the entire PE image.

Loads a PE section that contains CLI metadata.

public PEMemoryBlock GetSectionData(int relativeVirtualAddress)

Loads the PE section that contains the specified relative virtual address into memory and returns a memory block that starts at that address and ends at the end of the containing section.

public PEMemoryBlock GetSectionData(string sectionName)

Loads the PE section with the specified name into memory and returns a memory block that spans the section.

Reads the data pointed to by the specified Debug Directory entry and interprets it as CodeView.

Reads all Debug Directory table entries.

Reads the data pointed to by the specified Debug Directory entry and interprets it as an Embedded Portable PDB blob.

Reads the data pointed to by the specified Debug Directory entry and interprets it as a PDB Checksum entry.

public bool TryOpenAssociatedPortablePdb(string peImagePath, Func<string, Stream> pdbFileStreamProvider, out MetadataReaderProvider pdbReaderProvider, out string pdbPath)

Opens a Portable PDB associated with this PE image.