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
ISegmentThe 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
IsBounded
Gets a value indicating whether the referenced segment is bounded to a fixed size.
public bool IsBounded { get; }
Property Value
Null
Represents the null reference.
public static ISegmentReference Null { get; }
Property Value
Offset
Gets the physical starting offset of the segment.
public ulong Offset { get; }
Property Value
Rva
Gets the virtual address relative to the beginning of the section that the segment is located in.
public uint Rva { get; }
Property Value
Segment
Gets the referenced segment.
public ISegment? Segment { get; }
Property Value
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.