Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
vic4key committed Nov 8, 2023
1 parent 7b7bb10 commit 758afb9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@ int main()

INLHookingManager::instance().hook(MessageBoxA, hkMessageBoxA);
INLHookingManager::instance().hook(MessageBoxW, hkMessageBoxW);
MessageBoxA(hwnd, "The first message.", "MessageBoxA", MB_OK); // text is replaced by "INL Hooked"
MessageBoxA(hwnd, "The first message.", "MessageBoxA", MB_OK); // text is replaced by "INL Hooked"
MessageBoxW(hwnd, L"The first message.", L"MessageBoxW", MB_OK); // text is replaced by "INL Hooked"

INLHookingManager::instance().unhook(MessageBoxA);
INLHookingManager::instance().unhook(MessageBoxW);
MessageBoxA(hwnd, "The second message.", "MessageBoxA", MB_OK);
MessageBoxA(hwnd, "The second message.", "MessageBoxA", MB_OK);
MessageBoxW(hwnd, L"The second message.", L"MessageBoxW", MB_OK);

// IAT Hooking

IATHookingManager::instance().hook(Entry_MessageBoxA, iat_hkMessageBoxA);
IATHookingManager::instance().hook(Entry_MessageBoxW, iat_hkMessageBoxW);
MessageBoxA(hwnd, "The first message.", "MessageBoxA", MB_OK); // text is replaced by "IAT Hooked"
MessageBoxA(hwnd, "The first message.", "MessageBoxA", MB_OK); // text is replaced by "IAT Hooked"
MessageBoxW(hwnd, L"The first message.", L"MessageBoxW", MB_OK); // text is replaced by "IAT Hooked"

IATHookingManager::instance().unhook(Entry_MessageBoxA);
IATHookingManager::instance().unhook(Entry_MessageBoxW);
MessageBoxA(hwnd, "The second message.", "MessageBoxA", MB_OK);
MessageBoxA(hwnd, "The second message.", "MessageBoxA", MB_OK);
MessageBoxW(hwnd, L"The second message.", L"MessageBoxW", MB_OK);

return 0;
Expand Down

0 comments on commit 758afb9

Please sign in to comment.