Class SegmentBuilder
- Namespace
- AsmResolver
- Assembly
- AsmResolver.dll
Represents a collection of segments concatenated (and aligned) after each other.
public class SegmentBuilder : ISegment, IOffsetProvider, IWritable, IEnumerable<ISegment>, IEnumerable
- Inheritance
-
SegmentBuilder
- Implements
- Inherited Members
- Extension Methods
Properties
CanUpdateOffsets
Determines whether this structure can be relocated to another offset or virtual address.
public bool CanUpdateOffsets { get; }
Property Value
Count
Gets the number of sub segments that are stored into the segment.
public int Count { get; }
Property Value
IsEmpty
Gets a value indicating whether the collection of concatenated segments is empty.
public bool IsEmpty { 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
Methods
Add(ISegment)
Adds the provided segment with no alignment.
public void Add(ISegment segment)
Parameters
segment
ISegmentThe segment to add.
Add(ISegment, uint)
Adds the provided segment to the offset that is the next multiple of the provided alignment.
public void Add(ISegment segment, uint alignment)
Parameters
GetEnumerator()
Returns an object that enumerates all segments in the segment builder.
public IEnumerator<ISegment> GetEnumerator()
Returns
- IEnumerator<ISegment>
The enumerator.
GetPhysicalSize()
Computes the number of bytes that the structure contains.
public uint GetPhysicalSize()
Returns
- uint
The number of bytes.
GetVirtualSize()
Computes the number of bytes the segment will contain when it is mapped into memory.
public uint GetVirtualSize()
Returns
- uint
The number of bytes.
UpdateOffsets(in RelocationParameters)
Assigns a new file and virtual offset to the segment and all its sub-components.
public void UpdateOffsets(in RelocationParameters parameters)
Parameters
parameters
RelocationParametersThe parameters containing the new offset information for the segment.
Write(BinaryStreamWriter)
Serializes the structure to an output stream.
public void Write(BinaryStreamWriter writer)
Parameters
writer
BinaryStreamWriterThe output stream to write the data to.