2011 trust check and preprocessor definitions

Set the address for 2011 trust check
Set preprocessor definitions for MFC-specific hooks
This commit is contained in:
pizzaboxer 2022-01-21 11:26:24 +00:00
parent f432851d98
commit e4224542e5
8 changed files with 36 additions and 15 deletions

View File

@ -6,6 +6,7 @@
// RobloxApp (2010)
#ifdef MFC2010
#define ADDRESS_STANDARDOUT__PRINT 0x0059F340
#define ADDRESS_NETWORK__RAKNETADDRESSTOSTRING 0x004FC1A0
#define ADDRESS_HTTP__TRUSTCHECK 0x005A2680
#define ADDRESS_CAPP__CREATEGAME 0x00405D20
#define ADDRESS_CAPP__ROBLOXAUTHENTICATE 0x00408060
@ -19,6 +20,7 @@
// RobloxApp (2011)
#ifdef MFC2011
#define ADDRESS_STANDARDOUT__PRINT 0x005B25E0
#define ADDRESS_HTTP__TRUSTCHECK 0x005B7050
#define ADDRESS_CAPP__CREATEGAME 0x0
#define ADDRESS_CAPP__ROBLOXAUTHENTICATE 0x0
#define ADDRESS_CROBLOXAPP__INITINSTANCE 0x004613C0

View File

@ -104,13 +104,15 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<IntrinsicFunctions>false</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;POLYGONCLIENTUTILITIES_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>$(SolutionDir)Detours\include</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -4,6 +4,7 @@
#include <oaidl.h>
#if defined(MFC2010) || defined(MFC2011)
class CWorkspace;
// 2010 struct definitions:
@ -40,4 +41,5 @@ struct CCommandLineInfo
class CRobloxCommandLineInfo : public CCommandLineInfo {};
const auto CCommandLineInfo__ParseLast = (void(__thiscall*)(CCommandLineInfo * _this, BOOL bLast))ADDRESS_CCOMMANDLINEINFO__PARSELAST;
const auto CCommandLineInfo__ParseLast = (void(__thiscall*)(CCommandLineInfo * _this, BOOL bLast))ADDRESS_CCOMMANDLINEINFO__PARSELAST;
#endif

View File

@ -3,6 +3,7 @@
#include "Logger.h"
#include "Config.h"
#include "LUrlParser.h"
static bool hasAuthUrlArg = false;
static bool hasAuthTicketArg = false;
static bool hasJoinArg = false;
@ -13,6 +14,7 @@ static std::wstring authenticationTicket;
static std::wstring joinScriptUrl;
static std::string jobId;
#if defined(MFC2010) || defined(MFC2011)
CRobloxApp__InitInstance_t CRobloxApp__InitInstance = (CRobloxApp__InitInstance_t)ADDRESS_CROBLOXAPP__INITINSTANCE;
BOOL __fastcall CRobloxApp__InitInstance_hook(CRobloxApp* _this)
@ -32,10 +34,6 @@ BOOL __fastcall CRobloxApp__InitInstance_hook(CRobloxApp* _this)
// TODO: use CApp__CreateGame instead
CRobloxDoc* document = CRobloxApp__CreateDocument(_this);
CWorkspace__ExecUrlScript(document->workspace, joinScriptUrl.c_str(), VARIANTARG(), VARIANTARG(), VARIANTARG(), VARIANTARG(), nullptr);
// CApp__CreateGame(NULL, L"", L"44340105256");
// CApp__RobloxAuthenticate(_this->app, L"http://polygondev.pizzaboxer.xyz/", L"test");
// CRobloxApp__CreateDocument(_this);
}
catch (std::runtime_error& exception)
{
@ -126,6 +124,7 @@ void __fastcall CRobloxCommandLineInfo__ParseParam_hook(CRobloxCommandLineInfo*
CRobloxCommandLineInfo__ParseParam(_this, pszParam, bFlag, bLast);
}
#endif
Http__trustCheck_t Http__trustCheck = (Http__trustCheck_t)ADDRESS_HTTP__TRUSTCHECK;
@ -185,6 +184,8 @@ StandardOut__print_t StandardOut__print = (StandardOut__print_t)ADDRESS_STANDARD
void __fastcall StandardOut__print_hook(void* _this, void*, int type, const std::string& message)
{
if (!Logger::handle) return;
switch (type)
{
case 1: // RBX::MESSAGE_OUTPUT:
@ -209,4 +210,12 @@ void __fastcall StandardOut__print_hook(void* _this, void*, int type, const std:
StandardOut__print(_this, type, message);
}
// Network__RakNetAddressToString_t Network__RakNetAddressToString = (Network__RakNetAddressToString_t)ADDRESS_NETWORK__RAKNETADDRESSTOSTRING;
// std::string __fastcall Network__RakNetAddressToString_hook(int raknetAddress, bool writePort, char portDelineator)
// {
// Network__RakNetAddressToString(raknetAddress, writePort, portDelineator);
// return std::string("hi");
// }
#endif

View File

@ -2,6 +2,7 @@
#include "RobloxMFCClasses.h"
#if defined(MFC2010) || defined(MFC2011)
typedef BOOL(__thiscall* CRobloxApp__InitInstance_t)(CRobloxApp* _this);
extern CRobloxApp__InitInstance_t CRobloxApp__InitInstance;
@ -11,6 +12,7 @@ typedef void(__thiscall* CRobloxCommandLineInfo__ParseParam_t)(CRobloxCommandLin
extern CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam;
void __fastcall CRobloxCommandLineInfo__ParseParam_hook(CRobloxCommandLineInfo* _this, void*, const char* pszParam, BOOL bFlag, BOOL bLast);
#endif
typedef void(__thiscall* Http__trustCheck_t)(const char* url);
extern Http__trustCheck_t Http__trustCheck;
@ -22,4 +24,9 @@ typedef void(__thiscall* StandardOut__print_t)(void* _this, int type, const std:
extern StandardOut__print_t StandardOut__print;
void __fastcall StandardOut__print_hook(void* _this, void*, int type, const std::string& message);
// typedef void(__thiscall* Network__RakNetAddressToString_t)(int raknetAddress, bool writePort, char portDelineator);
// extern Network__RakNetAddressToString_t Network__RakNetAddressToString;
// std::string __fastcall Network__RakNetAddressToString_hook(int raknetAddress, bool writePort, char portDelineator);
#endif

View File

@ -5,19 +5,18 @@
START_PATCH_LIST()
ADD_PATCH(Http__trustCheck, Http__trustCheck_hook)
#ifdef ADDRESS_CROBLOXAPP__INITINSTANCE
ADD_PATCH(CRobloxApp__InitInstance, CRobloxApp__InitInstance_hook)
#endif
#ifdef ADDRESS_CROBLOXCOMMANDLINEINFO__PARSEPARAM
ADD_PATCH(CRobloxCommandLineInfo__ParseParam, CRobloxCommandLineInfo__ParseParam_hook)
#endif
#ifdef ARBITERBUILD
ADD_PATCH(StandardOut__print, StandardOut__print_hook)
// ADD_PATCH(Network__RakNetAddressToString, Network__RakNetAddressToString_hook)
#endif
#if defined(MFC2010) || defined(MFC2011)
ADD_PATCH(CRobloxApp__InitInstance, CRobloxApp__InitInstance_hook)
ADD_PATCH(CRobloxCommandLineInfo__ParseParam, CRobloxCommandLineInfo__ParseParam_hook)
#endif
END_PATCH_LIST()
// DLLs for release will be attached with VMProtect, so this isn't necessary
// Arbiter will still use Stud_PE for ease in swapping DLLs
// DLLs for release will be loaded with VMProtect, so this isn't necessary
// Arbiter will still use Stud_PE for ease in swapping DLLs however
#ifdef ARBITERBUILD
void __declspec(dllexport) doNothing() {}
#endif

View File

@ -1,3 +1,3 @@
# PolygonDLLUtilities
Manages DLLs for extending game client/server functionality
Manages DLLs for extending game client/server functionality
Based off [ndoesstuff/JoinScriptUrlImpl](https://github.com/ndoesstuff/JoinScriptUrlImpl) as per the MIT license