Skip to content

Latest commit

Β 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HuntMemory (HMem) πŸ”βš‘

Documentation CI Build License: GPL v3 Platform Architecture Rust Kotlin Jetpack Compose

HuntMemory (HMem) is a high-performance process memory editor and scanner designed exclusively for Android 10+ (API 29+) on ARM64 (arm64-v8a / aarch64-linux-android).

The project pairs a modern Jetpack Compose floating overlay UI with an ultra-fast Rust 2024 scanning core accelerated by ARM NEON SIMD, interfacing directly with the Linux kernel via the HMKPM (KernelPatch Module).


πŸ“± Target Device Requirements

To run HuntMemory on your device:

  1. Architecture: Physical 64-bit ARM device (arm64-v8a / aarch64).
  2. Android Version: Android 10.0+ (API level 29 or higher).
  3. Kernel Version: Kernel Linux (4.14+).
  4. Root Environment:
  • Magisk 26+, KernelSU, or APatch with root granted.
  1. KernelPatch & HuntMemory-KPM(HMKPM):
  • Device kernel patched with KernelPatch.
  • Or Device kernel patched with KPM-Manager.
  • HMKPM loaded to enable direct MMU memory manipulation via the SYS_GETRESUID syscall hook.
  1. Overlay Permission:
  • Grant "Display over other apps" (SYSTEM_ALERT_WINDOW) when prompted on the initial launch.

πŸ›οΈ System Architecture

HuntMemory isolates presentation, privileged operations, and native computation across distinct security domains:

graph TD
    subgraph UI_Space ["Android App (Userspace - App Process)"]
        UI["Overlay UI (Jetpack Compose)"]
        VK["Virtual Keyboard (QWERTY / NUM / HEX)"]
        Canvas_UI["LuaCanvasOverlay (GPU / DrawScope)"]
        Tabs["Tabs (Process / Scan / Table / Lua / Settings)"]
        Conn["HMemServiceConnection (IPC Client)"]
    end

    subgraph Root_Space ["Root Service (Userspace - UID 0 via libsu)"]
        RS["HMemService (RootService AIDL)"]
        NB["NativeBridge (JNI @FastNative)"]
        subgraph Rust_Engine ["Rust Engine (libhmem_jni.so)"]
            SCAN["Scanner (ARM NEON SIMD)"]
            EDIT["Editor & FreezeEngine (Worker Thread)"]
            SCRIPT["Lua 5.4 Engine (mlua + gg.* API)"]
            MAPS["Maps & Pagemap Streaming Parser"]
            KPMC["HMKPM Client (mlock + Syscall Hook)"]
        end
    end

    subgraph Kernel_Space ["Kernel Space (KernelPatch Module)"]
        KPM["HMKPM (KernelPatch Module)"]
        PGD["MMU Page Table Walking (task->mm->pgd)"]
        MEM["Target Process Physical RAM"]
    end

    UI --> Conn
    VK --> UI
    Tabs --> UI
    Conn -- "AIDL / Binder IPC" --> RS
    RS --> NB
    NB --> Rust_Engine
    SCRIPT -. "Canvas & UI Callbacks" .-> Canvas_UI
    KPMC -- "Syscall getresuid (Magic 0x00484D4B504D)" --> KPM
    KPM --> PGD
    PGD --> MEM
Loading

For complete technical specifications, see the System Architecture Documentation.


✨ Key Features

  • 🎯 SIMD-Accelerated Memory Scanning:

    • ARM NEON Intrinsics: Vectorized memory evaluation processing up to 16 bytes per cycle.
    • Multi-Type & Auto Scan: Search across multiple integer and floating-point types simultaneously.
    • Range & Group Scanning: Locate values within bounds or discover structured variables grouped closely in memory (spec:distance).
    • Unknown & Differential Scans: Track dynamic values with Increased, Decreased, Changed, Unchanged, and delta filters.
  • πŸ“œ Lua 5.4 Scripting & GameGuardian Compatibility:

    • Native hmem.* & gg.* Support: Direct compatibility for running existing GameGuardian scripts.
    • Dynamic Overlay Menus & Dialogs: Create custom floating cheat menus, prompts, and choice selectors in Jetpack Compose directly from Lua.
    • On-Screen Canvas Overlay (ESP/HUD): Hardware-accelerated 2D lines, bounding boxes, circles, and text rendering overlaying target games.
  • πŸ” Obscured & Scientific Number Support:

    • XOR-Keypair Decryption: Native detection and editing for Anti-Cheat Toolkit (ACTk) obscured types (ObscuredInt, ObscuredFloat, ObscuredDouble, ObscuredLong).
    • BigDouble / Scientific Structs: Parse and modify scientific mantissa/exponent structures used by incremental engines (BreakInfinity / Decimal).
  • πŸ—ΊοΈ Comprehensive Memory Region Filtering:

    • Automatically classifies memory mappings: Anonymous [A], C++ Alloc [CA], C++ BSS [CB], C++ Data [CD], C++ Heap [CH], Java Heap [JH], Stack [S], Ashmem [AS], and Libraries [XA].
    • Pagemap residency verification and zram swap awareness.
  • ✏️ Real-Time Memory Editing & Freeze Engine:

    • Single and batch memory writing.
    • Low-overhead native background thread maintaining locked values at configurable intervals.
  • πŸ“± Modern Floating Overlay UI:

    • Fully resizable and movable overlay built with Jetpack Compose Material 3.
    • Integrated Contextual Virtual Keyboard: Custom QWERTY, Numeric, and Hexadecimal input without triggering system IME displacements.

πŸ“š Technical Documentation

Deep-dive documentation for all core subsystems is available online at yervant7.github.io/HuntMemory or in the docs/ directory:

  • πŸ›οΈ System Architecture β€” Architectural layers, lifecycle management, and IPC mechanics.
  • ⚑ Memory Scanning Engine β€” SIMD vectorization, chunked reading pipelines, and scan modes.
  • πŸ“œ Lua Scripting & Canvas β€” Lua 5.4 runtime, gg.* compatibility, and real-time Canvas ESP overlay.
  • πŸ›‘οΈ HMKPM Kernel Protocol β€” KernelPatch module specifications, struct layouts, and syscall definitions.
  • πŸ› οΈ Building & Setup Guide β€” Toolchain requirements, Gradle build tasks, and debugging tips.

πŸ“‚ Repository Structure

HuntMemory/
β”œβ”€β”€ AGENTS.md                                   # Project rules and architectural guidelines
β”œβ”€β”€ LICENSE                                     # GNU General Public License v3.0
β”œβ”€β”€ README.md                                   # Project overview and quick start
β”œβ”€β”€ docs/                                       # In-depth technical documentation
β”‚   β”œβ”€β”€ architecture.md                         # System architecture and multi-tier design
β”‚   β”œβ”€β”€ building.md                             # Toolchain prerequisites and build guide
β”‚   β”œβ”€β”€ index.md                                # Documentation homepage & portal
β”‚   β”œβ”€β”€ kernel-protocol.md                      # HMKPM kernel communication protocol
β”‚   β”œβ”€β”€ lua-scripting.md                        # Lua 5.4 scripting & Canvas overlay API
β”‚   β”œβ”€β”€ memory-scanning.md                      # SIMD scanning engine and data types
β”‚   └── requirements.txt                        # MkDocs documentation build requirements
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ build.gradle.kts                        # Android build script & cargo-ndk automation
β”‚   β”œβ”€β”€ src/main/
β”‚   β”‚   β”œβ”€β”€ AndroidManifest.xml                 # App manifest & permissions
β”‚   β”‚   β”œβ”€β”€ aidl/com/yervant/huntmem/
β”‚   β”‚   β”‚   └── IHMemService.aidl               # RootService AIDL IPC contract
β”‚   β”‚   β”œβ”€β”€ hmem/                               # Rust core workspace
β”‚   β”‚   β”‚   β”œβ”€β”€ Cargo.toml                      # Workspace configuration
β”‚   β”‚   β”‚   └── hmem_jni/
β”‚   β”‚   β”‚       β”œβ”€β”€ Cargo.toml                  # Native dependencies
β”‚   β”‚   β”‚       └── src/
β”‚   β”‚   β”‚           β”œβ”€β”€ lib.rs                  # JNI boundary & session manager
β”‚   β”‚   β”‚           β”œβ”€β”€ kpm.rs                  # HMKPM kernel client (syscall 148)
β”‚   β”‚   β”‚           β”œβ”€β”€ scanner.rs              # NEON SIMD memory scanner
β”‚   β”‚   β”‚           β”œβ”€β”€ editor.rs               # Memory editor & freeze engine
β”‚   β”‚   β”‚           β”œβ”€β”€ script.rs               # Lua 5.4 engine & GameGuardian bridge
β”‚   β”‚   β”‚           β”œβ”€β”€ maps.rs                 # /proc/[pid]/maps parser & classifier
β”‚   β”‚   β”‚           β”œβ”€β”€ pagemap.rs              # /proc/[pid]/pagemap resident page reader
β”‚   β”‚   β”‚           β”œβ”€β”€ types.rs                # C-ABI structs and supported data types
β”‚   β”‚   β”‚           └── logger.rs               # Android logcat bridge
β”‚   β”‚   └── kotlin/com/yervant/huntmem/
β”‚   β”‚       β”œβ”€β”€ HuntMemApp.kt                   # Application entry point
β”‚   β”‚       β”œβ”€β”€ backend/                        # Root service, IPC & native bridge
β”‚   β”‚       β”‚   β”œβ”€β”€ NativeBridge.kt             # @FastNative JNI wrappers
β”‚   β”‚       β”‚   β”œβ”€β”€ HMemService.kt              # libsu RootService implementation
β”‚   β”‚       β”‚   β”œβ”€β”€ HMemServiceConnection.kt    # Service lifecycle manager
β”‚   β”‚       β”‚   β”œβ”€β”€ MemoryEngine.kt             # High-level memory scan orchestrator
β”‚   β”‚       β”‚   β”œβ”€β”€ MemoryScanManager.kt        # Scan session manager
β”‚   β”‚       β”‚   └── ShellProcessProvider.kt     # Process discovery & enumeration
β”‚   β”‚       └── ui/                             # Jetpack Compose UI
β”‚   β”‚           β”œβ”€β”€ MainActivity.kt             # Setup & permission verification
β”‚   β”‚           β”œβ”€β”€ OverlayService.kt           # Floating overlay lifecycle service
β”‚   β”‚           β”œβ”€β”€ OverlayUI.kt                # Main Compose overlay container
β”‚   β”‚           β”œβ”€β”€ keyboard/                   # Integrated virtual keyboard
β”‚   β”‚           β”œβ”€β”€ overlay/
β”‚   β”‚           β”‚   β”œβ”€β”€ LuaCanvasOverlay.kt     # Real-time GPU Canvas overlay renderer
β”‚   β”‚           β”‚   └── tabs/                   # UI tabs (Process, Scan, Table, Lua, Settings)
β”‚   β”‚           β”‚       β”œβ”€β”€ AddressTableTab.kt  # Frozen & saved address manager
β”‚   β”‚           β”‚       β”œβ”€β”€ LuaScriptTab.kt     # Lua script editor & console
β”‚   β”‚           β”‚       β”œβ”€β”€ LuaUiBridge.kt      # Dynamic UI & Canvas dispatcher
β”‚   β”‚           β”‚       β”œβ”€β”€ MemoryScanTab.kt    # Memory scanner & filter UI
β”‚   β”‚           β”‚       └── ProcessSelectionTab.kt # Process selector
β”‚   β”‚           └── theme/                      # Material 3 styling & typography

πŸ› οΈ Quick Build Guide

Prerequisites

  • Android SDK: compileSdk = 37, minSdk = 29, NDK 29.0.14206865
  • JDK: Java 21 LTS
  • Rust: Rust 2024 Edition (rustup target add aarch64-linux-android)
  • cargo-ndk: cargo install cargo-ndk

Compiling the APK

Gradle automatically builds the Rust native shared library (libhmem_jni.so) during the build lifecycle:

# Debug build
.\gradlew assembleDebug

# Release build
.\gradlew assembleRelease

For detailed instructions, refer to the Building Guide.


πŸ“œ License

HuntMemory is licensed under the GNU General Public License v3.0 (GPLv3). See the LICENSE file for details.

About

Android memory editor app based on kernel

Resources

Stars

45 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages