Table of Contents

Struct RelocationEntry

Namespace
AsmResolver.PE.Relocations.Builder
Assembly
AsmResolver.PE.dll

Represents one entry in a base relocation block, containing the offset within the page, as well as the type of relocation to apply after the PE image was loaded by the OS.

public readonly struct RelocationEntry : IWritable
Implements
Inherited Members

Constructors

RelocationEntry(RelocationType, int)

Creates a new relocation entry.

public RelocationEntry(RelocationType type, int offset)

Parameters

type RelocationType

The type of relocation to apply.

offset int

The offset within the page to apply the relocation on.

Exceptions

ArgumentOutOfRangeException

Occurs when the offset does not indicate a valid offset within the page.

RelocationEntry(ushort)

Creates a new relocation entry.

public RelocationEntry(ushort value)

Parameters

value ushort

The raw value of the entry.

Properties

IsEmpty

Gets a value indicating the entry is a zero entry.

public bool IsEmpty { get; }

Property Value

bool

Offset

Gets the offset (relative to the current relocation block) to the pointer to relocate.

public int Offset { get; }

Property Value

int

RelocationType

Gets the type of the relocation to apply.

public RelocationType RelocationType { get; }

Property Value

RelocationType

Methods

GetPhysicalSize()

Computes the number of bytes that the structure contains.

public uint GetPhysicalSize()

Returns

uint

The number of bytes.

Write(BinaryStreamWriter)

Serializes the structure to an output stream.

public void Write(BinaryStreamWriter writer)

Parameters

writer BinaryStreamWriter

The output stream to write the data to.