Table of Contents

Class BasicMemorySpace

Namespace
Echo.Memory
Assembly
Echo.dll

Provides a basic implementation of a IMemorySpace, where memory is one continuous block of data that is fully accessible.

public class BasicMemorySpace : IMemorySpace
Inheritance
BasicMemorySpace
Implements
Inherited Members

Constructors

BasicMemorySpace(BitVector)

Wraps a bit vector into a memory space.

public BasicMemorySpace(BitVector backBuffer)

Parameters

backBuffer BitVector

The data of the memory space.

BasicMemorySpace(byte[])

Wraps a byte array into a memory space.

public BasicMemorySpace(byte[] backBuffer)

Parameters

backBuffer byte[]

The data of the memory space.

BasicMemorySpace(int, bool)

Creates a new memory space.

public BasicMemorySpace(int size, bool initialize)

Parameters

size int

The number of bytes to store in the space.

initialize bool

Indicates whether the space should be initialized with zeroes.

Properties

AddressRange

Gets the range that this memory space spans.

public AddressRange AddressRange { get; }

Property Value

AddressRange

BackBuffer

Gets the back buffer behind the memory space that stores the raw data.

public BitVector BackBuffer { get; }

Property Value

BitVector

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.