Table of Contents

Class MappedObject

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

Embeds a managed object into the memory of a virtual machine, providing HLE access to the object.

public class MappedObject : IMemorySpace
Inheritance
MappedObject
Implements
Inherited Members

Constructors

MappedObject(object, TypeMemoryLayout, CilVirtualMachine)

Creates a new managed object embedding.

public MappedObject(object o, TypeMemoryLayout virtualLayout, CilVirtualMachine machine)

Parameters

o object

The object to embed.

virtualLayout TypeMemoryLayout

The memory layout of the object.

machine CilVirtualMachine

The machine the object is valid in.

Properties

AddressRange

Gets the virtual memory layout of the object's contents.

public AddressRange AddressRange { get; }

Property Value

AddressRange

Object

Gets the embedded object.

public object Object { get; }

Property Value

object

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.