$ show veeenu/eldenring-practice-tool
This repository implements the Elden Ring Practice Tool, a Windows application that provides an in-game overlay with cheats, debugging utilities, and speedrun practice features for Elden Ring. The system works by injecting a DLL into the game process, hooking DirectX 12 to render an ImGui overlay, and reading/writing game memory via pointer chains. The architecture is a Cargo workspace with multiple crates: `practice-tool` (main DLL with overlay UI), `lib/libeldenring` (core memory editing and parameter access library), `lib/param-tinkerer` (standalone parameter editor), `lib/no-logo` (intro screen removal DLL), `lib/scripts` (injector), and `xtask` (build and code generation orchestration). Key entry points include `practice-tool/src/lib.rs` (DLL main), `practice-tool/src/practice_tool.rs` (ImGui render loop), and `xtask/src/main.rs` (build tasks). Data flows involve reading game memory via pointer chains, parsing game parameters from community-maintained Paramdex XML, and generating Rust structs and base addresses via AOB scanning. External dependencies include `hudhook` for injection, `imgui` for UI, `windows` crate for Win32 APIs, and `Paramdex` for game data definitions. The tool is heavily version-dependent, supporting 28 game versions with hardcoded base addresses.
The LLM identified 4 files worth highlighting for reuse:
Provides `PointerChain`, `Bitflag`, and `BytesPatch` abstractions for safe read/write of game process memory. `PointerChain` evaluates a chain of offsets with crash safety via `ReadProcessMemory` error handling. `Bitflag` implements XOR/AND/OR flag toggling with the `FlagToggler` trait. This module is isolated (depends only on `windows` and standard library) and can be reused in any Windows game memory editing project.
A derive macro crate (`ParamStruct`, `bitflag`) that generates metadata and bitfield accessors for `#[repr(C)]` structs representing game parameter data. It enables automatic generation of visitor lambdas and field-level bitflag parsing. This pattern is reusable for any binary format definition where structs need to be annotated with field offsets and bit flags, and can be extracted for other game modding or data analysis tools.
A set of code generation tasks that produce Rust source files from external data sources: base addresses from AOB scans of game executables, param structs from Paramdex XML, and item IDs from YAML. The pipeline uses `pelite` for PE parsing, `quick-xml` for XML, and `serde_yaml` for YAML. This pattern is reusable for any project that needs to keep generated code in sync with external game data, and demonstrates a clean separation between data sources and generated output.
Parses a TOML configuration file (`jdsd_er_practice_tool.toml`) into a list of widget instances. Each command (e.g., flag toggle, position save, warp) is mapped to a specific widget type via a `Command` enum. This pattern decouples feature definition from implementation, allowing users to customize hotkeys and enabled widgets without recompilation. The approach is reusable for any application that needs a user-extensible command system with a configuration file.