ib-hook 0.2.2

Windows binary and system hooking library.
Documentation
[package]

name = "ib-hook"

version = "0.2.2"

edition = "2024"

rust-version = "1.94"

description = "Windows binary and system hooking library."

keywords = ["hooking", "detours", "process", "inject", "shell"]

repository.workspace = true

license.workspace = true



[features]

default = ["std"]



## `std` dependency.

std = [

    "thiserror/std",

    "serde?/std",

    # "nt-time/std",

]



## Inline hooking.

inline = ["dep:slim-detours-sys"]



## `sysinfo` dependency for some extra process utilities.

sysinfo = ["dep:sysinfo"]



## The injection part of DLL injection.

inject-dll = [

    "std",

    "dep:dll-syringe",

    "serde",

]

## The DLL part of DLL injection.

inject-dll-dll = [

    "dep:dtor",

    "dep:dll-syringe",

    "serde",

]



## `serde` support.

serde = ["dep:serde"]



## Logging via `tracing`, mainly for debugging.

tracing = ["dep:tracing"]



doc = ["dep:document-features"]



[dependencies]

bon = "3"

derive_more = { version = "2", features = ["deref", "deref_mut", "display", "from"] }

dll-syringe = { version = "0.17", optional = true, features = ["payload-utils", "rpc-core"] }

document-features = { version = "0.2", optional = true }

dtor = { version = "0.1", optional = true }

# nt-time = { version = "0.15", optional = true, default-features = false }

serde = { version = "1", optional = true, default-features = false, features = ["derive"] }

sysinfo = { version = ">=0.34,<0.39", optional = true, default-features = false, features = ["system"] }

thiserror = { version = "2", default-features = false }

tracing = { version = "0.1", optional = true }



[target.'cfg(target_family = "windows")'.dependencies]

slim-detours-sys = { version = "0.4", optional = true }

windows = { version = "0.62", features = [

    # "Win32_Graphics_Gdi",

    "Win32_System_LibraryLoader",

    "Win32_System_Threading",

    "Win32_UI_Controls",

    "Win32_UI_WindowsAndMessaging",

] }



[dev-dependencies]

ib-hook = { path = ".", features = [

    "inline",

    "sysinfo",

    "inject-dll",

    "inject-dll-dll",

    "tracing",

] }

test-log = { version = "0.2", default-features = false, features = ["trace", "unstable"] }



[[example]]

name = "app-dll"

required-features = ["inject-dll", "inject-dll-dll"]

crate-type = ["cdylib"]



[[example]]

name = "app-dll-unapply"

required-features = ["inject-dll", "inject-dll-dll"]

crate-type = ["cdylib"]



[[bin]]

name = "inject-app-dll"

required-features = ["inject-dll"]



[package.metadata.docs.rs]

targets = ["x86_64-pc-windows-msvc"]

all-features = true

# To test this locally, run:

# ```

# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features

# $env:RUSTDOCFLAGS="--cfg docsrs"; cargo +nightly doc --all-features

# ```

rustdoc-args = ["--cfg", "docsrs"]