veeenu/hudhook

GitHub: veeenu/hudhook

Rust 实现的游戏渲染 API 钩子框架,支持 DirectX 与 OpenGL,可在目标进程中注入 Dear ImGui 覆盖层。

Stars: 317 | Forks: 47

# hudhook ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/veeenu/hudhook/lint.yml) [![GitHub Release](https://img.shields.io/github/v/release/veeenu/hudhook)](https://github.com/veeenu/hudhook/releases) [![Crates.io Version](https://img.shields.io/crates/v/hudhook)](https://crates.io/crates/hudhook) [![GitHub License](https://img.shields.io/github/license/veeenu/hudhook)](https://github.com/veeenu/hudhook/blob/main/LICENSE) [![Discord](https://img.shields.io/discord/267623298647457802)](https://discord.gg/j# hudhook ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/veeenu/hudhook/lint.yml) [![GitHub Release](https://img.shields.io/github/v/release/veeenu/hudhook)](https://github.com/veeenu/hudhook/releases) [![Crates.io Version](https://img.shields.io/crates/v/hudhook)](https://crates.io/crates/hudhook) [![GitHub License](https://img.shields.io/github/license/veeenu/hudhook)](https://github.com/veeenu/hudhook/blob/main/LICENSE) [![Discord](https://img.shields.io/discord/267623298647457802)](https://discord.gg/jhF3jTTCUs) [![书籍](https://img.shields.io/badge/docs-book-brightgreen)](https://veeenu.github.io/hudhook) [![rustdoc](https://img.shields.io/badge/docs-rustdoc-brightgreen)](https://veeenu.github.io/hudhook/rustdoc/hudhook) [![Patreon](https://img.shields.io/badge/Support_me-Patreon-orange)](https://www.patreon.com/johndisandonato) 一个用于构建 [Dear ImGui](https://github.com/ocornut/imgui) 覆盖层的 Rust 渲染器钩子库。 目前支持 DirectX 9、DirectX 11、DirectX 12 和 OpenGL 3。可在 Windows 和 Wine/Proton 上运行。 ![hello](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/7444c4da81084354.jpg) ## 资源 - [教程书籍](https://veeenu.github.io/hudhook)。 - [API 参考](https://veeenu.github.io/hudhook/rustdoc/hudhook)。 - [架构博客文章](https://veeenu.github.io/blog/sekiro-practice-tool-architecture/)(略微过时)。 ## 示例 ``` // src/lib.rs use hudhook::*; pub struct MyRenderLoop; impl ImguiRenderLoop for MyRenderLoop { fn render(&mut self, ui: &mut imgui::Ui) { ui.window("My first render loop") .position([0., 0.], imgui::Condition::FirstUseEver) .size([320., 200.], imgui::Condition::FirstUseEver) .build(|| { ui.text("Hello, hello!"); }); } } { // Use this if hooking into a DirectX 9 application. use hudhook::hooks::dx9::ImguiDx9Hooks; hudhook!(ImguiDx9Hooks, MyRenderLoop); } { // Use this if hooking into a DirectX 11 application. use hudhook::hooks::dx11::ImguiDx11Hooks; hudhook!(ImguiDx11Hooks, MyRenderLoop); } { // Use this if hooking into a DirectX 12 application. use hudhook::hooks::dx12::ImguiDx12Hooks; hudhook!(ImguiDx12Hooks, MyRenderLoop); } { // Use this if hooking into an OpenGL 3 application. use hudhook::hooks::opengl3::ImguiOpenGl3Hooks; hudhook!(ImguiOpenGl3Hooks, MyRenderLoop); } ``` ``` // src/main.rs use hudhook::inject::Process; fn main() { let mut cur_exe = std::env::current_exe().unwrap(); cur_exe.push(".."); cur_exe.push("libmyhook.dll"); let cur_dll = cur_exe.canonicalize().unwrap(); Process::by_name("MyTargetApplication.exe").unwrap().inject(cur_dll).unwrap(); } ```
标签:Crates.io, Dear ImGui, DirectX, DirectX 11, DirectX 12, DirectX 9, GUI, Hook, OpenGL, OpenGL 3, Overlay, Proton, Rust, Wine, 可视化界面, 图形学, 图形渲染钩子, 开发框架, 开源库, 搜索引擎爬虫, 渲染引擎, 游戏模组, 游戏覆盖层, 游戏辅助, 端点可见性, 网络流量审计, 通知系统