Skip to content

C99/C++20 Header only library for dependency free function hooking in windows.

License

Notifications You must be signed in to change notification settings

0xvpr/vpr-deviate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vpr-deviate

Function Hooking/Detouring Header Only Library (Windows)

Installation

In root directory run the following (or just copy the header from vpr/)

curl -LSso- https://raw.githubusercontent.com/0xvpr/vpr-toolkit/main/vpr-toolkit | python3 - -p ./include -ivpr-deviate

Example Usage

#include <vpr/deviate.h>
#include <stdio.h>

void 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); // 25

    return 0;
}

Compilation

Use GCC or Clang. MSVC won't accept the inline assembly for x64.