Skip to content

TheDarkSword/DarkClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ DarkClient - Minecraft Injection Client

Rust License Platform

A Minecraft hacked client built in Rust, utilizing JNI (Java Native Interface) for seamless integration with Minecraft's Java runtime. DarkClient provides a robust architecture for developing game modifications through dynamic library injection.

Minecraft Version Mappings: 1.21.8

๐Ÿš€ Features

  • ๐Ÿ”ง Dynamic Library Injection: Hot-swappable module system without requiring game restarts
  • ๐ŸŽจ Cross-Platform GUI: Beautiful injector interface built with egui
  • โŒจ๏ธ Real-time Input Handling: Advanced keyboard event processing for module toggling
  • ๐Ÿ—บ๏ธ Smart Mapping System: Automatic obfuscation handling through JSON-based mappings
  • ๐Ÿ”„ Module Architecture: Extensible module system for easy feature development
  • ๐Ÿ“Š Comprehensive Logging: Detailed logging system for debugging and monitoring
  • ๐Ÿ”’ Thread-Safe Design: Robust multi-threaded architecture with proper synchronization

๐Ÿ—๏ธ Architecture

The project is organized into three main components:

1. Injector (injector/)

A user-friendly GUI application that handles:

  • Process detection (finding Minecraft instances)
  • Library injection into target processes
  • Status monitoring and error reporting

2. Agent Loader (agent_loader/)

A JVMTI agent that provides:

  • Dynamic library loading capabilities
  • TCP command server for hot-reloading
  • Process lifecycle management
  • Cross-platform injection support

3. Client Library (client/)

The core modification framework featuring:

  • JNI integration with Minecraft's runtime
  • Module system for game modifications
  • Mapping system for obfuscation handling
  • Input processing and event management

๐Ÿ“‹ Prerequisites

  • Rust 1.87.0+ with Cargo package manager
  • Java Development Kit (JDK) 21+
  • Minecraft Java Edition

๐Ÿ› ๏ธ Installation & Setup

1. Clone the Repository

bash git clone https://github.com/TheDarkSword/DarkClient
cd darkclient

2. Build the Project

cargo build --release

3. Prepare Mappings

The framework uses obfuscation mappings to interact with Minecraft:

Convert Mojang mappings using the included Python script

python conversion.py

Place the resulting mappings.json in the project root

๐ŸŽฎ Usage

Quick Start

  1. Launch the Injector:
    cd target/release
    ./injector

Warning

libagent_loader and libclient must be in the same directory where you run the injector.

  1. Start Minecraft and load into a world

  2. In the Injector GUI:

  • Click "Find" to detect the Minecraft process
  • Click "Inject" to load the modification framework
  1. Use Modules:
  • Modules can be toggled using their assigned keybinds
  • Check the log files for module status and debugging info

Module Development

Create new modules by implementing the Module trait:

use crate::module::{Module, ModuleData};

pub struct CustomModule {
    data: ModuleData,
    // Your module-specific fields
}

impl Module for CustomModule {
    fn get_module_data(&self) -> &ModuleData {
        &self.data
    }
    
    fn get_module_data_mut(&mut self) -> &mut ModuleData {
        &mut self.data
    }
    
    fn on_start(&self) {
        // Called when module is enabled
    }
    
    fn on_stop(&self) {
        // Called when module is disabled
    }
    
    fn on_tick(&self) {
        // Called every game tick while enabled
    }
}
DarkClient/
โ”œโ”€โ”€ ๐Ÿ“ client/               # Core modification library
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ src/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ lib.rs        # Main library entry point
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ client.rs     # DarkClient core & JVM integration
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ mapping/      # Minecraft mapping system
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“ module/       # Module framework
โ”œโ”€โ”€ ๐Ÿ“ injector/             # GUI injection tool
โ”‚   โ””โ”€โ”€ ๐Ÿ“ src/
โ”‚       โ””โ”€โ”€ ๐Ÿ“„ main.rs       # Injector application
โ”œโ”€โ”€ ๐Ÿ“ agent_loader/         # JVMTI agent for dynamic loading
โ”œโ”€โ”€ ๐Ÿ“„ mappings.json         # Minecraft obfuscation mappings
โ”œโ”€โ”€ ๐Ÿ“„ conversion.py         # Mapping conversion utility
โ””โ”€โ”€ ๐Ÿ“„ Cargo.toml           # Workspace configuration

๐Ÿ”ง Configuration

Logging

Logs are written to:

    • Injector application logs app.log is located where injector is executed
    • Client library logs dark_client.log is located in .minecraft

Network Settings

The agent loader uses TCP port 7878 for communication. This can be modified in : platform/mod.rs

pub const SOCKET_ADDRESS: SocketAddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 7878);

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-module)
  3. Commit your changes (git commit -am 'Add amazing module')
  4. Push to the branch (git push origin feature/amazing-module)
  5. Create a Pull Request

Development Guidelines

  • Follow Rust best practices and use cargo fmt
  • Add comprehensive documentation for new modules
  • Include proper error handling and logging

โš ๏ธ Legal Notice

This project is intended for educational and research purposes. Users are responsible for complying with:

  • Minecraft's Terms of Service
  • Mojang's Commercial Usage Guidelines
  • Local laws and regulations regarding game modifications

๐Ÿ“„ License

This project is licensed under the GNU GPL License - see the LICENSE file for details.

About

Minecraft Injection Client built with Rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published