https://github.com/0xvpr/vpr-deviate
C99/C++20 Header only library for dependency free function hooking in windows.
https://github.com/0xvpr/vpr-deviate
cplusplus cpp cpp11 cpp17 cpp20 detour-hook function-hooking hacking-tool header-only hook library
Last synced: 3 months ago
JSON representation
C99/C++20 Header only library for dependency free function hooking in windows.
- Host: GitHub
- URL: https://github.com/0xvpr/vpr-deviate
- Owner: 0xvpr
- License: mit
- Created: 2024-03-28T23:24:23.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-11T01:06:47.000Z (about 1 year ago)
- Last Synced: 2025-01-02T17:50:05.647Z (5 months ago)
- Topics: cplusplus, cpp, cpp11, cpp17, cpp20, detour-hook, function-hooking, hacking-tool, header-only, hook, library
- Language: C++
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
vpr-deviate
## Function Hooking/Detouring Header Only Library (Windows)
### Installation
In root directory run the following (or just copy the header from vpr/)
```bash
curl -LSso- https://raw.githubusercontent.com/0xvpr/vpr-toolkit/main/vpr-toolkit | python3 - -p ./include -ivpr-deviate
```### Example Usage
```cpp
#include
#includevoid target(int x) {
fprintf(stdout, "%d\n", x);
}void func(int x) {
fprintf(stdout, "%d\n", x*x);
}int main() {
target(5); // 5
vpr_deviate_detour((void *)target, (void *)func, nullptr, 0);
target(5); // 25return 0;
}
```### Compilation
Use GCC or Clang. MSVC won't accept the inline assembly for x64.