From 0c194bc8046cb3ecb4e4d0577f36a1d3bde58d11 Mon Sep 17 00:00:00 2001 From: boris Date: Thu, 27 Dec 2018 22:42:05 +1300 Subject: bap --- csgo-loader/csgo-client/Client.cpp | 91 +++++++++++--------------------------- 1 file changed, 27 insertions(+), 64 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 dc08da2..0f29f29 100644 --- a/csgo-loader/csgo-client/Client.cpp +++ b/csgo-loader/csgo-client/Client.cpp @@ -1,95 +1,58 @@ -#include -#include -#include -#include -#include -#include - -#define LOCAL_IP 0x0100007F // '127.0.0.1' -#define SERVER_IP 0xE53CA523 // Hexadecimal representation of the server IP, obtained by inet_addr() -#define SERVER_PORT 0xF2C // Hexadecimal representation of the server port. - -// hey nave just wanna let u know u r epic -// yea -#if 0 -void hhahahaha() -{ - std::thread WindowThread([] - { - if(!UserInterface->Start()) - ERROR_ASSERT("[000F:00001B00] Failed to initialize. Please contact an administrator."); - - UserInterface->RunUiFrame(); - }); WindowThread.detach(); - - UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_LOG_IN; - - while(UserInterface->m_Data.m_ExecutionState != UserExperience::EXECUTION_WAITING) - Sleep(1); - - Login::RemoteLoginTransaction Transaction; - Transaction.Start(UserInterface->m_Data.m_Username, UserInterface->m_Data.m_Password); - - ByteArray RawLoginHeader = Transaction.GetHeader(); - Client.SendBytes(RawLoginHeader); - - ByteArray RawServerResponse = Client.ReceiveBytes(); - if(!Transaction.TranslateResponse(RawServerResponse)) - { - UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_ERROR; - } - else - { - UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_CHOOSE; - } -} -#endif - -// is this loss/ -__forceinline void OpenConsole() -{ -#ifdef DEBUG - // ;ddDDDDdDDDd - AllocConsole(); - - // yo dude - // get this handles - FILE *file; - freopen_s(&file, "CONOUT$", "w", stdout); -#endif // DEBUG -} +#include int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow) { - OpenConsole(); + WRAP_IF_DEBUG(Utils::OpenConsole()); - Networking::TCPClient Client; + WRAP_IF_RELEASE(VM_DOLPHIN_BLACK_START); + WRAP_IF_RELEASE(STR_ENCRYPT_START); + + // 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."); - + + WRAP_IF_RELEASE(STR_ENCRYPT_END); + WRAP_IF_RELEASE(VM_DOLPHIN_BLACK_END); + // Wait for connection. UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_WAITING; // Create a thread to handle UI. std::thread WindowThread([] { + WRAP_IF_RELEASE(VM_SHARK_BLACK_START); + WRAP_IF_RELEASE(STR_ENCRYPT_START); + // Create a window, initialise DirectX context. if(!UserInterface->Start()) ERROR_ASSERT("[000F:00001B00] Failed to initialize. Please contact an administrator."); + WRAP_IF_RELEASE(STR_ENCRYPT_END); + WRAP_IF_RELEASE(VM_SHARK_BLACK_END); + // Create a loop to draw our UI. UserInterface->RunUiFrame(); }); WindowThread.detach(); + WRAP_IF_RELEASE(VM_EAGLE_BLACK_START); + // Attempt to connect to the remote server. + Networking::TCPClient Client; if(!Client.Start(LOCAL_IP, SERVER_PORT)) ERROR_ASSERT("[000F:0002A000] Server did not accept the connection."); + + WRAP_IF_RELEASE(VM_EAGLE_BLACK_END); + // Allow the user to input their log-in data. UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_LOG_IN; - // TODO: Add game selection. + 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); } } \ No newline at end of file -- cgit v1.2.3