Table of Contents

Class ClrMockMemory

Namespace
Echo.Platforms.AsmResolver.Emulation.Runtime
Assembly
Echo.Platforms.AsmResolver.dll

Provides a block of memory that contains mock data modelling CLR specific data structures.

public class ClrMockMemory : IMemorySpace
Inheritance
ClrMockMemory
Implements
Inherited Members

Constructors

ClrMockMemory()

Creates a new instance of the ClrMockMemory block.

public ClrMockMemory()

Properties

AddressRange

Gets the range that this memory space spans.

public AddressRange AddressRange { get; }

Property Value

AddressRange

Fields

Gets the memory assigned for field descriptor structures.

public GenericMockMemory<IFieldDescriptor> Fields { get; }

Property Value

GenericMockMemory<IFieldDescriptor>

MethodEntryPoints

Gets the memory assigned for method entry points

public GenericMockMemory<IMethodDescriptor> MethodEntryPoints { get; }

Property Value

GenericMockMemory<IMethodDescriptor>

MethodTables

Gets the memory assigned for method table structures (types).

public GenericMockMemory<ITypeDescriptor> MethodTables { get; }

Property Value

GenericMockMemory<ITypeDescriptor>

Methods

Gets the memory assigned for method descriptor structures.

public GenericMockMemory<IMethodDescriptor> Methods { get; }

Property Value

GenericMockMemory<IMethodDescriptor>

Methods

IsValidAddress(long)

Gets a value indicating whether the provided address is a valid address, and can be used to read and/or write to.

public bool IsValidAddress(long address)

Parameters

address long

The address to query.

Returns

bool

true if the address was valid, false otherwise.

Read(long, BitVectorSpan)

Copies data at the provided address into the provided buffer.

public void Read(long address, BitVectorSpan buffer)

Parameters

address long

The address to start reading at.

buffer BitVectorSpan

The buffer to write into.

Rebase(long)

Relocates the memory to a new base address.

public void Rebase(long baseAddress)

Parameters

baseAddress long

The new base address.

Write(long, BitVectorSpan)

Writes the provided buffer of data at the provided address.

public void Write(long address, BitVectorSpan buffer)

Parameters

address long

The address to start writing at.

buffer BitVectorSpan

The data to write.

Write(long, ReadOnlySpan<byte>)

Writes the provided buffer of data at the provided address.

public void Write(long address, ReadOnlySpan<byte> buffer)

Parameters

address long

The address to start writing at.

buffer ReadOnlySpan<byte>

The data to write.