Skip to main content
libmem logo

Welcome to libmem

libmem is a powerful, cross-platform memory hacking library designed for game hacking, reverse engineering, and low-level memory manipulation. Built with performance and flexibility in mind, libmem provides a comprehensive API for both internal and external process manipulation.
libmem is licensed under GNU AGPLv3.0 (no later versions). Submodules and external dependencies may have their own licenses.

Why libmem?

libmem offers a unified interface across multiple platforms and programming languages, making it the go-to solution for:
  • Cross-platform development - Write once, run on Windows, Linux, and FreeBSD
  • Multi-language support - Native bindings for C/C++, Rust, and Python
  • Internal & External - Manipulate processes from within or outside
  • Production-ready - Battle-tested in real-world game hacking projects

Quick Start

Installation Guide

Get libmem installed on your system in minutes

API Reference

Explore the complete API documentation

Features Overview

Discover what libmem can do for you

Platform Support

Check compatibility with your target platform

Quick Example

Here’s a simple example demonstrating libmem’s power with modern C++:
/* C++20 or higher */
#include <libmem/libmem.hpp>
#include <iostream>

using namespace libmem;

int main()
{
    Address disas_addr = reinterpret_cast<Address>(main);

    // Disassemble function 'main' until a 'ret' is found
    for (;;) {
        auto inst = Disassemble(disas_addr).value();
        std::cout << inst.to_string() << std::endl;
        if (inst.mnemonic == "ret")
            break;
        disas_addr += inst.bytes.size();
    }

    return 0;
}
This example demonstrates libmem’s JIT disassembly capabilities - one of many powerful features available out of the box.

Function Hooking Made Easy

Hook functions with just a few lines of code:
#include <libmem/libmem.h>

void hk_take_damage(int amount)
{
    printf("hooked take_damage! no damage will be taken\n");
    return;
}

int main()
{
    lm_module_t game_mod;
    lm_address_t fn_take_damage;

    LM_FindModule("game.dll", &game_mod);
    printf("[*] Base address of 'game.dll': %p\n", game_mod.base);

    fn_take_damage = LM_FindSymbolAddress(&game_mod, "take_damage");
    printf("[*] Found 'take_damage' function: %p\n", fn_take_damage);

    LM_HookCode(fn_take_damage, hk_take_damage, LM_NULLPTR);
    printf("[*] 'take_damage' hooked, player will no longer receive damage\n");

    return 0;
}

Community & Support

Join our Discord Server

Get help, share projects, and connect with other libmem users

Next Steps

Read the Features

Explore all capabilities

Install libmem

Get started with installation

View Examples

Learn from practical examples

Build docs developers (and LLMs) love