Class VTableTokenCollection
- Namespace
- AsmResolver.PE.DotNet.VTableFixups
- Assembly
- AsmResolver.PE.dll
Represents the segment of the metadata tokens of a VTable.
public class VTableTokenCollection : Collection<MetadataToken>, IList<MetadataToken>, ICollection<MetadataToken>, IReadOnlyList<MetadataToken>, IReadOnlyCollection<MetadataToken>, IEnumerable<MetadataToken>, IList, ICollection, IEnumerable, ISegment, IOffsetProvider, IWritable
- Inheritance
-
VTableTokenCollection
- Implements
- Inherited Members
Properties
CanUpdateOffsets
Determines whether this structure can be relocated to another offset or virtual address.
public bool CanUpdateOffsets { 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
Type
Gets or sets the type of the entries
public VTableType Type { get; set; }
Property Value
Methods
GetOffsetToIndex(int)
Gets the byte offset to an element within the collection that is relative to the start of the list.
public uint GetOffsetToIndex(int index)
Parameters
index
intThe index of the element to reference.
Returns
- uint
The offset.
GetPhysicalSize()
Computes the number of bytes that the structure contains.
public uint GetPhysicalSize()
Returns
- uint
The number of bytes.
GetReferenceToIndex(int)
Constructs a reference to an element within the collection.
public ISegmentReference GetReferenceToIndex(int index)
Parameters
index
intThe index of the element to reference.
Returns
- ISegmentReference
The reference.
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.
InsertItem(int, MetadataToken)
Inserts an element into the Collection<T> at the specified index.
protected override void InsertItem(int index, MetadataToken item)
Parameters
index
intThe zero-based index at which
item
should be inserted.item
MetadataTokenThe object to insert. The value can be null for reference types.
Exceptions
- ArgumentOutOfRangeException
index
is less than zero.-or-
index
is greater than Count.
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.