Custom IProcess
How to connect your own driver or memory reading method to the Memory API
How to create a custom IProcess
If you already have your own driver, bridge, or another way to read memory, you almost never need to build “yet another Memory API”. In most cases, two layers are enough:
IMemoryBackendfor rawread/writeIProcess, which describes the process and exposesMemory
Once you have that, your backend immediately gets access to typed reads, MemoryOfModule(...), imports, exports, signatures, and code cave.
What to use as a reference in the codebase
NativeLocalProcess— a good example of a process wrapper built on top of an existing backendLCProcess— a good reference for a backend mostly focused on reading and analysisKDProcess— an example of a backend with a deeper control API
Minimal structure
IMemoryBackend stays very small:
public interface IMemoryBackend : IDisposable, IMemorySpan
{
bool IsValid { get; }
bool TryReadMemory(IntPtr address, Span<byte> target);
bool TryWriteMemory(IntPtr address, ReadOnlySpan<byte> source);
}
In most cases, this is where your driver call, IOCTL, RPC, or DMA bridge lives.
The process wrapper connects this transport to a process context. Integration inputs are an already-open transport client, a PID in its address space, module/thread/region information, and an explicit connection owner. The SDK has no universal MyDriverClient; your transport supplies those operations.
IMemoryBackendalso supplies inheritedBaseAddress(long) andMemorySize(int), validity, and raw reads/writes at absolute addresses.truemeans success; the interface has no transferred-byte count or cancellation token. Do not report a partial read as a complete read.- Create
new MemoryAccessor(log, backend)and expose it asIProcessMemory Memory. Typed reads, strings and PE helpers use this accessor. IProcessalso providesIFluentLog Log,bool IsValid,string? ProcessName,int ProcessId,GetProcessModules(),GetThreads(),VirtualQuery(IntPtr)andGetMemoryRegions(). Modules must report the target's actual bases and sizes forMemoryOfModuleto select a range.- The owner stops consumers and disposes the accessor, backend and transport according to their ownership. Constructing
MemoryAccessordoes not attach the backend to accessor disposal.
The resulting object can be consumed without knowing its transport:
static int ReadValue(EyeAuras.Memory.IProcess process, long absoluteAddress)
{
return process.Memory.Read<int>(absoluteAddress);
}
This helper returns an int or propagates a read error. It borrows the process and does not close it or validate the transport. Contracts were checked at EyeAuras 20fd3d4; connecting the specific driver remains an integration input.
Alternative transport through an in-process DLL
A custom process can also communicate with your DLL inside the target using a named pipe, shared memory or another IPC mechanism. The agent handles reads, writes and process metadata; the external stack still consists of a transport client, IMemoryBackend, then IProcess.
This allows in-process work or higher-level target data to be exposed through the same consumer API. You must supply DLL delivery, protocol, serialization and versioning. An agent crash can affect the target process, and this has different protection constraints from external reading. See DLL injection for delivery mechanisms.
What you should implement right away
If you want the integration to be truly usable, do not stop at TryReadMemory(...). A practical minimum is:
MemoryGetProcessModules()GetThreads()VirtualQuery(...)GetMemoryRegions()
Without modules, you lose proper MemoryOfModule(...). Without regions and VirtualQuery(...), memory analysis becomes much less useful.
What you can add later
If your driver can do more, you can also expose extra capability interfaces on top of IProcess:
IProcessControlApi— suspend, allocate, protect,remote threadIProcessSupportsManualMappingIProcessSupportsUserApc
So the usual path looks like this:
- first, make reading stable and describe the process properly
- then add the control API
- only after that move on to
DLL injectandmanual mapping
Common mistakes
- Trying to implement PE parsing, signatures, and strings directly inside the driver class
- Exposing only raw read/write without modules or a memory map
- Mixing the low-level backend and the process wrapper into one large class
- Starting with injection before verifying normal reads, modules, and signatures
If a game uses a non-standard structure layout, that usually does not require a new backend. In most cases, the right solution is a separate mapper on top of an existing IProcess.