XFEExtension.NetCore.MemoryEditor
2.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package XFEExtension.NetCore.MemoryEditor --version 2.0.0
NuGet\Install-Package XFEExtension.NetCore.MemoryEditor -Version 2.0.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="XFEExtension.NetCore.MemoryEditor" Version="2.0.0" />
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.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: XFEExtension.NetCore.MemoryEditor, 2.0.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 XFEExtension.NetCore.MemoryEditor as a Cake Addin #addin nuget:?package=XFEExtension.NetCore.MemoryEditor&version=2.0.0 // Install XFEExtension.NetCore.MemoryEditor as a Cake Tool #tool nuget:?package=XFEExtension.NetCore.MemoryEditor&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | Versions 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.
-
net8.0
- XFEExtension.NetCore (>= 2.7.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
新增内存管理器
整体框架大幅更改