A c++ header only library for inline hooking. Supports x86_64, x86, and arm. Small, simple, and easily detected :)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
_xeroxz b127702604
Update README.md
4 years ago
LICENSE Add LICENSE 5 years ago
README.md Update README.md 4 years ago
android.mk added shithook.hpp and demo 4 years ago
app.mk added shithook.hpp and demo 4 years ago
main.cpp added shithook.hpp and demo 4 years ago
shithook.hpp added shithook.hpp and demo 4 years ago

README.md

shithook

A c++ header only library for inline hooking. Supports x86_64, x86, and arm. Small, simple, and easily detected :)

usage

Installing the hook/Init.

__attribute__((noinline)) // very important that this is not inline!
FILE* hook_test(const char* filename, const char* open_type)
{
    std::printf("> filename = %s\n", filename);
    std::printf("> open type = %s\n", open_type);
    std::getchar();
    
    return hook::get_func(&fopen)(filename, open_type);
}

hook::make_hook(&fopen, &hook_test);

Disable Hook

hook::disable(&fopen);

Enable Hook

hook::enable(&fopen);