Work on prototype for creating new datamodel

this time using Game::Game instead of DataModel::createDataModel
This commit is contained in:
pizzaboxer 2022-06-01 10:16:36 +01:00
parent b06920dc93
commit 9885235a4b
12 changed files with 75 additions and 54 deletions

View File

@ -3,21 +3,30 @@
#include "Config.h"
#include <oaidl.h>
struct Game
{
void* padding1[26]; // 2010 has a class size of 104
};
const auto Game__initializeConstruct = (void * (__thiscall*)(void* _this, int a2))0x455D40;
struct DataModel
{
void* padding1[CLASSPADDING_DATAMODEL__JOBID];
void* padding1[CLASSPADDING_DATAMODEL__JOBID + PADDING_STRUCT];
std::string jobId;
};
struct Http
{
#if PADDING_STRUCT != 0
void* padding1[1];
#endif
std::string alternateUrl;
void* padding2[4];
void* padding2[3 + PADDING_STRUCT];
std::string url;
};
// const auto DataModel__createDataModel = (void * (__thiscall*)(int a1, char a2))ADDRESS_DATAMODEL__CREATEDATAMODEL;
// const auto DataModel__createDataModel = (std::shared_ptr<void>(__thiscall*)(bool startHeartbeat))ADDRESS_DATAMODEL__CREATEDATAMODEL;
struct Packet
{

View File

@ -19,7 +19,7 @@
// RobloxApp (2010)
#ifdef MFC2010
#define CLASSPADDING_DATAMODEL__JOBID 729 // when compiled as debug, this must be 728
#define CLASSPADDING_DATAMODEL__JOBID 728
#define ADDRESS_DATAMODEL__GETJOBID 0x005CACC0
#define ADDRESS_STANDARDOUT__PRINT 0x0059F340
@ -60,7 +60,7 @@
// RobloxApp (2011)
#ifdef MFC2011
#define CLASSPADDING_DATAMODEL__JOBID 740 // when compiled as debug, this must be 739
#define CLASSPADDING_DATAMODEL__JOBID 739
#define ADDRESS_DATAMODEL__GETJOBID 0x005E70C0
#define ADDRESS_DATAMODEL__DESTRUCT 0x006002A0
@ -135,7 +135,7 @@
#define ADDRESS_CROBLOXCOMMANDLINEINFO__PARSEPARAM 0x0
#define ADDRESS_CCOMMANDLINEINFO__PARSELAST 0x0
#define CLASSPADDING_DATAMODEL__JOBID 763 // when compiled as debug, this must be 762
#define CLASSPADDING_DATAMODEL__JOBID 762
#define ADDRESS_DATAMODEL__GETJOBID Patches::GetAddressByOffset(0x002079A0)
#define ADDRESS_STANDARDOUT__PRINT Patches::GetAddressByOffset(0x0023A8C0)
@ -157,4 +157,10 @@
#define RR_STOP_PROCESSING_AND_DEALLOCATE 0
#define RR_CONTINUE_PROCESSING 1
#define RR_STOP_PROCESSING 2
#define RR_STOP_PROCESSING 2
#ifdef NDEBUG
#define PADDING_STRUCT 1
#else
#define PADDING_STRUCT 0
#endif

View File

@ -1,22 +0,0 @@
#include "pch.h"
#include "DebugDatamodel.h"
DataModel__createDataModel_t DataModel__createDataModel = (DataModel__createDataModel_t)0; // ADDRESS_DATAMODEL__CREATEDATAMODEL;
int __fastcall DataModel__createDataModel_hook(int, int, int, bool startHeartbeat)
{
printf("DataModel::createDataModel called\n");
printf("Value of startHeartbeat: %#010x\n", startHeartbeat);
return DataModel__createDataModel(startHeartbeat);
}
/* DataModel__createDataModel_t DataModel__createDataModel = (DataModel__createDataModel_t)ADDRESS_GAME__CONSTRUCT;
int __fastcall DataModel__createDataModel_hook(int _this)
{
printf("Game::Game called\n");
printf("Value of _this: %#010X\n", _this);
return DataModel__createDataModel(_this);
} */

View File

@ -1,12 +0,0 @@
#pragma once
#include "Classes.h"
typedef int (__thiscall* DataModel__createDataModel_t)(bool startHeartbeat);
int __fastcall DataModel__createDataModel_hook(int, int, int, bool startHeartbeat);
extern DataModel__createDataModel_t DataModel__createDataModel;
// Game::Game
/* typedef int(__thiscall* DataModel__createDataModel_t)(int _this);
int __fastcall DataModel__createDataModel_hook(int _this);
extern DataModel__createDataModel_t DataModel__createDataModel; */

View File

@ -0,0 +1,11 @@
#include "pch.h"
#include "DebugGame.h"
Game__construct_t Game__construct = (Game__construct_t)0x47DBF0;
int __fastcall Game__construct_hook(Game* _this)
{
printf("Game::Game called\n");
printf("Value of _this: %p\n", _this);
return Game__construct(_this);
}

View File

@ -0,0 +1,7 @@
#pragma once
#include "Classes.h"
typedef int (__thiscall* Game__construct_t)(Game* _this);
int __fastcall Game__construct_hook(Game* _this);
extern Game__construct_t Game__construct;

View File

@ -72,9 +72,11 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<EnableManagedIncrementalBuild>true</EnableManagedIncrementalBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<EnableManagedIncrementalBuild>true</EnableManagedIncrementalBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
@ -162,6 +164,7 @@
<ItemGroup>
<ClInclude Include="Config.h" />
<ClInclude Include="DebugDatamodel.h" />
<ClInclude Include="DebugGame.h" />
<ClInclude Include="MFCCommandLine.h" />
<ClInclude Include="PlayerCommandLine.h" />
<ClInclude Include="RCCOutput.h" />
@ -178,6 +181,7 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="DebugDatamodel.cpp" />
<ClCompile Include="DebugGame.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="MFCCommandLine.cpp" />
<ClCompile Include="LUrlParser.cpp">

View File

@ -66,6 +66,9 @@
<ClInclude Include="TestHttpGetPost.h">
<Filter>Header Files\Hooks</Filter>
</ClInclude>
<ClInclude Include="DebugGame.h">
<Filter>Header Files\Hooks</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
@ -110,5 +113,8 @@
<ClCompile Include="TestHttpGetPost.cpp">
<Filter>Source Files\Hooks</Filter>
</ClCompile>
<ClCompile Include="DebugGame.cpp">
<Filter>Source Files\Hooks</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -1,5 +1,6 @@
#include "pch.h"
#include "RCCOutput.h"
#include "DebugGame.h"
#include "Patches.h"
HANDLE outputHandle;
@ -35,6 +36,25 @@ void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string*
message = reinterpret_cast<std::string*>(messagePtr);
#endif
/* if (message->compare("MakeDatamodel") == 0)
{
printf("Attempting to create DataModel...\n");
DataModel__createDataModel(true);
} */
if (message->compare("NewGame") == 0)
{
printf("Attempting to create new Game...\n");
int v2;
void* v3;
void* v4;
// v3 = operator new(104u);
v3 = new Game();
v4 = Game__initializeConstruct(v3, 0);
v2 = Game__construct_hook((Game*)v4);
}
switch (type)
{
case 1: // RBX::MESSAGE_OUTPUT:

View File

@ -25,9 +25,7 @@ void __fastcall Http_httpGetPostWinInet_hook(Http* _this, void*, bool isPost, in
printf("\n");
printf("Location of _this+40: %08X\n", (int)_this + 40);
printf("Location of _this->url: %p\n", &_this->url);
printf("\n"); */
printf("Location of _this->url: %p\n", &_this->url); */
printf("Requested url: %s\n", _this->url.c_str());
@ -41,17 +39,11 @@ void __fastcall Http_httpGetPostWinInet_hook(Http* _this, void*, bool isPost, in
std::string assetUrl = "https://assetdelivery.roblox.com/v1/asset/?" + parsedUrl.query_;
printf("Should swap URL with: %s\n", assetUrl.c_str());
// yep... same access violation i got in polygonutil.dll..........
// yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaayyyyyyyyyyyyyyyyyyyyyy
_this->url = assetUrl;
std::string test = assetUrl;
_this->url = test;
}
}
// printf("Host: %s\n", parsedUrl.host_.c_str());
// printf("Path: %s\n", parsedUrl.path_.c_str());
// printf("Query: %s\n", parsedUrl.query_.c_str());
// printf("Fragment: %s\n", parsedUrl.fragment_.c_str());
printf("\n");
Http_httpGetPostWinInet(_this, isPost, a3, compressData, additionalHeaders, a6);

View File

@ -3,7 +3,7 @@
#include "Patches.h"
//#include "RobloxMFCHooks.h"
// #include "DebugDatamodel.h"
#include "DebugGame.h"
// #include "TestHttpGetPost.h"
#include "TrustCheck.h"
#include "VerifySignatureBase64.h"
@ -25,8 +25,8 @@
#endif
START_PATCH_LIST()
ADD_PATCH(Game__construct, Game__construct_hook)
// ADD_PATCH(Http_httpGetPostWinInet, Http_httpGetPostWinInet_hook)
// ADD_PATCH(DataModel__createDataModel, DataModel__createDataModel_hook)
ADD_PATCH(Http__trustCheck, Http__trustCheck_hook)
ADD_PATCH(Crypt__verifySignatureBase64, Crypt__verifySignatureBase64_hook)