diff options
| author | boris <wzn@moneybot.cc> | 2018-12-29 20:59:57 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-12-29 20:59:57 +1300 |
| commit | bdb6ac5f940008bcd836e3c5f0a708f4b8f04865 (patch) | |
| tree | 9d3ba5e0816dfd6295f8e38e1a865d061f1168e1 /csgo-loader/csgo-client/Client.cpp | |
| parent | 81a3987fc17f99d2092018ac266882f4533cc27e (diff) | |
protection shit
Diffstat (limited to 'csgo-loader/csgo-client/Client.cpp')
| -rw-r--r-- | csgo-loader/csgo-client/Client.cpp | 41 |
1 files changed, 25 insertions, 16 deletions
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<bool> 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); }
|
