|
|
@ -3,13 +3,27 @@ |
|
|
|
#include <thread> |
|
|
|
#include <thread> |
|
|
|
#include "hooks.h" |
|
|
|
#include "hooks.h" |
|
|
|
|
|
|
|
|
|
|
|
int main() |
|
|
|
int runMain() |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cout << "hello" << std::endl; |
|
|
|
std::cout << "hello" << std::endl; |
|
|
|
std::cout << FindWindow("Chrome_WidgetWin_1", NULL) << std::endl; |
|
|
|
|
|
|
|
if (!hooks::setup()) |
|
|
|
if (!hooks::setup()) |
|
|
|
std::cout << "hooking returned false" << std::endl; |
|
|
|
std::cout << "hooking returned false" << std::endl; |
|
|
|
while (!GetAsyncKeyState(VK_F10)) |
|
|
|
while (!GetAsyncKeyState(VK_F10)) |
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(20)); |
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(20)); |
|
|
|
std::cout << "done" << std::endl; |
|
|
|
std::cout << "done" << std::endl; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOL APIENTRY DllMain(HMODULE handle, DWORD reason, LPVOID reserved) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
switch (reason) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case DLL_PROCESS_ATTACH: |
|
|
|
|
|
|
|
CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)runMain, handle, 0, nullptr)); |
|
|
|
|
|
|
|
case DLL_THREAD_ATTACH: |
|
|
|
|
|
|
|
case DLL_THREAD_DETACH: |
|
|
|
|
|
|
|
case DLL_PROCESS_DETACH: |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return TRUE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|