From a9d8fa6e4755e2ea2a52af74b829de51796cfb78 Mon Sep 17 00:00:00 2001 From: pizzaboxer <41478239+pizzaboxer@users.noreply.github.com> Date: Fri, 28 Jan 2022 13:51:53 +0000 Subject: [PATCH] Revert "Isolate MFC hooks from studio builds" This reverts commit b749d5d382d70851444a46486797adf3f7396767. --- PolygonClientUtilities/Config.h | 5 ++--- PolygonClientUtilities/RobloxMFCClasses.h | 2 +- PolygonClientUtilities/RobloxMFCHooks.cpp | 4 ++-- PolygonClientUtilities/RobloxMFCHooks.h | 6 +++--- PolygonClientUtilities/dllmain.cpp | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/PolygonClientUtilities/Config.h b/PolygonClientUtilities/Config.h index 6cfaf2e..c19b1c3 100644 --- a/PolygonClientUtilities/Config.h +++ b/PolygonClientUtilities/Config.h @@ -1,8 +1,7 @@ #pragma once -#define MFC2011 -#define PLAYERBUILD -// #define ARBITERBUILD +#define MFC2010 +#define ARBITERBUILD // when ARBITERBUILD is defined, the following changes occur: // DataModel->getJobId is hooked diff --git a/PolygonClientUtilities/RobloxMFCClasses.h b/PolygonClientUtilities/RobloxMFCClasses.h index 5a25a01..207ee13 100644 --- a/PolygonClientUtilities/RobloxMFCClasses.h +++ b/PolygonClientUtilities/RobloxMFCClasses.h @@ -12,7 +12,7 @@ struct DataModel }; #endif -#if (defined(MFC2010) || defined(MFC2011)) && (defined(PLAYERBUILD) || defined(ARBITERBUILD)) +#if defined(MFC2010) || defined(MFC2011) // 2010 struct definitions: // 0x47E010: CWorkspace->DoExecScript() // 0x47EC10: CWorkspace->ExecUrlScript() diff --git a/PolygonClientUtilities/RobloxMFCHooks.cpp b/PolygonClientUtilities/RobloxMFCHooks.cpp index 785a15b..57f891d 100644 --- a/PolygonClientUtilities/RobloxMFCHooks.cpp +++ b/PolygonClientUtilities/RobloxMFCHooks.cpp @@ -29,7 +29,7 @@ StandardOut__print_t StandardOut__print = (StandardOut__print_t)ADDRESS_STANDARD Application__ParseArguments_t Application__ParseArguments = (Application__ParseArguments_t)ADDRESS_APPLICATION__PARSEARGUMENTS; #endif #endif -#if (defined(MFC2010) || defined(MFC2011)) && (defined(PLAYERBUILD) || defined(ARBITERBUILD)) +#if defined(MFC2010) || defined(MFC2011) // CApp__CreateGame_t CApp__CreateGame = (CApp__CreateGame_t)ADDRESS_CAPP__CREATEGAME; CRobloxApp__InitInstance_t CRobloxApp__InitInstance = (CRobloxApp__InitInstance_t)ADDRESS_CROBLOXAPP__INITINSTANCE; CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam = (CRobloxCommandLineInfo__ParseParam_t)ADDRESS_CROBLOXCOMMANDLINEINFO__PARSEPARAM; @@ -162,7 +162,7 @@ BOOL __fastcall Application__ParseArguments_hook(int _this, void*, int a2, const #endif #endif -#if (defined(MFC2010) || defined(MFC2011)) && (defined(PLAYERBUILD) || defined(ARBITERBUILD)) +#if defined(MFC2010) || defined(MFC2011) /* INT __fastcall CApp__CreateGame_hook(CApp* _this, void*, int* a2, LPCWSTR a3) { printf("CApp::CreateGame called\n"); diff --git a/PolygonClientUtilities/RobloxMFCHooks.h b/PolygonClientUtilities/RobloxMFCHooks.h index 9876059..da5347c 100644 --- a/PolygonClientUtilities/RobloxMFCHooks.h +++ b/PolygonClientUtilities/RobloxMFCHooks.h @@ -14,7 +14,7 @@ typedef void(__thiscall* StandardOut__print_t)(int _this, int type, std::string* typedef BOOL(__thiscall* Application__ParseArguments_t)(int _this, int a2, const char* argv); #endif #endif -#if (defined(MFC2010) || defined(MFC2011)) && (defined(PLAYERBUILD) || defined(ARBITERBUILD)) +#if defined(MFC2010) || defined(MFC2011) // typedef INT(__thiscall* CApp__CreateGame_t)(CApp* _this, int *a2, LPCWSTR a3); typedef BOOL(__thiscall* CRobloxApp__InitInstance_t)(CRobloxApp* _this); typedef void(__thiscall* CRobloxCommandLineInfo__ParseParam_t)(CRobloxCommandLineInfo* _this, const char* pszParam, BOOL bFlag, BOOL bLast); @@ -32,7 +32,7 @@ extern StandardOut__print_t StandardOut__print; extern Application__ParseArguments_t Application__ParseArguments; #endif #endif -#if (defined(MFC2010) || defined(MFC2011)) && (defined(PLAYERBUILD) || defined(ARBITERBUILD)) +#if defined(MFC2010) || defined(MFC2011) // extern CApp__CreateGame_t CApp__CreateGame; extern CRobloxApp__InitInstance_t CRobloxApp__InitInstance; extern CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam; @@ -50,7 +50,7 @@ void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string* BOOL __fastcall Application__ParseArguments_hook(int _this, void*, int a2, const char* argv); #endif #endif -#if (defined(MFC2010) || defined(MFC2011)) && (defined(PLAYERBUILD) || defined(ARBITERBUILD)) +#if defined(MFC2010) || defined(MFC2011) // INT __fastcall CApp__CreateGame_hook(CApp* _this, void*, int *a2, LPCWSTR a3); BOOL __fastcall CRobloxApp__InitInstance_hook(CRobloxApp* _this); void __fastcall CRobloxCommandLineInfo__ParseParam_hook(CRobloxCommandLineInfo* _this, void*, const char* pszParam, BOOL bFlag, BOOL bLast); diff --git a/PolygonClientUtilities/dllmain.cpp b/PolygonClientUtilities/dllmain.cpp index 8bcd392..b8cee05 100644 --- a/PolygonClientUtilities/dllmain.cpp +++ b/PolygonClientUtilities/dllmain.cpp @@ -15,7 +15,7 @@ ADD_PATCH(StandardOut__print, StandardOut__print_hook) ADD_PATCH(Application__ParseArguments, Application__ParseArguments_hook) #endif #endif -#if (defined(MFC2010) || defined(MFC2011)) && (defined(PLAYERBUILD) || defined(ARBITERBUILD)) +#if defined(MFC2010) || defined(MFC2011) // ADD_PATCH(CApp__CreateGame, CApp__CreateGame_hook) ADD_PATCH(CRobloxApp__InitInstance, CRobloxApp__InitInstance_hook) ADD_PATCH(CRobloxCommandLineInfo__ParseParam, CRobloxCommandLineInfo__ParseParam_hook)