Maple.Native 0.1.0

dotnet add package Maple.Native --version 0.1.0
                    
NuGet\Install-Package Maple.Native -Version 0.1.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="Maple.Native" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Maple.Native" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Maple.Native" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Maple.Native --version 0.1.0
                    
#r "nuget: Maple.Native, 0.1.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.
#:package Maple.Native@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Maple.Native&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Maple.Native&version=0.1.0
                    
Install as a Cake Tool

Maple.Native

.NET C# Build Status codecov Nuget License

MapleStory GMS v95 native type layouts and runtime mutation primitives: ZArray, ZXString, ZFatalSection, StringPool lock helpers, and x86 allocator contracts. Foundation layer for maple-memory and maple-client-v95. Cross-platform, trimmable and AOT/NativeAOT compatible.

⭐ Please star this project if you like it. ⭐

Example | Example Catalogue | Public API

Example

// Allocate a synthetic x86 address space for testing native types out-of-process.
using var allocator = new InProcessAllocator();

// Allocate a ZXString (ANSI ref-counted string) and read it back.
var strAddr = ZXString.Create(allocator, "MapleStory");
var alloc = ZXString.Allocate(allocator, "MapleStory");
ZXString.Destroy(allocator, strAddr);
ZXString.Destroy(allocator, alloc.ObjectAddress);

// Allocate a wide (UTF-16) string.
var wideAddr = ZXStringWide.Create(allocator, "메이플스토리");
ZXStringWide.Destroy(allocator, wideAddr);

// Spin-lock round-trip: acquire the StringPool lock, then release.
var pool = NativeStringPool.AllocateEmpty(allocator, slotCount: 4);
using (NativeStringPoolLock.Acquire(allocator, pool.ObjectAddress, maxSpinCount: 100))
{
    var locked = NativeStringPoolLock.Read(allocator, pool.ObjectAddress);
    _ = locked.TibPointer; // non-zero while held
}
NativeStringPool.Destroy(allocator, pool, destroyNarrowStrings: false, destroyWideStrings: false);

For more examples see Example Catalogue.

Benchmarks

Benchmarks.

Detailed Benchmarks

Comparison Benchmarks
TestBench Benchmark Results
Results will be populated here after running dotnet Build.cs comparison-bench then dotnet test

Example Catalogue

The following examples are available in ReadMeTest.cs.

Example - Empty

// Allocate a synthetic x86 address space for testing native types out-of-process.
using var allocator = new InProcessAllocator();

// Allocate a ZXString (ANSI ref-counted string) and read it back.
var strAddr = ZXString.Create(allocator, "MapleStory");
var alloc = ZXString.Allocate(allocator, "MapleStory");
ZXString.Destroy(allocator, strAddr);
ZXString.Destroy(allocator, alloc.ObjectAddress);

// Allocate a wide (UTF-16) string.
var wideAddr = ZXStringWide.Create(allocator, "메이플스토리");
ZXStringWide.Destroy(allocator, wideAddr);

// Spin-lock round-trip: acquire the StringPool lock, then release.
var pool = NativeStringPool.AllocateEmpty(allocator, slotCount: 4);
using (NativeStringPoolLock.Acquire(allocator, pool.ObjectAddress, maxSpinCount: 100))
{
    var locked = NativeStringPoolLock.Read(allocator, pool.ObjectAddress);
    _ = locked.TibPointer; // non-zero while held
}
NativeStringPool.Destroy(allocator, pool, destroyNarrowStrings: false, destroyWideStrings: false);

Public API Reference

See docs/PublicApi.md for the complete auto-generated public API reference.

Note: docs/PublicApi.md is auto-updated by the ReadMeTest_PublicApi test on every dotnet test run. Do not edit it manually.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Maple.Native:

Package Downloads
Maple.Memory

Allocator adapters and higher-level process-memory tooling for Maple client analysis and mutation.

Maple.StringPool

Zero-allocation decoder for the MapleStory GMS v95 StringPool singleton. Cross-platform, trimmable and AOT/NativeAOT compatible.

Maple.Client.V95.Analysis

Snapshot-backed x86 runtime function disassembly helpers for MapleStory GMS v95 client analysis. Windows-only, trimmable and AOT/NativeAOT compatible.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 223 3/26/2026