Table of Contents

Struct RelocationParameters

Namespace
AsmResolver
Assembly
AsmResolver.dll

Provides parameters for relocating a segment to a new offset-rva pair.

public struct RelocationParameters
Inherited Members

Constructors

RelocationParameters(ulong, uint)

Creates new relocation parameters.

public RelocationParameters(ulong offset, uint rva)

Parameters

offset ulong

The new offset of the segment.

rva uint

The new virtual address of the segment, relative to the image base.

RelocationParameters(ulong, ulong, uint, bool)

Creates new relocation parameters.

public RelocationParameters(ulong imageBase, ulong offset, uint rva, bool is32Bit)

Parameters

imageBase ulong

The base address of the image the segment is located in.

offset ulong

The new offset of the segment.

rva uint

The new virtual address of the segment, relative to the image base.

is32Bit bool

true if the image is targeting 32-bit images, false for 64-bit images.

Properties

ImageBase

Gets the image base that is assumed when relocating the segment.

public readonly ulong ImageBase { get; }

Property Value

ulong

Is32Bit

Gets a value indicating whether the image is targeting 32-bit machines.

public readonly bool Is32Bit { get; }

Property Value

bool

Is64Bit

Gets a value indicating whether the image is targeting 64-bit machines.

public bool Is64Bit { get; }

Property Value

bool

Offset

Gets the new physical offset of the segment.

public ulong Offset { readonly get; set; }

Property Value

ulong

Rva

Gets the new virtual address of the segment, relative to the image base.

public uint Rva { readonly get; set; }

Property Value

uint

Methods

Advance(uint)

Advances the current offset and virtual address by the provided byte count.

public void Advance(uint count)

Parameters

count uint

The number of bytes to advance with.

Advance(uint, uint)

Advances the current offset and virtual address by the provided byte count.

public void Advance(uint physicalCount, uint virtualCount)

Parameters

physicalCount uint

The number of bytes to advance the physical offset with.

virtualCount uint

The number of bytes to advance the virtual address with.

Align(uint)

Aligns the current offset and virtual address to the nearest multiple of the provided alignment.

public void Align(uint alignment)

Parameters

alignment uint

The alignment.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

WithAdvance(uint)

Advances the current offset and virtual address by the provided byte count.

public readonly RelocationParameters WithAdvance(uint count)

Parameters

count uint

The number of bytes to advance with.

Returns

RelocationParameters

The new relocation parameters.

WithOffsetRva(ulong, uint)

Copies the current relocation parameters, and assigns a new offset and relative virtual address.

public RelocationParameters WithOffsetRva(ulong offset, uint rva)

Parameters

offset ulong

The new offset.

rva uint

The new relative virtual address.

Returns

RelocationParameters