From a5acd4c9a3b24c9d5af3a8f504e5af053fa7fa09 Mon Sep 17 00:00:00 2001 From: boris Date: Thu, 20 Dec 2018 21:38:04 +1300 Subject: yo is this loss --- csgo-loader/csgo-client/Login/RemoteLogin.cpp | 34 +++++++++++++++------------ csgo-loader/csgo-client/Login/RemoteLogin.hpp | 23 +++++++++++------- 2 files changed, 33 insertions(+), 24 deletions(-) (limited to 'csgo-loader/csgo-client/Login') diff --git a/csgo-loader/csgo-client/Login/RemoteLogin.cpp b/csgo-loader/csgo-client/Login/RemoteLogin.cpp index 45f7953..2f82744 100644 --- a/csgo-loader/csgo-client/Login/RemoteLogin.cpp +++ b/csgo-loader/csgo-client/Login/RemoteLogin.cpp @@ -5,8 +5,10 @@ // NOTE: You must change this on the server as well. #define CURRENT_CLIENT_HEADER 0xDEADBEEF -namespace Login { - void RemoteLoginTransaction::Start(const char *Username, const char *Password) { +namespace Login +{ + void RemoteLoginTransaction::Start(const char *Username, const char *Password) + { // Initialise the header with the client header. m_Header.m_ClientHeader = CURRENT_CLIENT_HEADER; @@ -23,26 +25,30 @@ namespace Login { m_Header.m_IntegrityBit3 = 0; // The checksum bit, the server will check this first to detect possible tampering. - m_Header.m_IntegrityBit4 = m_Header.m_IntegrityBit1 - | m_Header.m_IntegrityBit2 - | m_Header.m_IntegrityBit3; + m_Header.m_IntegrityBit4 = m_Header.m_IntegrityBit1 + | m_Header.m_IntegrityBit2 + | m_Header.m_IntegrityBit3; } // TODO: Hardware ID check. - ByteArray RemoteLoginTransaction::DoWmiQuery(const char *Query) { + ByteArray RemoteLoginTransaction::DoWmiQuery(const char *Query) + { ByteArray Response{}; - + return Response; } - uint32_t RemoteLoginTransaction::GetHardwareId() { + uint32_t RemoteLoginTransaction::GetHardwareId() + { return 123456789; } - bool RemoteLoginTransaction::TranslateResponse(ByteArray &RawResponse) { + bool RemoteLoginTransaction::TranslateResponse(ByteArray &RawResponse) + { RemoteLoginResponse ServerResponse = *reinterpret_cast(&RawResponse[0]); - switch(ServerResponse) { + switch(ServerResponse) + { case RemoteLoginResponse::ACCESS_SPECIAL_USER: // Allow the user to load special access cheats. UserInterface->m_Data.m_SpecialAccess = true; @@ -52,21 +58,19 @@ namespace Login { INFO_ASSERT("[000A:%08x] Your client is outdated.\nPlease download the latest client at 'moneybot.cc'.", m_Header.m_HardwareId); break; case RemoteLoginResponse::INTEGRITY_FAILURE: - INFO_ASSERT("[000F:%08x] Failed to verify session.\nPlease contact an administrator.", m_Header.m_HardwareId); + UserInterface->m_Data.m_Error = UserExperience::ERROR_SHADOW_BAN; break; case RemoteLoginResponse::USER_BANNED: INFO_ASSERT("[000D:%08x] Your account is banned.\nPlease contact 'admin@moneybot.cc' for additional information.", m_Header.m_HardwareId); break; case RemoteLoginResponse::INVALID_HARDWARE: UserInterface->m_Data.m_Error = UserExperience::ERROR_INVALID_HWID; - //INFO_ASSERT("[000C:%08x] Hardware ID mismatch.\nPlease contact an administrator to request a hardware ID reset.", m_Header.m_HardwareId); break; case RemoteLoginResponse::INVALID_CREDENTIALS: - UserInterface->m_Data.m_Error = UserExperience::ERROR_SHADOW_BAN; - //INFO_ASSERT("[000C:%08x] Your credentials are invalid. Please check your spelling and try again.", m_Header.m_HardwareId ^ RemoteLoginResponse::INVALID_CREDENTIALS); + INFO_ASSERT("[000C:%08x] Your credentials are invalid. Please check your spelling and try again.", m_Header.m_HardwareId); break; case RemoteLoginResponse::NO_SUBSCRIPTION: - INFO_ASSERT("[000G:%08x] No active subscription found.", m_Header.m_HardwareId ^ RemoteLoginResponse::NO_SUBSCRIPTION); + INFO_ASSERT("[000G:%08x] No active subscription found.", m_Header.m_HardwareId); break; } diff --git a/csgo-loader/csgo-client/Login/RemoteLogin.hpp b/csgo-loader/csgo-client/Login/RemoteLogin.hpp index e543d27..31649c6 100644 --- a/csgo-loader/csgo-client/Login/RemoteLogin.hpp +++ b/csgo-loader/csgo-client/Login/RemoteLogin.hpp @@ -6,9 +6,11 @@ using ByteArray = std::vector; -namespace Login { +namespace Login +{ // Login header that is sent over to the server - struct RemoteLoginHeader { + struct RemoteLoginHeader + { // The first four bytes are encoded by the client. // This will carry the client version which can be checked. uint32_t m_ClientHeader; @@ -32,9 +34,10 @@ namespace Login { // Possible server responses // The hardware ID is encoded (XORed with the message ID) within the message for // shadow ban/forum ban purposes. :) - enum RemoteLoginResponse : uint8_t { - OUTDATED_CLIENT = 'A', // '[000A:{HWID}] Your client is outdated. Please download the latest client at 'moneybot.cc'.' - ACCESS_AUTHORISED = 'B', // Allows the user to continue with injection. + enum RemoteLoginResponse : uint8_t + { + OUTDATED_CLIENT = 'A', // '[000A:{HWID}] Your client is outdated. Please download the latest client at 'moneybot.cc'.' + ACCESS_AUTHORISED = 'B', // Allows the user to continue with injection. INVALID_CREDENTIALS = 'C', // '[000C:{HWID}] Your credentials are invalid. Please check your spelling and try again.' USER_BANNED = 'D', // '[000D:{HWID}] Your account is banned. Please contact 'admin@moneybot.cc' for additional information.' INVALID_HARDWARE = 'E', // '[000E:{HWID}] Please contact an administrator to request a hardware ID reset.' @@ -44,9 +47,10 @@ namespace Login { }; // Runs the security checks and creates the login header to send to the server. - class RemoteLoginTransaction { + class RemoteLoginTransaction + { RemoteLoginHeader m_Header; - + public: // Initialises the header. void Start(const char *Username, const char *Password); @@ -62,9 +66,10 @@ namespace Login { // the response is not ACCESS_AUTHORISED. bool TranslateResponse(ByteArray &RawResponse); - ByteArray GetHeader() { + ByteArray GetHeader() + { ByteArray Header; - + // Copy header to the ByteArray. Header.insert( Header.begin(), -- cgit v1.2.3