Registry / other / polyhook2

polyhook2

JSON →
library2025-06-21vcpkgunverified

A C++17, x86/x64 hooking library.

vcpkg install polyhook2
INSTALL
IMPORT
SIG · POLYHOOK2
P
polyhook2
othercppv2025-06-21
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

polyhook2/Detour/x64Detour.hpp
#include <polyhook2/Detour/x64Detour.hpp>

Hook a function and redirect it to a detour.

#include <polyhook2/Detour/x64Detour.hpp> #include <cstdio> int target() { return 42; } int detour() { return 0; } int main() { PLH::x64Detour detour((uint64_t)&target, (uint64_t)&detour); detour.hook(); printf("%d\n", target()); // prints 0 detour.unHook(); return 0; }
Debug
Known issues
gotchaOnly supports x86/x64 architectures; not portable to ARM.
fix
Use only on x86/x64 platforms.
affects: all
Upgrade
Version history
2025-06-21latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources

No resource links recorded.

polyhook2 — pip install polyhook2 · libregistry