Table of Contents

Class ObjectMarshaller

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

Provides an implementation of the IObjectMarshaller, that embeds managed objects into the ObjectMapMemory of the virtual machine.

public class ObjectMarshaller : IObjectMarshaller
Inheritance
ObjectMarshaller
Implements
Inherited Members
Extension Methods

Constructors

ObjectMarshaller(CilVirtualMachine)

Creates a new marshaller for the provided virtual machine.

public ObjectMarshaller(CilVirtualMachine machine)

Parameters

machine CilVirtualMachine

The machine.

Properties

Machine

Gets the machine the marshaller is targeting.

public CilVirtualMachine Machine { get; }

Property Value

CilVirtualMachine

Methods

DeserializeObject(long, Type)

Deserialize the provided object address to an object of the provided type.

protected virtual object DeserializeObject(long pointer, Type targetType)

Parameters

pointer long

The pointer to the beginning of the object.

targetType Type

The type of object to deserialize.

Returns

object

The deserialized object.

DeserializeStructure(BitVectorSpan, Type)

Deserialize the provided bit vector to a structure of the provided type.

protected virtual object DeserializeStructure(BitVectorSpan data, Type targetType)

Parameters

data BitVectorSpan

The raw data of the structure

targetType Type

The type of object to deserialize.

Returns

object

The deserialized object.

ToBitVector(object?)

Constructs a bit vector that represents the provided object.

public virtual BitVector ToBitVector(object? obj)

Parameters

obj object

The object.

Returns

BitVector

The bitvector containing the address to the object.

ToObject(BitVectorSpan, Type)

Interprets the provided bit vector as an object of the provided type.

public virtual object? ToObject(BitVectorSpan vector, Type targetType)

Parameters

vector BitVectorSpan

The vector.

targetType Type

The type to marshal to.

Returns

object

The marshalled object.