A lightweight Windows C library for external process memory manipulation. hutil provides a simple, session-based API to read and write memory of other processes, resolve dynamic memory addresses (DMA) through pointer chains, and find process/module information.
- Session-based API: Easily manage process handles and module base addresses.
- Memory Operations: Read and write various data types (
uint8_t,int32_t,int64_t,float,double) and arbitrary buffers. - Pointer Chain Resolution: Resolve dynamic addresses by following a base offset and a list of multi-level offsets.
- Automatic Process Discovery: Find process IDs and module base addresses by name.
- Clean Interface: Error handling through descriptive result codes.
Simply include hutil.h and hutil.c in your project, or add it as a library in your CMake configuration.
add_library(hutils STATIC hutil.c hutil.h)
target_link_libraries(your_project hutils)#include "hutil.h"
#include <stdio.h>
int main() {
hutil_Session* session = NULL;
// Initialize session for "target_game.exe" and its module "GameAssembly.dll"
HUTIL_RESULT result = hutil_Init("target_game.exe", "GameAssembly.dll", &session);
if (result != HUTIL_SUCCESS) {
printf("Failed to initialize hutil session: %d\n", result);
return 1;
}
uintptr_t targetAddress = 0x03A055D0;
int32_t value = 0;
if (hutil_ReadInt32(session, targetAddress, &value) == HUTIL_SUCCESS) {
printf("Read value: %d\n", value);
// Write a new value
hutil_WriteInt32(session, targetAddress, 999);
}
hutil_Close(session);
return 0;
}uintptr_t baseOffset = 0x001A2B3C;
uintptr_t offsets[] = { 0x10, 0x20, 0x30 };
uintptr_t resolvedAddress = 0;
HUTIL_RESULT res = hutil_FindDMAAddy(session, baseOffset, offsets, 3, &resolvedAddress);
if (res == HUTIL_SUCCESS) {
float health = 0.0f;
hutil_ReadFloat(session, resolvedAddress, &health);
printf("Health: %.2f\n", health);
}hutil_Init: Search for process/module and open a session.hutil_Close: Close process handles and free session memory.
hutil_FindDMAAddy: Navigate pointer chains to find dynamic addresses.
hutil_ReadByte,hutil_ReadInt32,hutil_ReadInt64,hutil_ReadFloat,hutil_ReadDoublehutil_ReadBuffer: Read arbitrary blocks of memory.
hutil_WriteByte,hutil_WriteInt32,hutil_WriteInt64,hutil_WriteFloat,hutil_WriteDoublehutil_WriteBuffer: Write arbitrary blocks of memory.
- Operating System: Windows
- Compiler: Any C compiler with Windows API support (MinGW, MSVC, etc.)
- Permissions: May require Administrator privileges depending on the target process.