From bdb6ac5f940008bcd836e3c5f0a708f4b8f04865 Mon Sep 17 00:00:00 2001 From: boris Date: Sat, 29 Dec 2018 20:59:57 +1300 Subject: protection shit --- csgo-loader/csgo-client/Client.cpp | 41 +++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 16 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 38bc273..a7d27a7 100644 --- a/csgo-loader/csgo-client/Client.cpp +++ b/csgo-loader/csgo-client/Client.cpp @@ -39,28 +39,38 @@ int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow) { WRAP_IF_DEBUG(Utils::OpenConsole()); - // Initialize the runtime protection system. - if(!Protection->Start()) - ERROR_ASSERT("[000F:00001A00] Failed to initialize. Please contact an administrator."); - - // Initialize the syscall manager. - if(!Syscalls->Start()) - ERROR_ASSERT("[000F:00001A00] Failed to initialize. Please contact an administrator."); - - // Wait for connection. - UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_WAITING; + // Autistic workaround for Hooked_OpenProcess crashing + // when Device->CreateDevice is invoked... + std::atomic UserInterfaceReady = false; // Create a thread to handle UI. - std::thread WindowThread([] - { + std::thread WindowThread([&UserInterfaceReady] + { // Create a window, initialise DirectX context. if(!UserInterface->Start()) - ERROR_ASSERT("[000F:00001B00] Failed to initialize. Please contact an administrator."); + ERROR_ASSERT("[000F:00001C00] Failed to initialize. Please contact an administrator."); + + // Signal initialization. + UserInterfaceReady = true; - // Create a loop to draw our UI. UserInterface->RunUiFrame(); }); WindowThread.detach(); + while(!UserInterfaceReady) { Sleep(1); } + + // Initialize the runtime protection system. + WRAP_IF_RELEASE( + if(!Protection->Start()) + ERROR_ASSERT("[000F:00001A00] Failed to initialize. Please contact an administrator."); + ); + + // Initialize the syscall manager. + if(!Syscalls->Start()) + ERROR_ASSERT("[000F:00001B00] Failed to initialize. Please contact an administrator."); + + // Wait for connection. + UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_WAITING; + // Attempt to connect to the remote server. Networking::TCPClient Client; if(!Client.Start(LOCAL_IP, SERVER_PORT)) @@ -69,8 +79,7 @@ int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow) // Allow the user to input their log-in data. UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_LOG_IN; - while(UserInterface->m_Data.m_ExecutionState != UserExperience::EXECUTION_WAITING) - Sleep(1); + while(UserInterface->m_Data.m_ExecutionState != UserExperience::EXECUTION_WAITING) { Sleep(1); } // TODO: Add game selection. while(1) { if(GetAsyncKeyState(VK_END) & 0x8000) break; Sleep(1); } -- cgit v1.2.3