XFEExtension.NetCore.MemoryEditor 2.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package XFEExtension.NetCore.MemoryEditor --version 2.0.1
NuGet\Install-Package XFEExtension.NetCore.MemoryEditor -Version 2.0.1
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="XFEExtension.NetCore.MemoryEditor" Version="2.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XFEExtension.NetCore.MemoryEditor --version 2.0.1
#r "nuget: XFEExtension.NetCore.MemoryEditor, 2.0.1"
#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 XFEExtension.NetCore.MemoryEditor as a Cake Addin
#addin nuget:?package=XFEExtension.NetCore.MemoryEditor&version=2.0.1

// Install XFEExtension.NetCore.MemoryEditor as a Cake Tool
#tool nuget:?package=XFEExtension.NetCore.MemoryEditor&version=2.0.1

XFEExtension.NetCore.MemoryEditor

内存管理器

创建内存管理器(推荐使用可更新内存管理器)

public static class Program
{
    public static UpdatableMemoryManager Manager { get; } = MemoryManager.CreateBuilder() //创建内存管理器的构建器
            .WithAutoReacquireProcess("ExampleGame") //当目标进程退出后,自动重新获取目标名称的进程
            .WithFindProcessWhenCreate() //创建管理器时,开始寻找目标名称的进程(如果前面设置了目标进程名称此处可以不用设置)
            .BuildUpdatableManager(
            MemoryItemBuilder.Create<int>("Level") //为每个地址添加一个名称
                             .WithResolvePointer("xxx-xxx-xx.dll", 0x0072A200, 0x14A0, 0x0, 0x80, 0xE4, 0x0, 0x1EC) //内存地址的模块名称、基址和偏移部分
                             .WithListener(), //添加监听器
            MemoryItemBuilder.Create<float>("HealthPoint")
                             .WithResolvePointer("xxx-xxx-xx.dll", 0x0072A200, 0x12E8, 0x0, 0x80, 0xE4, 0x0, 0x1E0)
                             .WithListener(),
            MemoryItemBuilder.Create<float>("Stamina")
                             .WithResolvePointer("xxx-xxx-xx.dll", 0x0072A200, 0x14E0, 0x48, 0x10, 0x20, 0x50, 0x20, 0x1B0)
                             .WithListener());
    //推荐使用可更新内存管理器
}

使用内存管理器

public partial class MainForm : Form
{
    public MainForm()
    {
        InitializeComponent();
        Program.Manager.ValueChanged += Manager_ValueChanged;//订阅内存值改变事件
    }

    private void Manager_ValueChanged(XFEExtension.NetCore.MemoryEditor.Manager.MemoryItem sender, MemoryValue e)
    {
        Trace.WriteLine($"名称:{e.CustomName} 地址:{sender:X}\t是否读取到值  上次:{e.PreviousValueGetSuccessful}  这次:{e.CurrentValueGetSuccessful}  值从:{e.PreviousValue}  变更为:{e.CurrentValue}");
        switch (e.CustomName)
        {
            case "Level":
                if (e.CurrentValueGetSuccessful)
                {
                    if (!sender.Write(待写入值))
                        Trace.WriteLine($"Level:写入失败");
                }
                break;
            case "HealthPoint":
                if (e.CurrentValueGetSuccessful)
                {
                    if (!sender.Write(待写入值))
                        Trace.WriteLine("HealthPoint:写入失败");
                }
                break;
            case "Stamina":
                if (e.CurrentValueGetSuccessful)
                {
                    if (!sender.Write(待写入值))
                        Trace.WriteLine("Stamina:写入失败");
                }
                break;
            default:
                break;
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.

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
2.0.4 91 5/6/2024
2.0.3 84 5/4/2024
2.0.2 86 4/29/2024
2.0.1 78 4/29/2024
2.0.0 79 4/29/2024
1.4.0 97 4/13/2024
1.3.2 74 4/12/2024
1.3.1 63 4/11/2024
1.3.0 71 4/11/2024
1.2.0 84 4/11/2024
1.1.0 74 4/11/2024
1.0.1 72 4/11/2024
1.0.0 72 4/11/2024

fix-修复了基址解析表达式可能会出现的报错