From b9702fe8541e61f27f5c788dc72feaefe5abfc0d Mon Sep 17 00:00:00 2001 From: boris Date: Tue, 1 Jan 2019 14:35:30 +1300 Subject: eeeeeeeeeeeeeeek --- csgo-loader/csgo-client/Client.cpp | 40 ++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'csgo-loader/csgo-client/Client.cpp') diff --git a/csgo-loader/csgo-client/Client.cpp b/csgo-loader/csgo-client/Client.cpp index 8c90f66..c41856c 100644 --- a/csgo-loader/csgo-client/Client.cpp +++ b/csgo-loader/csgo-client/Client.cpp @@ -3,14 +3,10 @@ /* TODO: - Finish off security on client: - - Hook OpenProcess, ExitProcess, WSARecv, WSASend and check if function is OOB. [DONE] - - Use VM check that Nave gave me. - Run a thread to check for blacklisted drivers periodically (also blacklist VBox) - Run a thread to check if there is more than X threads running in the loader. - Add dump protection (closes csgo.exe if a handle is detected, probably explorer shellcode) - Add HWID generation - - Hook DbgBreakPoint and DbgUiRemoteBreakin (instead of bytepatching, some debuggers will check that) [DONE] - - Don't forget about the security callback; leave implementation up to Nave. [DONE] - Apply Themida macros inside important functions: - Apply mutation on Security hooks and main function. @@ -25,7 +21,9 @@ - This will probably be the easiest thing to do. - Finish off injection wrapper: - - Allocate a 4KB page for trampoline imports (4096/6) { E8 ? ? ? ? C3 } + - Allocate a 4KB page for trampoline imports (4096/6) { E9 ? ? ? ? C3 } + - Actually, allocate every memory page as a bunch of consecutive 4kb sections + - Trampoline for imports - Everything is already laid out, tbh. - Have the loader inject a .DLL :^) @@ -35,28 +33,31 @@ - Adapt the server to work with your backend. */ + +#pragma optimize("", off) + int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow) { WRAP_IF_DEBUG(Utils::OpenConsole()); - // Autistic workaround for Hooked_OpenProcess crashing - // when Device->CreateDevice is invoked... - std::atomic UserInterfaceReady = false; + /////////////////////////////////////////////////////////////// + + WRAP_IF_RELEASE(MUTATE_START); + WRAP_IF_RELEASE(STR_ENCRYPT_START); + + /////////////////////////////////////////////////////////////// // Create a thread to handle UI. - std::thread WindowThread([&UserInterfaceReady] + std::thread WindowThread([] { // Create a window, initialise DirectX context. if(!UserInterface->Start()) ERROR_ASSERT("[000F:00001C00] Failed to initialize. Please contact an administrator."); - - // Signal initialization. - UserInterfaceReady = true; - + UserInterface->RunUiFrame(); }); WindowThread.detach(); - while(!UserInterfaceReady) { Sleep(1); } + while(!UserInterface->m_Data.m_Ready) { Sleep(1); } // Initialize the runtime protection system. WRAP_IF_RELEASE( @@ -83,4 +84,13 @@ int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow) // TODO: Add game selection. while(1) { if(GetAsyncKeyState(VK_END) & 0x8000) break; Sleep(1); } -} \ No newline at end of file + + /////////////////////////////////////////////////////////////// + + WRAP_IF_RELEASE(STR_ENCRYPT_END); + WRAP_IF_RELEASE(MUTATE_END); + + /////////////////////////////////////////////////////////////// +} + +#pragma optimize("", on) \ No newline at end of file -- cgit v1.2.3