Add info for how to test client utilities

This commit is contained in:
pizzaboxer 2022-01-22 17:40:58 +00:00
parent 92ef38cd3c
commit f4553679c3
5 changed files with 42 additions and 12 deletions

View File

@ -3,11 +3,21 @@
#define MFC2010
#define ARBITERBUILD
// when ARBITERBUILD is defined, the following changes occur:
// DataModel->getJobId is hooked
// StandardOut->print is hooked
// Network::RakNetAddressToString is hooked
// -jobId arg becomes available
// HTTP requests and output messages are logged to a file
// RobloxApp (2010)
#ifdef MFC2010
#define CLASSLOCATION_CROBLOXAPP 0x00BFF898
#define CLASSLOCATION_CAPP 0x00405D20
#define CLASSPADDING_CROBLOXDOC__WORKSPACE 40
#define CLASSPADDING_DATAMODEL__JOBID 730
#define STRUCTOFFSET_DATAMODEL__JOBID 2912
#define ADDRESS_DATAMODEL__GETJOBID 0x005CACC0
@ -29,6 +39,8 @@
#define CLASSLOCATION_CROBLOXAPP 0x00CBA8A0
#define CLASSLOCATION_CAPP 0x00406D80
#define CLASSPADDING_CROBLOXDOC__WORKSPACE 45
#define STRUCTOFFSET_DATAMODEL__JOBID 2956
#define ADDRESS_DATAMODEL__GETJOBID 0x005E70C0

View File

@ -4,6 +4,14 @@
#include <oaidl.h>
/* struct DataModel
{
void* padding1[CLASSPADDING_DATAMODEL__JOBID];
std::string* jobId;
}; */
class DataModel;
#if defined(MFC2010) || defined(MFC2011)
class CWorkspace;
@ -15,15 +23,12 @@ const auto CWorkspace__ExecUrlScript = (HRESULT(__stdcall*)(CWorkspace * workspa
struct CRobloxDoc
{
void* padding1[40];
void* padding1[CLASSPADDING_CROBLOXDOC__WORKSPACE];
CWorkspace* workspace;
};
// padding1[4] = offset of 0x10
// padding1[40] = offset of 0xA0 (160)
// possible options
// padding1[46] = offset of 0xB8
// padding1[84] = offset of 0x150
// padding1[40] = offset of 0xA0
struct CApp;
// const auto CApp__CreateGame = (CWorkspace * (__thiscall*)(CApp * _this, void*, int, LPCWSTR))ADDRESS_CAPP__CREATEGAME;

View File

@ -74,7 +74,7 @@ void __fastcall Crypt__verifySignatureBase64_hook(HCRYPTPROV* _this, void*, char
}
#ifdef ARBITERBUILD
int __fastcall DataModel__getJobId_hook(char* _this, void*, int a2)
int __fastcall DataModel__getJobId_hook(DataModel* _this, void*, int a2)
{
// this only sets the job id when game.jobId is called by lua
// so the gameserver script must call game.jobId at the beginning for this to take effect
@ -87,8 +87,7 @@ int __fastcall DataModel__getJobId_hook(char* _this, void*, int a2)
jobIdPtr += 4;
#endif
std::string* jobIdValue = (std::string*)jobIdPtr;
jobIdValue->assign(jobId);
((std::string*)jobIdPtr)->assign(jobId);
setJobId = true;
}

View File

@ -2,14 +2,12 @@
#include "RobloxMFCClasses.h"
// #include <atlstr.h>
// Type Definitions //
typedef BOOL(__thiscall* Http__trustCheck_t)(const char* url);
typedef void(__thiscall* Crypt__verifySignatureBase64_t)(HCRYPTPROV* _this, char a2, int a3, int a4, int a5, int a6, int a7, int a8, char a9, int a10, int a11, int a12, int a13, int a14, int a15);
#ifdef ARBITERBUILD
typedef INT(__thiscall* DataModel__getJobId_t)(char* _this, int a2);
typedef INT(__thiscall* DataModel__getJobId_t)(DataModel* _this, int a2);
typedef void(__thiscall* StandardOut__print_t)(int _this, int type, std::string* message);
// typedef void(__thiscall* Network__RakNetAddressToString_t)(int raknetAddress, bool writePort, char portDelineator);
#endif
@ -39,7 +37,7 @@ extern CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam;
BOOL __fastcall Http__trustCheck_hook(const char* url);
void __fastcall Crypt__verifySignatureBase64_hook(HCRYPTPROV* _this, void*, char a2, int a3, int a4, int a5, int a6, int a7, int a8, char a9, int a10, int a11, int a12, int a13, int a14, int a15);
#ifdef ARBITERBUILD
INT __fastcall DataModel__getJobId_hook(char* _this, void*, int a2);
INT __fastcall DataModel__getJobId_hook(DataModel* _this, void*, int a2);
void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string* message);
// std::string __fastcall Network__RakNetAddressToString_hook(int raknetAddress, bool writePort, char portDelineator);
#endif

View File

@ -2,3 +2,19 @@
Manages DLLs for extending game client/server functionality
Based off [ndoesstuff/JoinScriptUrlImpl](https://github.com/ndoesstuff/JoinScriptUrlImpl) as per the MIT license
Test command line parameter reimplementation (2010/2011 only):
> RobloxApp.exe -a http://polygondev.pizzaboxer.xyz/login/negotiate.ashx -t 0 -j http://polygondev.pizzaboxer.xyz/game/visit.ashx
Test trust check:
> Insert a new brick with decal
> Try setting decal ID to http://tadah.rocks - Should succeed
> Try setting decal ID to http://tadah.rocks@example.com - Should fail
Test signature check:
> Run loadfile("rbxasset://signatureinvalid.txt")() - Should throw an exception
> Run loadfile("rbxasset://signatureoverflow.txt")() - Should throw an exception
Test output and jobId (Arbiter builds only):
> RobloxApp.exe -jobId ExampleJobId - Should open an output console
> Run print(game.jobId) - Should print "ExampleJobId" in the console