dobby-hook 0.1.4

Facade crate for dobby inline-hook core and optional framework
Documentation

dobby-hook

crates.io docs.rs License

Facade crate for the dobby-hook-core inline-hook engine, with an optional higher-level framework.

This project is inspired by jmpews/Dobby (ideas, not code) and is not affiliated with it.

Install

Recommended (enable framework feature):

[dependencies]

dobby-hook = { version = "0.1.4", features = ["framework"] }

Core only:

[dependencies]

dobby-hook = "0.1.4"

What You Get

  • Default: re-exports/typed access to the low-level core (dobby-hook-core).
  • Feature framework: ergonomic utilities (StaticHook<T>, typed handles, symbol helpers, etc.).

Quick Start (Framework)

use dobby_hook::prelude::*;

static HOOK: StaticHook<fn(i32) -> i32> = StaticHook::new();

#[inline(never)]
fn target_add(x: i32) -> i32 {
    x + 1
}

#[inline(never)]
fn detour_add(x: i32) -> i32 {
    (HOOK.original())(x + 100) + 10
}

fn main() -> dobby_hook::Result<()> {
    unsafe { HOOK.install(target_add, detour_add)?; }
    let _ = target_add(1);
    unsafe { HOOK.uninstall()?; }
    Ok(())
}

Examples

The full set of runnable examples lives in the repository:

Project Overview

Safety

Inline hooking patches executable code at runtime. Misuse can crash the process or cause undefined behavior.