MinHook is a minimalistic x86/x64 API hooking library for Windows.
The library addresses the need to intercept and redirect Windows API calls at runtime. It works by patching target functions with jump instructions that redirect execution to user-defined hook functions, then allow the original function to be called through a trampoline. The approach handles the complexity of instruction displacement and thread safety by suspending all threads during hook installation and removal, and provides helper functions to batch multiple hook operations efficiently.
Developers should choose MinHook for projects requiring lightweight API interception without external dependencies. It suits applications that need to monitor or modify system behavior at the API level, such as debugging tools, security software, or compatibility layers. The library is written in plain C to minimize footprint and memory usage, making it suitable for resource-constrained environments. It supports both Visual Studio and MinGW toolchains, and can be built with CMake.
The project maintains active development with recent improvements to error handling for thread enumeration and suspension, alongside expanded compiler support including Visual Studio 2022 and Clang.