Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

13 Commits

Repository files navigation

lobstr

Cross platform minimal and fast hooking library with useful extensions

Dependencies

This project depends on capstone. Make sure you have correctly installed it and that the required header and library are available for your compiler.

Building

  1. Get the source
    • git clone https://github.com/ptrstr/lobstr
  2. Configure project
    • cd lobstr/build
    • cmake ..
  3. Build
    • Linux

      • make

      • sudo make install

        Use this option to install the library

    • Windows

      You will need to build the dll with Visual Studio with the provided .sln file

Using

This project was made to be as easy as possible to use. Here is an example:

#include<lobstr/lobstr.h>#include<stdio.h>voidintegerPrinter(intvalue) {
printf("Your modified? integer: %d\n", value);
}
void (*originalIntegerPrinter)(int);
voidhookedIntegerPrinter(intvalue) {
printf("Custom printing integer: ~~%d~~\n", value);
// Modfication of `value` and callbackvalue=1337;
originalIntegerPrinter(value);
}
intmain(intargc, char*argv[]) {
originalIntegerPrinter=&integerPrinter;
// Returns NULL on errorhook_t*hook=allocHook((void*)hookedIntegerPrinter, (void**)&originalIntegerPrinter);
if (!hook)
return1;
integerPrinter(55);
freeHook(hook);
return0;
}

Output:

Custom printing integer: ~~55~~
Your modified? integer: 1337

About

Cross platform minimal and fast hooking library with useful extensions

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages