Class NativeArray<T>
- Namespace
- AsmResolver.PE.DotNet.ReadyToRun
- Assembly
- AsmResolver.PE.dll
Represents a sparse list of elements stored in the native file format as specified by the ReadyToRun file format.
public class NativeArray<T> : Collection<T?>, IList<T?>, ICollection<T?>, IReadOnlyList<T?>, IReadOnlyCollection<T?>, IEnumerable<T?>, IList, ICollection, IEnumerable, ISegment, IOffsetProvider, IWritable where T : IWritable
Type Parameters
T
The type of elements to store in the array.
- Inheritance
-
Collection<T>NativeArray<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- 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
Methods
FromReader(BinaryStreamReader, Func<BinaryStreamReader, T>)
Reads a sparse array in the native file format from the provided input stream.
public static NativeArray<T> FromReader(BinaryStreamReader reader, Func<BinaryStreamReader, T> readElement)
Parameters
reader
BinaryStreamReaderThe input stream.
readElement
Func<BinaryStreamReader, T>The function to use for reading individual elements.
Returns
- NativeArray<T>
The read array.
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.