Table of Contents

Class RelocationBlock

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

Represents one block of relocations to be applied when the PE is loaded into memory.

public sealed class RelocationBlock : SegmentBase, ISegment, IOffsetProvider, IWritable
Inheritance
RelocationBlock
Implements
Inherited Members

Constructors

RelocationBlock(uint)

Creates a new base relocation block for the provided page.

public RelocationBlock(uint pageRva)

Parameters

pageRva uint

The virtual address of the page to apply base relocations on.

Properties

Entries

Gets the list of entries added to this page.

public IList<RelocationEntry> Entries { get; }

Property Value

IList<RelocationEntry>

PageRva

Gets or sets the base RVA for this page.

public uint PageRva { get; }

Property Value

uint

Methods

Add(RelocationEntry, bool)

Adds a relocation entry to the block.

public bool Add(RelocationEntry entry, bool allowDuplicates = false)

Parameters

entry RelocationEntry

The entry to add.

allowDuplicates bool

true if the entry should be ignored if it already exists, false otherwise.

Returns

bool

true if the entry was added, false otherwise.

GetPhysicalSize()

Computes the number of bytes that the structure contains.

public override uint GetPhysicalSize()

Returns

uint

The number of bytes.

Write(BinaryStreamWriter)

Serializes the structure to an output stream.

public override void Write(BinaryStreamWriter writer)

Parameters

writer BinaryStreamWriter

The output stream to write the data to.