diff options
| author | boris <wzn@moneybot.cc> | 2018-12-20 21:38:04 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-12-20 21:38:04 +1300 |
| commit | a5acd4c9a3b24c9d5af3a8f504e5af053fa7fa09 (patch) | |
| tree | 27bc30d3f35e5daaaa15ee6de066119df8d352c7 /csgo-loader/csgo-client/Client.cpp | |
| parent | 77b52da44b263df4884be2f35f885d8edccbb6fa (diff) | |
yo is this loss
Diffstat (limited to 'csgo-loader/csgo-client/Client.cpp')
| -rw-r--r-- | csgo-loader/csgo-client/Client.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/csgo-loader/csgo-client/Client.cpp b/csgo-loader/csgo-client/Client.cpp index 077b14b..d2dbd7a 100644 --- a/csgo-loader/csgo-client/Client.cpp +++ b/csgo-loader/csgo-client/Client.cpp @@ -3,37 +3,42 @@ #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.
-int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow) {
+int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow)
+{
+ AllocConsole();
+ FILE *file;
+ freopen_s(&file, "CONOUT$", "w", stdout);
+
+ RemoteCode::RemoteProcess Process;
+
if(!Syscalls->Start())
ERROR_ASSERT("[000F:00001A00] Failed to initialize. Please contact an administrator.");
UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_WAITING;
- std::thread WindowThread([] {
+ std::thread WindowThread([]
+ {
if(!UserInterface->Start())
ERROR_ASSERT("[000F:00001B00] Failed to initialize. Please contact an administrator.");
UserInterface->RunUiFrame();
}); WindowThread.detach();
- // Allow the window to start, etc.
- Sleep(2000);
-
Networking::TCPClient Client;
if(!Client.Start(LOCAL_IP, SERVER_PORT))
ERROR_ASSERT("[000F:0002A000] Server did not accept the connection.");
UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_LOG_IN;
-
- while(UserInterface->m_Data.m_ExecutionState != UserExperience::EXECUTION_WAITING) {
+
+ 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);
@@ -42,10 +47,12 @@ int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow) { Client.SendBytes(RawLoginHeader);
ByteArray RawServerResponse = Client.ReceiveBytes();
- if(!Transaction.TranslateResponse(RawServerResponse)) {
+ if(!Transaction.TranslateResponse(RawServerResponse))
+ {
UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_ERROR;
}
- else {
+ else
+ {
UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_CHOOSE;
}
|
