Table of Contents

Class SegmentReference

Namespace
AsmResolver
Assembly
AsmResolver.dll

Provides a base implementation for a reference to a segment in a binary file.

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

Constructors

SegmentReference(ISegment?)

Creates a new reference to the provided segment.

public SegmentReference(ISegment? segment)

Parameters

segment ISegment

The segment to reference.

Properties

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

Null

Represents the null reference.

public static ISegmentReference Null { get; }

Property Value

ISegmentReference

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

Segment

Gets the referenced segment.

public ISegment? Segment { get; }

Property Value

ISegment

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.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.