Libmem.NET
2.5.0
dotnet add package Libmem.NET --version 2.5.0
NuGet\Install-Package Libmem.NET -Version 2.5.0
<PackageReference Include="Libmem.NET" Version="2.5.0" />
<PackageVersion Include="Libmem.NET" Version="2.5.0" />
<PackageReference Include="Libmem.NET" />
paket add Libmem.NET --version 2.5.0
#r "nuget: Libmem.NET, 2.5.0"
#:package Libmem.NET@2.5.0
#addin nuget:?package=Libmem.NET&version=2.5.0
#tool nuget:?package=Libmem.NET&version=2.5.0
Libmem.NET
English | 简体中文
Libmem.NET is a Windows-focused C++/CLI wrapper for rdbo/libmem, providing managed APIs for process, thread, module, memory, scanning, symbols, assembly/disassembly, hooks, VMT, and DLL injection.
Current official support: Windows x64/x86 + .NET 8.
Installation
dotnet add package Libmem.NET --version 2.5.0
Libmem.NET 2.5.0 adds ScanManager.TryDataScan/TryPatternScan/TrySigScan and MemoryManager.TryRead/TryWrite for clear match/full-transfer results. Local Hook removal now preflights trampoline readability; regression coverage also exercises partial VMT reset and retry. Existing APIs and the pinned native libmem revision remain compatible. Supported targets: Windows x64/x86 with .NET 8; AnyCPU, ARM64 and cross-bitness are unsupported. Native Hook removal remains non-atomic. This README describes the 2.5.0 package when it is published; until then, the latest published stable release is 2.4.1. See 2.5.0 release notes.
Highlights
- Process and thread inspection
- Module enumeration and management
- Memory read/write/protect/allocate/free
- Deep pointer and signature/pattern scanning
- Symbol enumeration, lookup, and demangling
- Assembly/disassembly helpers
- Native hooks and VMT hooks
- DLL injection
- Explicit managed ownership with
IDisposable - Native failure mapping through
LibmemException
Quick start
using Libmem.NET;
using NativeApi = global::Libmem.NET.Libmem;
var process = NativeApi.CurrentProcess()
?? throw new InvalidOperationException("Current process not found.");
using var session = ProcessSession.Open(process)
?? throw new InvalidOperationException("Failed to open process session.");
Console.WriteLine(
$"{session.Name} PID={session.Pid} Arch={session.Architecture} Bits={session.Bits}");
foreach (var module in session.Modules.Enumerate())
{
Console.WriteLine(
$"{module.Name} Base=0x{module.Base:X} Size=0x{module.Size:X}");
}
Runtime requirements
The package is currently intended for:
- Windows x64 or Windows x86
- .NET 8
- C# / .NET consumers
The package carries architecture-matched C++/CLI and native runtime assets for both Windows x64 and x86.
Consumers must explicitly target x64 or x86. AnyCPU and cross-bitness operation are unsupported.
2.0 migration note
2.0.0 is the first stable release under the Libmem.NET identity. The breaking identity migration was introduced and validated in 2.0.0-preview.1.
Existing v1.0.0 consumers must update assembly references, namespaces, paths, and any reflection strings that use the old identity, then rebuild their applications. Renaming the old DLL is not sufficient.
See the full migration guide.
Documentation
- GitHub repository
- English README
- 简体中文 README
- API reference
- Consumption guide
- Release & versioning guide
- Changelog
License
Libmem.NET is licensed under GNU AGPL-3.0-only.
Third-party license information is available in THIRD_PARTY_NOTICES.md.
简体中文
English | 简体中文
Libmem.NET 是一个面向 Windows 的 rdbo/libmem C++/CLI 封装,为 C# / .NET 提供进程、线程、模块、内存、扫描、符号、汇编/反汇编、Hook、VMT 与 DLL 注入等托管 API。
当前正式支持范围:Windows x64/x86 + .NET 8。
安装
dotnet add package Libmem.NET --version 2.5.0
Libmem.NET 2.5.0 新增 ScanManager.TryDataScan/TryPatternScan/TrySigScan 和 MemoryManager.TryRead/TryWrite,使未命中、完整及部分传输结果更容易判断。本地 Hook 卸载增加 trampoline 可读性预检查,并新增 VMT 部分恢复及重试回归测试。保留旧 API 与固定 native libmem 版本,仅支持 Windows x64/x86 与 .NET 8;不支持 AnyCPU、ARM64 和跨位数,Hook 卸载并非原子操作。本 README 描述的是正式发布后的 2.5.0 包;发布前现行稳定版本仍是 2.4.1。详见 2.5.0 发布说明。
主要功能
- 进程与线程查询
- 模块枚举与管理
- 内存读写、保护、分配与释放
- Deep Pointer、特征码与模式扫描
- 符号枚举、查找与 demangle
- 汇编与反汇编辅助
- Native Hook 与 VMT Hook
- DLL 注入
- 基于
IDisposable的明确资源生命周期 - 通过
LibmemException映射明确的原生失败
快速开始
using Libmem.NET;
using NativeApi = global::Libmem.NET.Libmem;
var process = NativeApi.CurrentProcess()
?? throw new InvalidOperationException("Current process not found.");
using var session = ProcessSession.Open(process)
?? throw new InvalidOperationException("Failed to open process session.");
Console.WriteLine(
$"{session.Name} PID={session.Pid} Arch={session.Architecture} Bits={session.Bits}");
foreach (var module in session.Modules.Enumerate())
{
Console.WriteLine(
$"{module.Name} Base=0x{module.Base:X} Size=0x{module.Size:X}");
}
运行环境
当前 NuGet 包正式面向:
- Windows x64 或 Windows x86
- .NET 8
- C# / .NET 消费者
包内同时包含 Windows x64 与 x86 的架构匹配 C++/CLI 程序集和原生运行时文件。
消费者必须显式选择 x64 或 x86;AnyCPU 与跨位数运行不属于支持范围。
2.0 迁移说明
2.0.0 是 Libmem.NET 新身份下的首个稳定版本;这次破坏兼容性的身份迁移已在 2.0.0-preview.1 中引入并完成验证。
现有 v1.0.0 使用者需要更新程序集引用、命名空间、路径以及使用旧身份的反射字符串,并重新编译应用。仅重命名旧 DLL 无法完成迁移。
完整说明见 迁移指南。
文档
许可证
Libmem.NET 使用 GNU AGPL-3.0-only 许可证。
第三方组件与许可信息见 THIRD_PARTY_NOTICES.md。
| 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has 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.
English: Libmem.NET 2.5.0 adds ScanManager.TryDataScan/TryPatternScan/TrySigScan and MemoryManager.TryRead/TryWrite, retaining native miss or partial-transfer information while preserving existing APIs. Harden local HookHandle.Remove with a trampoline-readability preflight and test partial VMT reset and retry. Native libmem remains pinned; Windows x64/x86 and .NET 8 only. Hook removal is not atomic; AnyCPU, ARM64 and cross-bitness remain unsupported. 中文:Libmem.NET 2.5.0 新增 ScanManager 的三个 Try 扫描接口和 MemoryManager.TryRead/TryWrite,保留原有 API 语义并明确未命中及部分传输结果。加强本进程 HookHandle.Remove 对 trampoline 可读性的检查,覆盖 VMT 部分恢复及重试;固定 native libmem,仍仅支持 Windows x64/x86 与 .NET 8。Hook 卸载非原子操作,不支持 AnyCPU、ARM64 或跨位数。Full notes / 完整说明: https://github.com/CardResearchLab/Libmem.NET/blob/main/docs/releases/v2.5.0.md