Table of Contents

Class GenericMockMemory<T>

Namespace
Echo.Memory
Assembly
Echo.dll

Provides a semi high-level mapping between addresses and objects that live outside of the sandbox.

public class GenericMockMemory<T> : UninitializedMemorySpace, IMemorySpace where T : notnull

Type Parameters

T

The type of objects to store.

Inheritance
GenericMockMemory<T>
Implements
Inherited Members

Remarks

Reading from this memory chunk always results in reading unknown memory.

Constructors

GenericMockMemory(int, int, IEqualityComparer<T>)

Creates a new generic mock memory chunk.

public GenericMockMemory(int size, int itemSize, IEqualityComparer<T> comparer)

Parameters

size int

The size in bytes of the memory.

itemSize int

The size in bytes of a single element.

comparer IEqualityComparer<T>

The equality comparer to use for comparing elements for uniqueness.

Methods

GetAddress(T)

Gets the address or assigns a new address to the provided object.

public long GetAddress(T item)

Parameters

item T

The object.

Returns

long

The address.

GetObject(long)

Gets the object at the provided address.

public T GetObject(long address)

Parameters

address long

The address.

Returns

T

The object.

TryGetObject(long, out T?)

Attempts to get the object at the provided address.

public bool TryGetObject(long address, out T? value)

Parameters

address long

The address.

value T

The object.

Returns

bool

true if the address maps to an object, false otherwise.