How hax0r31337/protohax works
Project Type & Purpose
• This is an open-source Java project built with Gradle. Its purpose is to provide an abstract, platform-agnostic cheat framework for Minecraft: Bedrock Edition. The cheat works by intercepting and controlling the network layer (packet manipulation) without modifying the Minecraft client.
• The README emphasizes its features (no client modifications, multi-version support, full packet control) and explains that platform-specific implementations (like Android) exist elsewhere.
Analyzing the File Structure
• The top-level layout shows standard Gradle configuration files (build.gradle, gradlew, settings.gradle) that indicate a Java-based project.
• The src/main/java directory contains packages under “dev.sora.relay” where most of the core functionality lives.
• There are distinct packages for:
• Relay and network components (e.g., MinecraftRelay.kt, MinecraftRelayListener.kt) handling the main entry point from the network layer.
• Cheat-specific modules and commands (under cheat/command, cheat/module, cheat/config). These classes (for example, CommandManager.kt, ModuleManager.kt) indicate the existence of a command system and a modular cheat framework that registers and toggles cheat behaviors.
• Game simulation and abstraction (packages like game/entity, game/inventory, game/world) which likely simulate Minecraft’s internal entities and world state.
• Session and protocol handling (packages under session and the org.cloudburstmc libraries) that manage network sessions, packet listening, and specialized protocols (such as handling Xbox logins).
• Utility classes (e.g., in dev.sora.relay/utils) for HTTP, JWT, JSON handling, logging and timing.
• The tests are organized under src/test which confirms that unit testing and sample usage are important for this project.
Main Components
a. Network Communication Layer:
• Components: MinecraftRelay, MinecraftRelayListener, various RelayListener classes (e.g., RelayListenerEncryptedSession, RelayListenerXboxLogin).
• Role: Handles establishing and managing the network session, processing incoming/outgoing packets, and interfacing with protocol decoders (integrated via CloudburstMC protocol packages).
b. Cheat Framework (Modules and Commands):
• Components: Cheat Module package (ModuleManager, CheatModule and implementations like ModuleKillAura, ModuleFly, etc.), Command package (CommandManager, specific Command implementations).
• Role: This layer contains cheat modules that modify game behavior, command interfaces to trigger actions, and configuration management (AbstractConfigManager, ConfigManagerFileSystem, and related config sections).
c. Game Abstraction Layer:
• Components: Game session, entity representations (EntityPlayer, EntityItem, etc.), event handling (EventManager, EventHandler), inventory and world/chunk management.
• Role: Replicates aspects of the Minecraft game environment for cheat operations such as entity management, world simulation, and game events.
d. Protocol & External Library Integration:
• Components: Protocol handling via org.cloudburstmc packages (bedrock codec, Zlib for compression).
• Role: Decode and interpret Minecraft: Bedrock protocol data ensuring version flexibility and correct packet interpretation.
e. Utility & Configuration:
• Components: Various utility classes (HTTPUtils, JWTUtils, Logger, timing classes) and configuration files.
• Role: Provide common support functions (logging, configuration persistence, timing) to all layers.
f. Build and Development Infrastructure:
• Components: Gradle scripts, README, and test modules.
• Role: Infrastructure for building, testing, and development cycles.
Relationships and Interactions
• The Cheat Framework receives commands and events from the network layer and, via the ModuleManager and CommandManager, manipulates game simulation represented in the Game Abstraction Layer.
• Interactions with configuration and utility modules happen as supporting flows (e.g., a cheat module checking configuration values or logging events).
• Protocol handling components connect to the network layer, interpreting raw data and producing meaningful entities for higher layers.
• The session management (including listeners for special cases like Xbox login) connects the external communication with the internal processing.
Emphasizing Architectural Patterns
• The modular structure (separation into commands, cheat modules, configuration) suggests a dynamic plug-in style architecture where new cheat modules can be dynamically managed.
• The clear session and event management imply an event-driven design.
• The layered approach where raw network data is processed before being used to simulate and manipulate game state shows separation of concerns and layered abstraction.