Table of Contents

Class RelativeReference

Namespace
AsmResolver
Assembly
AsmResolver.dll

Represents a pointer or reference that is relative to the beginning of another segment or structure.

public sealed class RelativeReference : ISegmentReference, IOffsetProvider
Inheritance
RelativeReference
Implements
Inherited Members

Constructors

RelativeReference(IOffsetProvider, int)

Creates a new relative reference.

public RelativeReference(IOffsetProvider @base, int additive)

Parameters

base IOffsetProvider

The segment the reference is relative to.

additive int

The number of bytes to skip after the beginning of the segment.

Properties

Additive

Gets the number of bytes to skip after the beginning of the segment indicated by Base.

public int Additive { get; }

Property Value

int

Base

Gets the segment or structure that this reference is relative to.

public IOffsetProvider Base { get; }

Property Value

IOffsetProvider

CanRead

Gets a value indicating whether the referenced segment can be read using a binary reader.

public bool CanRead { get; }

Property Value

bool

IsBounded

Gets a value indicating whether the referenced segment is bounded to a fixed size.

public bool IsBounded { get; }

Property Value

bool

Offset

Gets the physical starting offset of the segment.

public ulong Offset { get; }

Property Value

ulong

Rva

Gets the virtual address relative to the beginning of the section that the segment is located in.

public uint Rva { get; }

Property Value

uint

Methods

CreateReader()

Creates a binary reader starting at the beginning of the segment.

public BinaryStreamReader CreateReader()

Returns

BinaryStreamReader

The binary reader.

Remarks

When CanRead is false, it is not guaranteed this method will succeed.

GetSegment()

Obtains the segment referenced by this reference.

public ISegment? GetSegment()

Returns

ISegment

The segment.

Remarks

When IsBounded is false, it is not guaranteed this method will succeed.

Exceptions

InvalidOperationException

Occurs when the segment could not be obtained.