#hook #opengl #direct-x #im-gui #overlay #dear

hudhook

A graphics API hook with dear imgui render loop. Supports DirectX 9, 11, 12, and OpenGL 3.

18 unstable releases (7 breaking)

new 0.8.0 Nov 6, 2024
0.7.1 Jul 11, 2024
0.7.0 May 24, 2024
0.6.5 Mar 12, 2024
0.1.5 Sep 25, 2020

#88 in Graphics APIs

Download history 23/week @ 2024-07-14 19/week @ 2024-07-21 183/week @ 2024-07-28 27/week @ 2024-08-04 38/week @ 2024-08-11 78/week @ 2024-08-18 37/week @ 2024-08-25 3/week @ 2024-09-01 21/week @ 2024-09-08 27/week @ 2024-09-15 94/week @ 2024-09-22 10/week @ 2024-09-29 13/week @ 2024-10-06 55/week @ 2024-10-13 2/week @ 2024-10-20 5/week @ 2024-10-27

76 downloads per month

Custom license

285KB
6.5K SLoC

Rust 5K SLoC // 0.0% comments C 1.5K SLoC // 0.1% comments

hudhook

GitHub Actions Workflow Status GitHub Release Crates.io Version GitHub License Discord book rustdoc Patreon

A Rust renderer hook library for building Dear ImGui overlays.

Currently supports DirectX 9, DirectX 11, DirectX 12 and OpenGL 3. Runs on Windows and Wine/Proton.

hello

Resources

Supporting the project

If you like hudhook and would like to support the project, you can do so via my Patreon.

I'm glad the project works for you and I'm grateful for your support. Thank you!

Example

// 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();
}

Dependencies

~146MB
~2.5M SLoC