Table of Contents

Class StaticFieldStorage

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

Represents a chunk of memory designated for storing static fields in a .NET process.

public class StaticFieldStorage : IMemorySpace
Inheritance
StaticFieldStorage
Implements
Inherited Members

Constructors

StaticFieldStorage(ValueFactory, IHeap)

Creates a new empty static field storage.

public StaticFieldStorage(ValueFactory valueFactory, IHeap heap)

Parameters

valueFactory ValueFactory

The value factory responsible for measuring and constructing new values.

heap IHeap

The virtual heap to use for storing the field values.

StaticFieldStorage(ValueFactory, int)

Creates a new empty static field storage.

public StaticFieldStorage(ValueFactory valueFactory, int size)

Parameters

valueFactory ValueFactory

The value factory responsible for measuring and constructing new values.

size int

The maximum size of the storage.

Properties

AddressRange

Gets the range that this memory space spans.

public AddressRange AddressRange { get; }

Property Value

AddressRange

Methods

GetFieldAddress(IFieldDescriptor)

Gets the address of the provided field.

public long GetFieldAddress(IFieldDescriptor field)

Parameters

field IFieldDescriptor

The field.

Returns

long

The address.

GetFieldSpan(IFieldDescriptor)

Obtains a writable bitvector slice that spans the value of the provided field.

public BitVectorSpan GetFieldSpan(IFieldDescriptor field)

Parameters

field IFieldDescriptor

The field.

Returns

BitVectorSpan

The slice.

GetOrInitializeFieldAddress(IFieldDescriptor, bool)

Gets the address of the provided field. If the field was accessed for the first time, the field's contents will be either cleared or left unknown.

public long GetOrInitializeFieldAddress(IFieldDescriptor field, bool initializeWithZeroes)

Parameters

field IFieldDescriptor

The field.

initializeWithZeroes bool

true if the field's contents should be initialized with zeroes on first access.

Returns

long

The address.

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.