Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐧 Penguin Client Base - C++ JNI Injectable (Minecraft 1.8.9)

Disclaimer & Purpose: This project is strictly an educational framework and open-source base. It is designed to demonstrate C++ to JVM interoperability, memory hooking, and OpenGL rendering overlays. This is NOT a fully finished malicious cheat. It is a foundation meant for developers and reverse-engineering enthusiasts to learn from, build upon, and add their own modules. Feel free to fork it, study it, and extend it!


image

✨ Features Breakdown (Educational Implementations)

The current source includes basic logic to demonstrate how to manipulate the JVM safely and bypass basic server-side checks.

  • 🎨 Custom ImGui Framework: A highly customized, animated ImGui menu with dynamic keybind capturing, RGB toggles, and an in-game Active Modules HUD overlay.
  • ⚔️ KillAura Logic: Demonstrates randomization to simulate human behavior (Min/Max CPS, Base Reach + Variance, FOV Angles) alongside W-Tap, Auto-Crit, and Block-Hit packet mechanics.
  • 🛡️ AntiBot: Shows how to read and filter entity properties (UUIDs, ticks existed, invisible names) to avoid attacking server-side Anti-Cheat NPCs.
  • 🏃 SafeWalk: Interacts with the player's movement and onGround flags. Includes sub-modes like Sneak, Breezily (with custom click delays and slowdown multipliers).
  • 🖱️ AutoClicker: Emulates human clicking patterns for Left/Right mouse buttons, featuring Jitter/Butterfly emulation and block-breaking compatibility.
  • 🧱 Anti-Knockback (Velocity): Manipulates motionX/Y/Z fields when taking damage. It includes a Human Error Chance parameter to occasionally take normal knockback, making it highly undetectable.

🏗️ Technical Breakdown & Architecture

This section explains how a C++ DLL can interface with a running Java Virtual Machine (JVM) to read, modify, and extend a Java application's runtime behavior.

Prerequisites & Tooling

  1. A C++ compiler targeting x64/x86 Windows (MSVC) producing a DLL.
  2. The Java Native Interface (JNI) headers (jni.h, jni_md.h) from a JDK matching the target JVM version.
  3. MinHook to intercept Win32/OpenGL functions at runtime.
  4. Dear ImGui (OpenGL2 + Win32 backend) for drawing overlay windows.
  5. MCP (Mod Coder Pack) mappings to translate obfuscated game functions/fields to human-readable names.

Core Architecture: Two Worlds

The fundamental challenge: your code runs in a C++ DLL, but the game runs on a Java VM. These are separate runtimes with separate memory spaces.

  • Acquiring the JVM: When Java starts, it loads jvm.dll. Your injected DLL finds this with GetModuleHandleA("jvm.dll"). From there, JNI_GetCreatedJavaVMs returns a pointer to the running JavaVM object.
  • Attaching Your Thread: C++ threads are NOT automatically known to the JVM. You must call g_jvm->AttachCurrentThread() to register your thread and get a JNIEnv* pointer. (Attach once, reuse, detach only at shutdown).
  • Execution Inside the Game Loop: State changes only during the game's main loop. The cleanest approach is hooking wglSwapBuffers from opengl32.dll using MinHook. Inside your hook, you have a frame-accurate execution point to do JNI reads/writes and render the ImGui overlay.

Design Patterns & Gotchas

  • Singleton Caching: Cache jfieldID, jmethodID once in a if (bFirstTime) block. Never look them up per-frame.
  • Global References: Use env->NewGlobalRef(localRef) to keep Java objects alive across frames (essential for the Minecraft singleton).
  • Error Handling: Always use env->ExceptionCheck() and env->ExceptionClear() after JNI calls to prevent JVM crashes.
  • Clean Unload: Disable MinHook -> Restore WndProc -> Shutdown ImGui -> Detach JVM Thread -> FreeLibraryAndExitThread.

🛠️ How to Build & Extend

Since this is a base, you are encouraged to add your own features!

  1. Clone the repository and open the .vcxproj file in Visual Studio 2022.
  2. Ensure you have the Java JDK installed on your system.
  3. Adjust the project's Include Directories to point to your JDK's include and include/win32 folders.
  4. Build the project as Release (x64 or x86 depending on your target JVM architecture).
  5. Inject the compiled .dll into the javaw.exe process using any standard DLL injector.

About

An open-source, educational C++ JNI injectable ghost client for Minecraft 1.8.9.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages