summaryrefslogtreecommitdiff
path: root/csgo-loader/csgo-client/Client.cpp
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2018-12-27 22:42:05 +1300
committerboris <wzn@moneybot.cc>2018-12-27 22:42:05 +1300
commit0c194bc8046cb3ecb4e4d0577f36a1d3bde58d11 (patch)
treec27c5e71dba4db816cd9ad601a997b974377187e /csgo-loader/csgo-client/Client.cpp
parent45adf172a76fc46ca6ca10e17fd534d4f35896c0 (diff)
bap
Diffstat (limited to 'csgo-loader/csgo-client/Client.cpp')
-rw-r--r--csgo-loader/csgo-client/Client.cpp91
1 files changed, 27 insertions, 64 deletions
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 <Networking/TCPClient.hpp>
-#include <Login/RemoteLogin.hpp>
-#include <Security/SyscallManager.hpp>
-#include <Security/FnvHash.hpp>
-#include <UserExperience/UserInterface.hpp>
-#include <RemoteCode/RemoteProcess.hpp>
-
-#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 <Client.hpp>
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