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
oobjectThe object to embed.
virtualLayoutTypeMemoryLayoutThe memory layout of the object.
machineCilVirtualMachineThe machine the object is valid in.
Properties
AddressRange
Gets the virtual memory layout of the object's contents.
public AddressRange AddressRange { get; }
Property Value
Object
Gets the embedded object.
public object Object { get; }
Property Value
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
addresslongThe address to query.
Returns
- bool
trueif the address was valid,falseotherwise.
Read(long, BitVectorSpan)
Copies data at the provided address into the provided buffer.
public void Read(long address, BitVectorSpan buffer)
Parameters
addresslongThe address to start reading at.
bufferBitVectorSpanThe buffer to write into.
Rebase(long)
Relocates the memory to a new base address.
public void Rebase(long baseAddress)
Parameters
baseAddresslongThe new base address.
Write(long, BitVectorSpan)
Writes the provided buffer of data at the provided address.
public void Write(long address, BitVectorSpan buffer)
Parameters
addresslongThe address to start writing at.
bufferBitVectorSpanThe 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
addresslongThe address to start writing at.
bufferReadOnlySpan<byte>The data to write.