Skip to content

ngentood/unity-modmenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

native-lib (Android NDK)

A native C/C++ library for Android that builds a shared library libnative-lib.so featuring an ImGui overlay, hooking/memory utilities, and modern networking (HTTP/2/HTTP/3/TLS) via prebuilt libraries.

This project uses CMake (>= 3.10) and C++17.

Features

  • ImGui (Android + OpenGL ES 3 backends) for UI overlay
  • Hooking & memory utilities: Dobby, KittyMemory (+ Keystone)
  • Loader/symbol helper: xdl
  • Networking: cURL + BoringSSL (crypto/ssl) + nghttp2 + nghttp3 + ngtcp2 (crypto)
  • Supports multiple Android ABIs (as available under prebuilt/)

Screenshots

Vampires Fall 2 Icon

Vampires Fall 2 Menu

Project Structure

/build/jni/
├─ CMakeLists.txt                    # Main build configuration
├─ hacks/hooks.h                     # Hook-related header
├─ include/                          # Public and vendor headers
│  ├─ assets/ fonts/ includes/ menu/ vendor/ nlohmann/
│  ├─ vendor/stb_image.h             # STB image header (upstream)
│  ├─ vendor/stb_image_resize2.h     # STB resize header (upstream)
│  └─ color.h
├─ prebuilt/                         # Per-ABI prebuilt static libraries
│  ├─ crypto/ ssl/ curl/ nghttp2/ nghttp3/ ngtcp2/ ngtcpc/ dobby/ include/
│  └─ README.md                      # Prebuilt library list
├─ src/
│  ├─ core/                          # JNI, networking utils, app state, etc.
│  ├─ main/                          # entry point, input hook
│  ├─ menu/                          # ImGui menu/theme implementation
│  └─ third_party/
│     └─ stb_impl.cpp                # STB compilation unit (image + resize2)
└─ third_party/
   ├─ ImGui/                         # ImGui sources + backends
   ├─ KittyMemory/                   # Memory utils (+ Keystone deps)
   └─ xdl/                           # Loader/symbol helper

Note: stb_image and stb_image_resize2 are integrated via headers under include/vendor and compiled through src/third_party/stb_impl.cpp. The previous reference to Layout_sample/ImGui/stb_image.cpp is no longer used.

Dependencies (bundled/prebuilt)

  • Dobby (static)
  • BoringSSL (libcrypto, libssl) (static)
  • cURL (static)
  • nghttp2, nghttp3, ngtcp2, ngtcp2_crypto (static)
  • KittyMemory (+ Keystone static per-ABI at third_party/KittyMemory/Deps/Keystone/libs-android/${ANDROID_ABI}/libkeystone.a)
  • xdl (built from sources under third_party/xdl)
  • ImGui (built from sources under third_party/ImGui)
  • STB image + resize2 (headers in include/vendor, compiled via src/third_party/stb_impl.cpp)

Refer to each library's license in its directory. Project license: set according to your needs.

Prerequisites

  • Android NDK installed (set ANDROID_NDK_HOME or ANDROID_NDK_ROOT)
  • CMake >= 3.10
  • Appropriate toolchain/SDK for the target ABI

Build (CLI)

Example build for arm64-v8a:

# 1) Create build directory
cmake -S . -B build-android-arm64 \
  -DANDROID_ABI=arm64-v8a \
  -DANDROID_PLATFORM=android-21 \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake"

# 2) Compile
cmake --build build-android-arm64 -j

The output libnative-lib.so will be located under the build directory (e.g., build-android-arm64/). Repeat for other ABIs present in prebuilt/.

Important flags:

  • -DANDROID_ABI=...: pick one that exists (e.g., armeabi-v7a, arm64-v8a, x86, x86_64) matching subfolders in prebuilt/<lib>/<ABI>/.
  • -DANDROID_PLATFORM=android-21 or as needed.

Integrating into an Android App

  1. Copy the resulting .so into your app's jniLibs/ structure, e.g.:
app/src/main/jniLibs/arm64-v8a/libnative-lib.so
  1. Ensure Gradle/AGP packages jniLibs into the APK/AAB.
  2. Load the library from Java/Kotlin:
static {
    System.loadLibrary("native-lib");
}

Troubleshooting

  • STB headers missing: ensure include/vendor/stb_image.h and include/vendor/stb_image_resize2.h exist (downloaded from upstream) and that the stb_image target includes include/vendor in target_include_directories. Also ensure src/third_party/stb_impl.cpp defines both STB_IMAGE_IMPLEMENTATION and STB_IMAGE_RESIZE2_IMPLEMENTATION.
  • ABI mismatch at link time: make sure -DANDROID_ABI matches the ABI subfolders under prebuilt/ (all required prebuilt libs must exist for the chosen ABI).
  • Missing headers: ensure include paths in CMake are correct and folders exist under include/ or third_party/.

Development & Debugging

  • Logging: use logcat (the library links against log/android).
  • Graphics: backends use EGL and GLESv3 (ensure a valid OpenGL ES context during ImGui Android backend initialization).

Credits

This project combines work from multiple open-source libraries: ImGui, Dobby, KittyMemory, Keystone, xdl, cURL, BoringSSL, nghttp2/nghttp3/ngtcp2, STB, and others. Please respect each project's license.

About

ImGui based modmenu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •