a | b | |
---|
| 0 | + | #include "main.h" |
---|
| 0 | + | #include "detours.h" |
---|
| 0 | + | |
---|
| 0 | + | typedef void (WINAPI *ctFunc)(void); |
---|
| 0 | + | typedef char* (WINAPI *gtFunc)(void); |
---|
| 0 | + | typedef void (WINAPI *atFunc)(const char*, unsigned long, bool); |
---|
| 0 | + | typedef void* (WINAPI *ftFunc)(int); |
---|
| 0 | + | |
---|
| 0 | + | ctFunc clear_text = reinterpret_cast<ctFunc>(0x66023a70); |
---|
| 0 | + | gtFunc get_text = reinterpret_cast<gtFunc>(0x66023a10); |
---|
| 0 | + | atFunc append_text = reinterpret_cast<atFunc>(0x66028870); |
---|
| 0 | + | ftFunc find_edit = reinterpret_cast<ftFunc>(0x660231f0); |
---|
| 0 | + | |
---|
| 0 | + | void Mget_text(); |
---|
| 0 | + | char* Mclear_text(); |
---|
| 0 | + | void Mappend_text(const char*, unsigned long, bool); |
---|
| 0 | + | |
---|
| 0 | + | extern "C" BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) |
---|
| 0 | + | { |
---|
| 0 | + | switch (fdwReason) |
---|
| 0 | + | { |
---|
| 0 | + | case DLL_PROCESS_ATTACH: |
---|
| 0 | + | { |
---|
| 0 | + | |
---|
| 0 | + | // __asm("mov eax, 1"); |
---|
| 0 | + | |
---|
| 0 | + | //MessageBox(0, "Attached.", "msg", MB_OK | MB_ICONINFORMATION); |
---|
| 0 | + | |
---|
| 0 | + | DetourTransactionBegin(); |
---|
| 0 | + | DetourUpdateThread(GetCurrentThread()); |
---|
| 0 | + | DetourAttach(&(PVOID&)get_text, (PVOID) Mget_text); |
---|
| 0 | + | DetourAttach(&(PVOID&)clear_text, (PVOID) Mclear_text); |
---|
| 0 | + | DetourAttach(&(PVOID&)append_text, (PVOID) Mappend_text); |
---|
| 0 | + | DetourTransactionCommit(); |
---|
| 0 | + | |
---|
| 0 | + | } |
---|
| 0 | + | break; |
---|
| 0 | + | |
---|
| 0 | + | case DLL_PROCESS_DETACH: |
---|
| 0 | + | { |
---|
| 0 | + | DetourTransactionBegin(); |
---|
| 0 | + | DetourUpdateThread(GetCurrentThread()); |
---|
| 0 | + | DetourDetach(&(PVOID&)get_text, (PVOID) Mget_text); |
---|
| 0 | + | DetourDetach(&(PVOID&)clear_text, (PVOID) Mclear_text); |
---|
| 0 | + | DetourDetach(&(PVOID&)append_text, (PVOID) Mappend_text); |
---|
| 0 | + | DetourTransactionCommit(); |
---|
| 0 | + | |
---|
| 0 | + | } |
---|
| 0 | + | break; |
---|
| 0 | + | |
---|
| 0 | + | case DLL_THREAD_ATTACH: |
---|
| 0 | + | // attach to thread |
---|
| 0 | + | break; |
---|
| 0 | + | |
---|
| 0 | + | case DLL_THREAD_DETACH: |
---|
| 0 | + | // detach from thread |
---|
| 0 | + | break; |
---|
| 0 | + | } |
---|
| 0 | + | return TRUE; // successful |
---|
| 0 | + | } |
---|
| 0 | + | |
---|
| 0 | + | void Mget_text() |
---|
| 0 | + | { |
---|
| 0 | + | |
---|
| 0 | + | } |
---|
| 0 | + | |
---|
| 0 | + | char* Mclear_text() |
---|
| 0 | + | { |
---|
| 0 | + | |
---|
| 0 | + | } |
---|
| 0 | + | |
---|
| 0 | + | void Mappend_text(const char* txt, unsigned long color, bool unk) |
---|
| 0 | + | { |
---|
| 0 | + | |
---|
| 0 | + | } |
---|
| 0 | + | |
---|
| 0 | + | /* Errors: |
---|
| 0 | + | |
---|
| 0 | + | Z]+0x8)||undefined reference to `_SEH_prolog4'| |
---|
| 0 | + | Z]+0x72)||undefined reference to `_SEH_epilog4'| |
---|
| 0 | + | Z]+0x8)||undefined reference to `_SEH_prolog4'| |
---|
| 0 | + | Z]+0x5e)||undefined reference to `_SEH_epilog4'| |
---|
| 0 | + | 0]+0x56)||undefined reference to `??3@YAXPAX@Z'| |
---|
| 0 | + | 0]+0x83)||undefined reference to `??3@YAXPAX@Z'| |
---|
| 0 | + | 4]+0xf)||undefined reference to `__security_cookie'| |
---|
| 0 | + | 4]+0x1d2)||undefined reference to `??3@YAXPAX@Z'| |
---|
| 0 | + | 4]+0x1ff)||undefined reference to `??3@YAXPAX@Z'| |
---|
| 0 | + | 4]+0x236)||undefined reference to `@__security_check_cookie@4'| |
---|
| 0 | + | 4]+0x20)||undefined reference to `??2@YAPAXI@Z'| |
---|
| 0 | + | 4]+0x46)||undefined reference to `??3@YAXPAX@Z'| |
---|
| 0 | + | 20]+0xbc)||undefined reference to `??2@YAPAXI@Z'| |
---|
| 0 | + | 20]+0x1f0)||undefined reference to `??3@YAXPAX@Z'| |
---|
| 0 | + | 8]+0x56)||undefined reference to `??2@YAPAXI@Z'| |
---|
| 0 | + | 8]+0xed)||undefined reference to `??3@YAXPAX@Z'| |
---|
| 0 | + | 16]+0x7)||undefined reference to `__security_cookie'| |
---|
| 0 | + | 16]+0x39)||undefined reference to `@__security_check_cookie@4'| |
---|
| 0 | + | ||=== Build finished: 18 errors, 0 warnings ===| |
---|
| 0 | + | |
---|
| 0 | + | */ |
---|
... | |
---|