Class PESegmentReference
- Namespace
- AsmResolver.PE.File
- Assembly
- AsmResolver.PE.File.dll
Represents a reference to a segment of a PE file.
public sealed class PESegmentReference : ISegmentReference, IOffsetProvider
- Inheritance
-
PESegmentReference
- Implements
- Inherited Members
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
IsValidAddress
Gets a value indicating whether the reference points to a valid section within the PE file.
public bool IsValidAddress { get; }
Property Value
Offset
Gets the physical starting offset of the segment.
public ulong Offset { get; }
Property Value
PointsToPhysicalData
Gets a value indicating whether the reference points to a valid physical section within the PE file.
public bool PointsToPhysicalData { 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
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.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.