TheLeftExit.Memory 3.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package TheLeftExit.Memory --version 3.4.0
NuGet\Install-Package TheLeftExit.Memory -Version 3.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TheLeftExit.Memory" Version="3.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TheLeftExit.Memory --version 3.4.0
#r "nuget: TheLeftExit.Memory, 3.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TheLeftExit.Memory as a Cake Addin
#addin nuget:?package=TheLeftExit.Memory&version=3.4.0

// Install TheLeftExit.Memory as a Cake Tool
#tool nuget:?package=TheLeftExit.Memory&version=3.4.0

TheLeftExit.Memory

One of the many libraries focused on reading process memory.

TheLeftExit.Memory is designed to be compact, fast and extremely memory-efficient, making extensive use of unsafe context.

Available as a NuGet package.

Main features

MemorySource
  • TheLeftExit.Memory.Sources.ReadOnlyMemorySource
  • TheLeftExit.Memory.Sources.MemorySource
  • TheLeftExit.Memory.Sources.LocalMemorySource

These abstract classes allow wrapping remote memory sources for generic reading and writing:

bool ReadOnlyMemorySource.TryRead<T>(ulong address, out T result) where T : unmanaged;
bool ReadOnlyMemorySource.TryRead<T>(ulong address, Span<T> buffer) where T : unmanagedl;

bool MemorySource.TryWrite<T>(ulong address, T value) where T : unmanaged;
bool ReadOnlyMemorySource.TryWrite<T>(ulong address, Span<T> buffer) where T : unmanagedl;

ref T LocalMemorySource.ReadRef<T>(ulong address) where T : unmanaged;
ProcessMemory
  • TheLeftExit.Memory.Sources.ProcessMemory

A MemorySource over a process that allows you to read or write data as primitive types, structures, or even tuples:
(float X, float Y) Position = source.ReadValue<(float, float)>(address);

CachedMemory
  • TheLeftExit.Memory.Sources.CachedMemory

A LocalMemorySource over Memory<byte> that allows you to store and access memory regions for complex operations, as well as cache process memory for use with existing MemorySource logic.

RTTIMethods
string RTTIMethods.GetRTTIClassNames64(this ReadOnlyMemorySource source, ulong address);
string RTTIMethods.GetRTTIClassNames32(this ReadOnlyMemorySource source, ulong address);

Allows you to query a structure for its RTTI-sourced class name.
The names you can find this way are the same names that tools like Cheat Engine, IDA or ReClass.NET will show you for the address or the pointer to it.

To learn more about this technology, visit http://www.openrce.org/articles/full_view/23

PointerQuery

  • TheLeftExit.Memory.Queries.PointerQuery

A simple iterator over a ReadOnlyMemorySource memory region. Allows you to scan remote memory for addresses matching a specific condition.

public partial class PointerQuery {
    public PointerQueryOptions Settings { get; set; }
    public object Tag { get; set; }
    public uint? Offset { get; set; }
    public EventHandler<ProcessStepEventArgs> ProcessStep { get; set; }

    public ulong? Run(ReadOnlyMemorySource source, ulong baseAddress);

    public static void AOB(object sender, ProcessStepEventArgs e);
    public static void RTTIByRef(object sender, ProcessStepEventArgs e);
    public static void RTTIByVal(object sender, ProcessStepEventArgs e);
}

public class ProcessStepEventArgs : EventArgs {
    public ReadOnlyMemorySource Source { get; }
    public ulong Address { get; }
    public ProcessStepResult? Result { get; set; }
}

There is more stuff, but it's mostly specific to my needs and/or too bothersome to document.

I often update this project as a I come up with more efficient ways to achieve its functionality, so expect breaking changes with most new versions.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.0.0 449 1/21/2022
3.5.0 396 10/25/2021
3.4.0 267 10/23/2021
3.3.2 348 10/17/2021
3.3.1 317 10/16/2021
3.3.0 292 10/14/2021
3.2.0 348 10/10/2021
3.1.0 473 10/7/2021
3.0.1 315 9/25/2021
3.0.0 316 9/25/2021
2.0.0 445 7/27/2021
1.0.0 461 6/13/2021