Skip to content

Simple hooking library based on interrupt exceptions

License

Notifications You must be signed in to change notification settings

senko37/inthook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IntHook

Simple hooking library based on interrupt exceptions

Example

inthook/main.cpp

Lines 4 to 29 in 60e2d5b

typedef int (WINAPI* tMessageBoxA)(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType);
tMessageBoxA oMessageBoxA;
int WINAPI hMessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType) {
printf(":)");
return oMessageBoxA(hWnd, "hooked", lpCaption, MB_ICONWARNING | uType);
}
int main() {
if (!inthook::init())
return 1;
if (!inthook::create(MessageBoxA, &hMessageBoxA, reinterpret_cast<void*&>(oMessageBoxA)))
return 2;
MessageBoxA(0, "hello world", "hello world", MB_OK);
inthook::remove(MessageBoxA);
MessageBoxA(0, "hello world", "hello world", MB_OK);
inthook::uninit();
getchar();
return 0;
}

About

Simple hooking library based on interrupt exceptions

Topics

Resources

License

Stars

Watchers

Forks

Languages