diff --git a/PolygonClientUtilities/Config.h b/PolygonClientUtilities/Config.h index 5e73e92..8f19a20 100644 --- a/PolygonClientUtilities/Config.h +++ b/PolygonClientUtilities/Config.h @@ -6,6 +6,7 @@ // RobloxApp (2010) #ifdef MFC2010 #define ADDRESS_STANDARDOUT__PRINT 0x0059F340 +#define ADDRESS_STANDARDOUT__PRINTF 0x0059F8B0 #define ADDRESS_NETWORK__RAKNETADDRESSTOSTRING 0x004FC1A0 #define ADDRESS_HTTP__TRUSTCHECK 0x005A2680 #define ADDRESS_CAPP__CREATEGAME 0x00405D20 diff --git a/PolygonClientUtilities/Debug/PolygonClientUtilities.ilk b/PolygonClientUtilities/Debug/PolygonClientUtilities.ilk index 652d90a..47f1b3a 100644 Binary files a/PolygonClientUtilities/Debug/PolygonClientUtilities.ilk and b/PolygonClientUtilities/Debug/PolygonClientUtilities.ilk differ diff --git a/PolygonClientUtilities/PolygonClientUtilities.vcxproj b/PolygonClientUtilities/PolygonClientUtilities.vcxproj index 8a47a15..8a75c4f 100644 --- a/PolygonClientUtilities/PolygonClientUtilities.vcxproj +++ b/PolygonClientUtilities/PolygonClientUtilities.vcxproj @@ -103,7 +103,8 @@ Level3 - true + + false true WIN32;NDEBUG;POLYGONCLIENTUTILITIES_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) diff --git a/PolygonClientUtilities/RobloxMFCHooks.cpp b/PolygonClientUtilities/RobloxMFCHooks.cpp index 0db30c5..1fed376 100644 --- a/PolygonClientUtilities/RobloxMFCHooks.cpp +++ b/PolygonClientUtilities/RobloxMFCHooks.cpp @@ -182,33 +182,49 @@ BOOL __fastcall Http__trustCheck_hook(const char* url) #ifdef ARBITERBUILD StandardOut__print_t StandardOut__print = (StandardOut__print_t)ADDRESS_STANDARDOUT__PRINT; -void __fastcall StandardOut__print_hook(void* _this, void*, int type, const std::string& message) +void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string& message) { - if (!Logger::handle) return; + StandardOut__print(_this, type, message); - switch (type) + // so there's a slight issue here + // when the dll is compiled as release, the message's location is sometimes offset by 8 bytes + // + // here's when it works properly: + // https://media.discordapp.net/attachments/377894067712950275/934077740192235520/x32dbg_U1Y4T8xnev.png + // the message pointer location of [EBP+0xC] (0x0019F8DC) and value (0x0019F8E0) have a valid string as seen on the stack + // + // and here's when it doesn't work properly: + // https://cdn.discordapp.com/attachments/377894067712950275/934080068110655568/unknown.png + // the pointer location of [EBP+0xC] (0x0019FD2C) just points to nothing (0x04A88C70) + // however the pointer location with an actual valid string is just 8 bytes ahead (0x0019FD34) + // wtf?? + +#ifndef NDEBUG + if (Logger::handle) { + switch (type) + { case 1: // RBX::MESSAGE_OUTPUT: - Logger::Log(LogType::Output, std::string("[MESSAGE_OUTPUT] ") + message); + // Logger::Log(LogType::Output, std::string("[MESSAGE_OUTPUT] ") + message); SetConsoleTextAttribute(Logger::handle, FOREGROUND_BLUE | FOREGROUND_INTENSITY); break; case 0: // RBX::MESSAGE_INFO: - Logger::Log(LogType::Output, std::string("[MESSAGE_INFO] ") + message); + // Logger::Log(LogType::Output, std::string("[MESSAGE_INFO] ") + message); SetConsoleTextAttribute(Logger::handle, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); break; case 2: // RBX::MESSAGE_WARNING: - Logger::Log(LogType::Output, std::string("[MESSAGE_WARNING] ") + message); + // Logger::Log(LogType::Output, std::string("[MESSAGE_WARNING] ") + message); SetConsoleTextAttribute(Logger::handle, FOREGROUND_RED | FOREGROUND_GREEN); break; case 3: // RBX::MESSAGE_ERROR: - Logger::Log(LogType::Output, std::string("[MESSAGE_ERROR] ") + message); + // Logger::Log(LogType::Output, std::string("[MESSAGE_ERROR] ") + message); SetConsoleTextAttribute(Logger::handle, FOREGROUND_RED | FOREGROUND_INTENSITY); break; + } + printf("%s\n", message.c_str()); + SetConsoleTextAttribute(Logger::handle, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); } - printf("%s\n", message.c_str()); - SetConsoleTextAttribute(Logger::handle, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); - - StandardOut__print(_this, type, message); +#endif } // Network__RakNetAddressToString_t Network__RakNetAddressToString = (Network__RakNetAddressToString_t)ADDRESS_NETWORK__RAKNETADDRESSTOSTRING; diff --git a/PolygonClientUtilities/RobloxMFCHooks.h b/PolygonClientUtilities/RobloxMFCHooks.h index 68d21f1..70a28da 100644 --- a/PolygonClientUtilities/RobloxMFCHooks.h +++ b/PolygonClientUtilities/RobloxMFCHooks.h @@ -20,10 +20,10 @@ extern Http__trustCheck_t Http__trustCheck; BOOL __fastcall Http__trustCheck_hook(const char* url); #ifdef ARBITERBUILD -typedef void(__thiscall* StandardOut__print_t)(void* _this, int type, const std::string& message); +typedef void(__thiscall* StandardOut__print_t)(int _this, int type, std::string& message); extern StandardOut__print_t StandardOut__print; -void __fastcall StandardOut__print_hook(void* _this, void*, int type, const std::string& message); +void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string& message); // typedef void(__thiscall* Network__RakNetAddressToString_t)(int raknetAddress, bool writePort, char portDelineator); // extern Network__RakNetAddressToString_t Network__RakNetAddressToString;