polishing up everything

This commit is contained in:
lightbulblighter 2022-06-07 01:47:49 -07:00
parent b5b253e69f
commit c1f38fc76a
No known key found for this signature in database
GPG Key ID: 0B2452F9DE0E2D01
21 changed files with 187 additions and 160 deletions

View File

@ -3,6 +3,8 @@
#include "Patches.h"
#include "Util.h"
#if defined(ARBITERBUILD) && defined(PLAYER2012)
Application__ParseArguments_t Application__ParseArguments = (Application__ParseArguments_t)ADDRESS_APPLICATION__PARSEARGUMENTS;
BOOL __fastcall Application__ParseArguments_hook(int _this, void*, int a2, const char* argv)
@ -25,4 +27,6 @@ BOOL __fastcall Application__ParseArguments_hook(int _this, void*, int a2, const
}
return Application__ParseArguments(_this, a2, argv);
}
}
#endif

View File

@ -1,7 +1,11 @@
#pragma once
#if defined(ARBITERBUILD) && defined(PLAYER2012)
#include "Classes.h"
typedef BOOL(__thiscall* Application__ParseArguments_t)(int _this, int a2, const char* argv);
BOOL __fastcall Application__ParseArguments_hook(int _this, void*, int a2, const char* argv);
extern Application__ParseArguments_t Application__ParseArguments;
extern Application__ParseArguments_t Application__ParseArguments;
#endif

View File

@ -1,6 +1,8 @@
#include "pch.h"
#include "CRoblox.h"
#if defined(MFC2010) || defined(MFC2011)
static bool hasAuthUrlArg = false;
static bool hasAuthTicketArg = false;
static bool hasJoinArg = false;
@ -115,4 +117,6 @@ void __fastcall CRobloxCommandLineInfo__ParseParam_hook(CRobloxCommandLineInfo*
#endif
CRobloxCommandLineInfo__ParseParam(_this, pszParam, bFlag, bLast);
}
}
#endif

View File

@ -2,6 +2,46 @@
#include "Classes.h"
#if defined(MFC2010) || defined(MFC2011)
// 2010 struct definitions:
// 0x47E010: CWorkspace->DoExecScript()
// 0x47EC10: CWorkspace->ExecUrlScript()
class CWorkspace;
const auto CWorkspace__ExecUrlScript = (HRESULT(__stdcall*)(CWorkspace * workspace, LPCWSTR, VARIANTARG, VARIANTARG, VARIANTARG, VARIANTARG, LPVOID))ADDRESS_CWORKSPACE__EXECURLSCRIPT;
struct CRobloxDoc
{
void* padding1[CLASSPADDING_CROBLOXDOC__WORKSPACE];
CWorkspace* workspace;
};
struct CApp;
// const auto CApp__CreateGame = (CWorkspace * (__thiscall*)(CApp * _this, int, LPCWSTR))ADDRESS_CAPP__CREATEGAME;
const auto CApp__RobloxAuthenticate = (void* (__thiscall*)(CApp * _this, LPVOID, LPCWSTR, LPCWSTR))ADDRESS_CAPP__ROBLOXAUTHENTICATE;
// 2010 struct definitions:
// 0x405D20: CRobloxApp->CreateDocument()
// 0x44F6F0: CRobloxApp->ExitInstance()
// 0x452900: CRobloxApp->InitInstance()
struct CRobloxApp;
const auto CRobloxApp__CreateDocument = (CRobloxDoc * (__thiscall*)(CRobloxApp * _this))ADDRESS_CROBLOXAPP__CREATEDOCUMENT;
struct CCommandLineInfo
{
void* padding1[3];
BOOL m_bRunAutomated;
};
class CRobloxCommandLineInfo : public CCommandLineInfo {};
const auto CCommandLineInfo__ParseLast = (void(__thiscall*)(CCommandLineInfo * _this, BOOL bLast))ADDRESS_CCOMMANDLINEINFO__PARSELAST;
typedef BOOL(__thiscall* CRobloxApp__InitInstance_t)(CRobloxApp* _this);
typedef void(__thiscall* CRobloxCommandLineInfo__ParseParam_t)(CRobloxCommandLineInfo* _this, const char* pszParam, BOOL bFlag, BOOL bLast);
@ -9,4 +49,6 @@ BOOL __fastcall CRobloxApp__InitInstance_hook(CRobloxApp* _this);
void __fastcall CRobloxCommandLineInfo__ParseParam_hook(CRobloxCommandLineInfo* _this, void*, const char* pszParam, BOOL bFlag, BOOL bLast);
extern CRobloxApp__InitInstance_t CRobloxApp__InitInstance;
extern CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam;
extern CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam;
#endif

View File

@ -3,14 +3,7 @@
#include "Config.h"
#include <oaidl.h>
// TODO: Split everything here into individual files
struct Tuple
{
void* padding1[4];
bool padding2;
bool padding3;
};
// TODO: These need a place
struct DataModel
{
@ -30,75 +23,6 @@ const auto Game__initializeClass = (Game * (__thiscall*)(Game* _this, int a2))0x
const auto Game__construct = (int(__thiscall*)(Game* _this))0x47DBF0;
const auto ServiceProvider__createScriptContext = (void * (__thiscall*)(void* _this))0x4282E0;
// const auto ScriptContext__execute = (void * (__thiscall*)(void* _this, void* a1, int identity, const char* script, const char* name, int arguments))0x617CF0;
const auto ScriptContext__execute = (void (__thiscall*)(void* _this, int identity, const char* script, const char* name))0x617C80;
const auto Context__isInRole = (bool (__cdecl*)(int identity, int permission))ADDRESS_CONTEXT__ISINROLE;
struct Http
{
#if PADDING_STRUCT != 0
void* padding1[1];
#endif
std::string alternateUrl;
void* padding2[3 + PADDING_STRUCT];
std::string url;
};
// const auto DataModel__createDataModel = (std::shared_ptr<void>(__thiscall*)(bool startHeartbeat))ADDRESS_DATAMODEL__CREATEDATAMODEL;
struct Packet
{
void* padding1[7];
unsigned int length;
void* padding2[1];
unsigned char* data;
};
struct ConcurrentRakPeer {};
struct RakPeerInterface {};
struct ServerReplicator
{
void* padding1[1869]; // offset of 0 -> 7476
bool padding2; // offset of 7476 -> 7477
bool isAuthenticated; // offset of 7477 -> 7478
};
// 2010 struct definitions:
// 0x47E010: CWorkspace->DoExecScript()
// 0x47EC10: CWorkspace->ExecUrlScript()
class CWorkspace;
const auto CWorkspace__ExecUrlScript = (HRESULT(__stdcall*)(CWorkspace * workspace, LPCWSTR, VARIANTARG, VARIANTARG, VARIANTARG, VARIANTARG, LPVOID))ADDRESS_CWORKSPACE__EXECURLSCRIPT;
struct CRobloxDoc
{
void* padding1[CLASSPADDING_CROBLOXDOC__WORKSPACE];
CWorkspace* workspace;
};
struct CApp;
// const auto CApp__CreateGame = (CWorkspace * (__thiscall*)(CApp * _this, int, LPCWSTR))ADDRESS_CAPP__CREATEGAME;
const auto CApp__RobloxAuthenticate = (void * (__thiscall*)(CApp * _this, LPVOID, LPCWSTR, LPCWSTR))ADDRESS_CAPP__ROBLOXAUTHENTICATE;
// 2010 struct definitions:
// 0x405D20: CRobloxApp->CreateDocument()
// 0x44F6F0: CRobloxApp->ExitInstance()
// 0x452900: CRobloxApp->InitInstance()
struct CRobloxApp;
const auto CRobloxApp__CreateDocument = (CRobloxDoc * (__thiscall*)(CRobloxApp * _this))ADDRESS_CROBLOXAPP__CREATEDOCUMENT;
struct CCommandLineInfo
{
void* padding1[3];
BOOL m_bRunAutomated;
};
class CRobloxCommandLineInfo : public CCommandLineInfo {};
const auto CCommandLineInfo__ParseLast = (void(__thiscall*)(CCommandLineInfo * _this, BOOL bLast))ADDRESS_CCOMMANDLINEINFO__PARSELAST;
// const auto DataModel__createDataModel = (std::shared_ptr<void>(__thiscall*)(bool startHeartbeat))ADDRESS_DATAMODEL__CREATEDATAMODEL;

View File

@ -23,14 +23,11 @@
#define CLASSPADDING_DATAMODEL__JOBID 728
// #define ADDRESS_DATAMODEL__GETJOBID 0x005CACC0
#define ADDRESS_STANDARDOUT__PRINT 0x0059F340
// #define ADDRESS_NETWORK__RAKNETADDRESSTOSTRING 0x004FC1A0
#define ADDRESS_CRYPT__VERIFYSIGNATUREBASE64 0x0079ECF0
#define ADDRESS_SERVERREPLICATOR__SENDTOP 0x00506910
#define ADDRESS_SERVERREPLICATOR__PROCESSPACKET 0x00507420
#define ADDRESS_SERVERREPLICATOR__PROCESSTICKET 0x0
// #define ADDRESS_DATAMODEL__CREATEDATAMODEL 0x005DC150
#define ADDRESS_GAME__CONSTRUCT 0x0047DBF0
#define ADDRESS_HTTP__HTTPGETPOSTWININET 0x006A9210
#define ADDRESS_HTTP__TRUSTCHECK 0x005A2680
@ -174,7 +171,7 @@
#define RR_CONTINUE_PROCESSING 1
#define RR_STOP_PROCESSING 2
#ifdef NDEBUG
#ifndef _DEBUG
#define PADDING_STRUCT 1
#else
#define PADDING_STRUCT 0

View File

@ -2,6 +2,8 @@
#include "Context.h"
#include "Util.h"
#ifdef _DEBUG
Context__requirePermission_t Context__requirePermission = (Context__requirePermission_t)ADDRESS_CONTEXT__REQUIREPERMISSION;
void __fastcall Context__requirePermission_hook(void* _this, void*, int permission, const char* operation)
@ -15,4 +17,6 @@ void __fastcall Context__requirePermission_hook(void* _this, void*, int permissi
else
throw std::runtime_error("The current identity (" + std::to_string(identity) + ") cannot perform the requested operation (requires " + std::to_string(permission) + ")");
}
}
}
#endif

View File

@ -2,6 +2,12 @@
#include "Classes.h"
#ifdef _DEBUG
const auto Context__isInRole = (bool(__cdecl*)(int identity, int permission))ADDRESS_CONTEXT__ISINROLE;
typedef void (__thiscall* Context__requirePermission_t)(void* _this, int permission, const char* operation);
void __fastcall Context__requirePermission_hook(void* _this, void*, int permission, const char* operation);
extern Context__requirePermission_t Context__requirePermission;
extern Context__requirePermission_t Context__requirePermission;
#endif

View File

@ -3,7 +3,6 @@
#include "Patches.h"
#include "Util.h"
Crypt::Crypt()
{
if (!CryptAcquireContext(&context, NULL, MS_ENH_RSA_AES_PROV, PROV_RSA_AES, CRYPT_VERIFYCONTEXT))
@ -21,9 +20,13 @@ Crypt::Crypt()
}
}
#ifdef _DEBUG
std::vector<BYTE> publicKey = Util::base64Decode(Util::publicKey);
BYTE* blob = new BYTE[publicKey.size()];
#else
std::vector<BYTE> publicKey = Util::publicKey;
#endif
BYTE* blob = new BYTE[publicKey.size()];
std::copy(publicKey.begin(), publicKey.end(), blob);
if (!CryptImportKey(context, blob, publicKey.size(), 0, 0, &key))
@ -127,6 +130,7 @@ void __fastcall Crypt__verifySignatureBase64_hook(HCRYPTPROV* _this, void*, int
// Verify signature
if (!Crypt().verifySignatureBase64(message, signatureBase64, CALG_SHA_256))
{
// backwards compatibility for sha1 signatures
if (!Crypt().verifySignatureBase64(message, signatureBase64, CALG_SHA1))
{
throw std::runtime_error("");

View File

@ -4,6 +4,16 @@
#include <curl/curl.h>
#include <rapidjson/document.h>
struct Http
{
#if PADDING_STRUCT != 0
void* padding1[1];
#endif
std::string alternateUrl;
void* padding2[3 + PADDING_STRUCT];
std::string url;
};
typedef void (__thiscall* Http__httpGetPostWinInet_t)(Http* _this, bool isPost, int a3, bool compressData, LPCSTR additionalHeaders, int a6);
typedef bool(__thiscall* Http__trustCheck_t)(const char* url);

View File

@ -10,7 +10,9 @@ LONG Patches::Apply()
DetourTransactionBegin();
for (Patch patch : patchList)
{
DetourAttach(&(PVOID&)*patch.first, patch.second);
}
return DetourTransactionCommit();
}

View File

@ -113,11 +113,10 @@
<ItemGroup>
<ClInclude Include="Config.h" />
<ClInclude Include="Context.h" />
<ClInclude Include="ScriptContext.h" />
<ClInclude Include="CRoblox.h" />
<ClInclude Include="Application.h" />
<ClInclude Include="StandardOut.h" />
<ClInclude Include="ReplicatorSecurity.h" />
<ClInclude Include="ServerReplicator.h" />
<ClInclude Include="Http.h" />
<ClInclude Include="Patches.h" />
<ClInclude Include="pch.h" />
@ -127,7 +126,6 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="Context.cpp" />
<ClCompile Include="ScriptContext.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="CRoblox.cpp" />
<ClCompile Include="Patches.cpp" />
@ -139,7 +137,7 @@
</ClCompile>
<ClCompile Include="Application.cpp" />
<ClCompile Include="StandardOut.cpp" />
<ClCompile Include="ReplicatorSecurity.cpp" />
<ClCompile Include="ServerReplicator.cpp" />
<ClCompile Include="Http.cpp" />
<ClCompile Include="Util.cpp" />
<ClCompile Include="Crypt.cpp" />

View File

@ -45,7 +45,7 @@
<ClInclude Include="Application.h">
<Filter>Header Files\Hooks</Filter>
</ClInclude>
<ClInclude Include="ReplicatorSecurity.h">
<ClInclude Include="ServerReplicator.h">
<Filter>Header Files\Hooks</Filter>
</ClInclude>
<ClInclude Include="StandardOut.h">
@ -54,9 +54,6 @@
<ClInclude Include="Http.h">
<Filter>Header Files\Hooks</Filter>
</ClInclude>
<ClInclude Include="ScriptContext.h">
<Filter>Header Files\Hooks</Filter>
</ClInclude>
<ClInclude Include="Context.h">
<Filter>Header Files\Hooks</Filter>
</ClInclude>
@ -83,7 +80,7 @@
<ClCompile Include="Application.cpp">
<Filter>Source Files\Hooks</Filter>
</ClCompile>
<ClCompile Include="ReplicatorSecurity.cpp">
<ClCompile Include="ServerReplicator.cpp">
<Filter>Source Files\Hooks</Filter>
</ClCompile>
<ClCompile Include="StandardOut.cpp">
@ -92,9 +89,6 @@
<ClCompile Include="Http.cpp">
<Filter>Source Files\Hooks</Filter>
</ClCompile>
<ClCompile Include="ScriptContext.cpp">
<Filter>Source Files\Hooks</Filter>
</ClCompile>
<ClCompile Include="Context.cpp">
<Filter>Source Files\Hooks</Filter>
</ClCompile>

View File

@ -1,9 +0,0 @@
#include "pch.h"
#include "ScriptContext.h"
// ScriptContext__execute_t ScriptContext__execute = (ScriptContext__execute_t)0x617CF0;
//
// void* __fastcall ScriptContext__execute_hook(void* _this, void*, void* a1, int identity, const char* script, const char* name, void* arguments)
// {
// return ScriptContext__execute(_this, a1, identity, script, name, arguments);
// }

View File

@ -1,7 +0,0 @@
#pragma once
#include "Classes.h"
// typedef void* (__thiscall* ScriptContext__execute_t)(void* _this, void* a1, int identity, const char* script, const char* name, void* arguments);
// void* __fastcall ScriptContext__execute_hook(void* _this, void*, void* a1, int identity, const char* script, const char* name, void* arguments);
// extern ScriptContext__execute_t ScriptContext__execute;

View File

@ -1,5 +1,7 @@
#include "pch.h"
#include "ReplicatorSecurity.h"
#include "ServerReplicator.h"
#if defined(ARBITERBUILD) && defined(MFC2011)
static std::map<ServerReplicator*, RakPeerInterface*> rakPeers;
@ -43,4 +45,6 @@ void __fastcall ServerReplicator__processTicket_hook(ServerReplicator* _this, vo
{
// printf("ServerReplicator::sendTop called: player is not authenticated\n");
}
}
}
#endif

View File

@ -2,6 +2,26 @@
#include "Classes.h"
#if defined(ARBITERBUILD) && defined(MFC2011)
struct Packet
{
void* padding1[7];
unsigned int length;
void* padding2[1];
unsigned char* data;
};
struct ConcurrentRakPeer {};
struct RakPeerInterface {};
struct ServerReplicator
{
void* padding1[1869]; // offset of 0 -> 7476
bool padding2; // offset of 7476 -> 7477
bool isAuthenticated; // offset of 7477 -> 7478
};
typedef void(__thiscall* ServerReplicator__sendTop_t)(ServerReplicator* _this, RakPeerInterface* peer);
typedef void(__thiscall* ServerReplicator__processTicket_t)(ServerReplicator* _this, Packet* packet);
@ -9,4 +29,6 @@ void __fastcall ServerReplicator__sendTop_hook(ServerReplicator* _this, void*, R
void __fastcall ServerReplicator__processTicket_hook(ServerReplicator* _this, void*, Packet* packet);
extern ServerReplicator__sendTop_t ServerReplicator__sendTop;
extern ServerReplicator__processTicket_t ServerReplicator__processTicket;
extern ServerReplicator__processTicket_t ServerReplicator__processTicket;
#endif

View File

@ -11,7 +11,7 @@ void InitializeOutput()
outputHandle = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
SetStdHandle(STD_OUTPUT_HANDLE, outputHandle);
#ifndef NDEBUG
#ifdef _DEBUG
printf("[[[ DLL COMPILED AS DEBUG ]]]\n");
#endif
@ -29,7 +29,7 @@ void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string*
{
StandardOut__print(_this, type, message);
#ifdef NDEBUG
#ifndef _DEBUG
// Message pointer is offset 4 bytes when the DLL is compiled as release
message = reinterpret_cast<std::string*>((int)message + 4);
#endif
@ -64,18 +64,18 @@ void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string*
switch (type)
{
case RBX__MESSAGE_OUTPUT:
SetConsoleTextAttribute(outputHandle, FOREGROUND_BLUE | FOREGROUND_INTENSITY);
break;
case RBX__MESSAGE_INFO:
SetConsoleTextAttribute(outputHandle, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
break;
case RBX__MESSAGE_WARNING:
SetConsoleTextAttribute(outputHandle, FOREGROUND_RED | FOREGROUND_GREEN);
break;
case RBX__MESSAGE_ERROR:
SetConsoleTextAttribute(outputHandle, FOREGROUND_RED | FOREGROUND_INTENSITY);
break;
case RBX__MESSAGE_OUTPUT:
SetConsoleTextAttribute(outputHandle, FOREGROUND_BLUE | FOREGROUND_INTENSITY);
break;
case RBX__MESSAGE_INFO:
SetConsoleTextAttribute(outputHandle, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
break;
case RBX__MESSAGE_WARNING:
SetConsoleTextAttribute(outputHandle, FOREGROUND_RED | FOREGROUND_GREEN);
break;
case RBX__MESSAGE_ERROR:
SetConsoleTextAttribute(outputHandle, FOREGROUND_RED | FOREGROUND_INTENSITY);
break;
}
printf("%s\n", message->c_str());

View File

@ -1,8 +1,35 @@
#include "pch.h"
#include "Util.h"
#include <string_view>
const std::string Util::publicKey = "BgIAAACkAABSU0ExAAQAAAEAAQABmKy9m0NxBRoXTuQPZU8BeMfwBisHcYBy93KSlQB3emeiW/pEMj9YWn2k7JkHiqcjuH+XE5PWK+q9s8oLQsnXTdTYa2l+1BhypP5jefgq0ZHITTIMBfE7rTI39ppzs0ayXKINQMIsBzXaJm25v5gP+vlz4cupJPq+jy9De+kcyw==";
// this is ifdef guarded so that the public key cannot easily be replaced
// the std::vector variant is the base64 blob decoded into its byte form (https://cryptii.com/pipes/base64-to-hex)
// for ease of development, the string is retained to easily swap keys
// currently the key is the Project Polygon key
#ifdef _DEBUG
const std::string Util::publicKey =
"BgIAAACkAABSU0ExAAQAAAEAAQABmKy9m0NxBRoXTuQPZU8BeM"
"fwBisHcYBy93KSlQB3emeiW/pEMj9YWn2k7JkHiqcjuH+XE5PW"
"K+q9s8oLQsnXTdTYa2l+1BhypP5jefgq0ZHITTIMBfE7rTI39p"
"pzs0ayXKINQMIsBzXaJm25v5gP+vlz4cupJPq+jy9De+kcyw==";
#else
const std::vector<BYTE> Util::publicKey = {
0x06, 0x02, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x52, 0x53, 0x41, 0x31, 0x00, 0x04, 0x00,
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x98, 0xac, 0xbd, 0x9b, 0x43, 0x71, 0x05, 0x1a, 0x17,
0x4e, 0xe4, 0x0f, 0x65, 0x4f, 0x01, 0x78, 0xc7, 0xf0, 0x06, 0x2b, 0x07, 0x71, 0x80, 0x72,
0xf7, 0x72, 0x92, 0x95, 0x00, 0x77, 0x7a, 0x67, 0xa2, 0x5b, 0xfa, 0x44, 0x32, 0x3f, 0x58,
0x5a, 0x7d, 0xa4, 0xec, 0x99, 0x07, 0x8a, 0xa7, 0x23, 0xb8, 0x7f, 0x97, 0x13, 0x93, 0xd6,
0x2b, 0xea, 0xbd, 0xb3, 0xca, 0x0b, 0x42, 0xc9, 0xd7, 0x4d, 0xd4, 0xd8, 0x6b, 0x69, 0x7e,
0xd4, 0x18, 0x72, 0xa4, 0xfe, 0x63, 0x79, 0xf8, 0x2a, 0xd1, 0x91, 0xc8, 0x4d, 0x32, 0x0c,
0x05, 0xf1, 0x3b, 0xad, 0x32, 0x37, 0xf6, 0x9a, 0x73, 0xb3, 0x46, 0xb2, 0x5c, 0xa2, 0x0d,
0x40, 0xc2, 0x2c, 0x07, 0x35, 0xda, 0x26, 0x6d, 0xb9, 0xbf, 0x98, 0x0f, 0xfa, 0xf9, 0x73,
0xe1, 0xcb, 0xa9, 0x24, 0xfa, 0xbe, 0x8f, 0x2f, 0x43, 0x7b, 0xe9, 0x1c, 0xcb
};
#endif
const std::vector<std::string> Util::allowedHosts
{

View File

@ -1,15 +1,19 @@
#pragma once
#include "pch.h"
#include <string_view>
class Util
{
public:
#ifdef _DEBUG
static const std::string publicKey;
#else
static const std::vector<BYTE> publicKey;
#endif
static const std::vector<std::string> allowedHosts;
static const std::vector<std::string> allowedSchemes;
static const std::vector<std::string> allowedEmbeddedSchemes;
static std::vector<std::string> split(std::string s, std::string delimiter);
static std::map<std::string, std::string> parseArgs(std::string args);
static bool isASCII(const std::string& s);
static std::string toLower(std::string s);

View File

@ -2,7 +2,6 @@
#include "Config.h"
#include "Patches.h"
#include "ScriptContext.h"
#include "Http.h"
#include "Crypt.h"
@ -10,27 +9,27 @@
#include "Context.h"
#endif
#ifdef ARBITERBUILD
#if defined(ARBITERBUILD)
#include "StandardOut.h"
#endif
#ifdef MFC2011
#if defined(ARBITERBUILD) && defined(MFC2011)
#include "ReplicatorSecurity.h"
#endif
#ifdef PLAYER2012
#if defined(ARBITERBUILD) && defined(PLAYER2012)
#include "Application.h"
#endif
#endif
#if defined(MFC2010) || defined(MFC2011)
#include "CRoblox.h"
#endif
START_PATCH_LIST()
// ADD_PATCH(ScriptContext__execute, ScriptContext__execute_hook)
ADD_PATCH(Http__httpGetPostWinInet, Http__httpGetPostWinInet_hook)
ADD_PATCH(Http__httpGetPostWinInet, Http__httpGetPostWinInet_hook)
ADD_PATCH(Http__trustCheck, Http__trustCheck_hook)
ADD_PATCH(Crypt__verifySignatureBase64, Crypt__verifySignatureBase64_hook)
#ifdef _DEBUG
@ -38,29 +37,23 @@ ADD_PATCH(Context__requirePermission, Context__requirePermission_hook)
#endif
#ifdef ARBITERBUILD
// ADD_PATCH(DataModel__getJobId, DataModel__getJobId_hook)
ADD_PATCH(StandardOut__print, StandardOut__print_hook)
// ADD_PATCH(Network__RakNetAddressToString, Network__RakNetAddressToString_hook)
#endif
#ifdef MFC2011
#if defined(ARBITERBUILD) && defined(MFC2011)
ADD_PATCH(ServerReplicator__sendTop, ServerReplicator__sendTop_hook)
ADD_PATCH(ServerReplicator__processTicket, ServerReplicator__processTicket_hook)
#endif
#ifdef PLAYER2012
#if defined(ARBITERBUILD) && defined(PLAYER2012)
ADD_PATCH(Application__ParseArguments, Application__ParseArguments_hook)
#endif
#endif
#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)
#endif
#ifdef DEBUG_SERVERREPLICATOR__PROCESSPACKET
// ADD_PATCH(ServerReplicator__processPacket, ServerReplicator__processPacket_hook)
#endif
END_PATCH_LIST()
// DLLs for release will be loaded with VMProtect, so this isn't necessary
@ -77,22 +70,22 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
InitializeOutput();
#endif
LONG error = Patches::Apply();
if (error != NO_ERROR)
LONG patchesError = Patches::Apply();
if (patchesError != NO_ERROR)
{
#ifdef _DEBUG
std::string message = "Patches::Apply returned " + std::to_string(error);
std::string message = "Patches::Apply returned " + std::to_string(patchesError);
MessageBoxA(nullptr, message.c_str(), nullptr, MB_ICONERROR);
#endif
ExitProcess(EXIT_FAILURE);
}
CURLcode error = curl_global_init(CURL_GLOBAL_DEFAULT);
if (error != CURLE_OK)
CURLcode curlError = curl_global_init(CURL_GLOBAL_DEFAULT);
if (curlError != CURLE_OK)
{
#ifdef _DEBUG
std::string message = "curl_global_init returned " + std::to_string(error);
std::string message = "curl_global_init returned " + std::to_string(curlError);
MessageBoxA(nullptr, message.c_str(), nullptr, MB_ICONERROR);
#endif