PEReader.GetSectionData Method

Definition

Overloads

GetSectionData(String)

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

GetSectionData(Int32)

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.

GetSectionData(String)

Source:
PEReader.cs
Source:
PEReader.cs
Source:
PEReader.cs
Source:
PEReader.cs

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

C#
public System.Reflection.PortableExecutable.PEMemoryBlock GetSectionData(string sectionName);

Parameters

sectionName
String

The name of the section.

Returns

A memory block that spans the section, or an empty block if no section of the given sectionName exists in this PE image.

Exceptions

sectionName is null.

The PE image is not available.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

GetSectionData(Int32)

Source:
PEReader.cs
Source:
PEReader.cs
Source:
PEReader.cs
Source:
PEReader.cs

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.

C#
public System.Reflection.PortableExecutable.PEMemoryBlock GetSectionData(int relativeVirtualAddress);

Parameters

relativeVirtualAddress
Int32

The Relative Virtual Address of the data to read.

Returns

A memory block that starts at relativeVirtualAddress and ends at the end of the containing section, or an empty block if relativeVirtualAddress doesn't represent a location in any of the PE sections of this PE image.

Exceptions

The PE headers contain invalid data.

An IO error occurred while reading from the underlying stream.

The PE image is not available.

relativeVirtualAddress is negative.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0