Remove debugging patches

This commit is contained in:
pizzaboxer 2022-01-22 16:16:48 +00:00
parent 0c8e1c786f
commit 92ef38cd3c
4 changed files with 5 additions and 44 deletions

View File

@ -11,7 +11,7 @@ class CWorkspace;
// 0x47E010: CWorkspace->DoExecScript()
// 0x47EC10: CWorkspace->ExecUrlScript()
// const auto CWorkspace__ExecUrlScript = (HRESULT(__stdcall*)(CWorkspace * workspace, LPCWSTR, VARIANTARG, VARIANTARG, VARIANTARG, VARIANTARG, LPVOID))ADDRESS_CWORKSPACE__EXECURLSCRIPT;
const auto CWorkspace__ExecUrlScript = (HRESULT(__stdcall*)(CWorkspace * workspace, LPCWSTR, VARIANTARG, VARIANTARG, VARIANTARG, VARIANTARG, LPVOID))ADDRESS_CWORKSPACE__EXECURLSCRIPT;
struct CRobloxDoc
{
@ -20,7 +20,7 @@ struct CRobloxDoc
};
// padding1[4] = offset of 0x10
// padding1[40] = offset of 0xA0
// padding1[40] = offset of 0xA0 (160)
// possible options
// padding1[46] = offset of 0xB8
// padding1[84] = offset of 0x150
@ -36,7 +36,7 @@ struct CRobloxApp;
// 0x44F6F0: CRobloxApp->ExitInstance()
// 0x452900: CRobloxApp->InitInstance()
// const auto CRobloxApp__CreateDocument = (CRobloxDoc * (__thiscall*)(CRobloxApp * _this))ADDRESS_CROBLOXAPP__CREATEDOCUMENT;
const auto CRobloxApp__CreateDocument = (CRobloxDoc * (__thiscall*)(CRobloxApp * _this))ADDRESS_CROBLOXAPP__CREATEDOCUMENT;
struct CCommandLineInfo
{

View File

@ -27,8 +27,6 @@ StandardOut__print_t StandardOut__print = (StandardOut__print_t)ADDRESS_STANDARD
#endif
#if defined(MFC2010) || defined(MFC2011)
// CApp__CreateGame_t CApp__CreateGame = (CApp__CreateGame_t)ADDRESS_CAPP__CREATEGAME;
CWorkspace__ExecUrlScript_t CWorkspace__ExecUrlScript = (CWorkspace__ExecUrlScript_t)ADDRESS_CWORKSPACE__EXECURLSCRIPT;
CRobloxApp__CreateDocument_t CRobloxApp__CreateDocument = (CRobloxApp__CreateDocument_t)ADDRESS_CROBLOXAPP__CREATEDOCUMENT;
CRobloxApp__InitInstance_t CRobloxApp__InitInstance = (CRobloxApp__InitInstance_t)ADDRESS_CROBLOXAPP__INITINSTANCE;
CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam = (CRobloxCommandLineInfo__ParseParam_t)ADDRESS_CROBLOXCOMMANDLINEINFO__PARSEPARAM;
#endif
@ -148,25 +146,6 @@ void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string*
return CApp__CreateGame(_this, a2, a3);
} */
void __fastcall CWorkspace__ExecUrlScript_hook(CWorkspace* workspace, void*, LPCWSTR url, VARIANTARG arg1, VARIANTARG arg2, VARIANTARG arg3, VARIANTARG arg4, LPVOID voidptr)
{
printf("CWorkspace::ExecUrlScript called\n");
CWorkspace__ExecUrlScript(workspace, url, arg1, arg2, arg3, arg4, voidptr);
printf("Pointer location of CWorkspace: %p\n", &workspace);
printf("Pointer value of CWorkspace: %p\n", workspace);
printf("\n");
}
CRobloxDoc* __fastcall CRobloxApp__CreateDocument_hook(CRobloxApp* _this)
{
printf("CRobloxApp::CreateDocument called\n");
CRobloxDoc* document = CRobloxApp__CreateDocument(_this);
printf("Pointer location of CRobloxDoc: %p\n", &document);
printf("Pointer value of CRobloxDoc: %p\n", document);
printf("\n");
return document;
}
BOOL __fastcall CRobloxApp__InitInstance_hook(CRobloxApp* _this)
{
if (!CRobloxApp__InitInstance(_this))
@ -184,18 +163,8 @@ BOOL __fastcall CRobloxApp__InitInstance_hook(CRobloxApp* _this)
try
{
// TODO: use CApp__CreateGame instead
CRobloxDoc* document = CRobloxApp__CreateDocument_hook(_this);
CWorkspace* workspace = document->workspace;
// CWorkspace__ExecUrlScript(document->workspace, joinScriptUrl.c_str(), VARIANTARG(), VARIANTARG(), VARIANTARG(), VARIANTARG(), nullptr);
CWorkspace__ExecUrlScript_hook(workspace, nullptr, joinScriptUrl.c_str(), VARIANTARG(), VARIANTARG(), VARIANTARG(), VARIANTARG(), nullptr);
printf("InitInstance - Pointer location of CRobloxDoc: %p\n", &document);
printf("InitInstance - Pointer value of CRobloxDoc: %p\n", document);
printf("\n");
printf("InitInstance - Pointer location of CWorkspace: %p\n", &workspace);
printf("InitInstance - Pointer value of CWorkspace: %p\n", workspace);
printf("\n");
CRobloxDoc* document = CRobloxApp__CreateDocument(_this);
CWorkspace__ExecUrlScript(document->workspace, joinScriptUrl.c_str(), VARIANTARG(), VARIANTARG(), VARIANTARG(), VARIANTARG(), nullptr);
}
catch (std::runtime_error& exception)
{

View File

@ -15,8 +15,6 @@ typedef void(__thiscall* StandardOut__print_t)(int _this, int type, std::string*
#endif
#if defined(MFC2010) || defined(MFC2011)
// typedef INT(__thiscall* CApp__CreateGame_t)(CApp* _this, int a2, LPCWSTR a3);
typedef void(__thiscall* CWorkspace__ExecUrlScript_t)(CWorkspace* workspace, LPCWSTR url, VARIANTARG arg1, VARIANTARG arg2, VARIANTARG arg3, VARIANTARG arg4, LPVOID voidptr);
typedef CRobloxDoc*(__thiscall* CRobloxApp__CreateDocument_t)(CRobloxApp* _this);
typedef BOOL(__thiscall* CRobloxApp__InitInstance_t)(CRobloxApp* _this);
typedef void(__thiscall* CRobloxCommandLineInfo__ParseParam_t)(CRobloxCommandLineInfo* _this, const char* pszParam, BOOL bFlag, BOOL bLast);
#endif
@ -32,8 +30,6 @@ extern StandardOut__print_t StandardOut__print;
#endif
#if defined(MFC2010) || defined(MFC2011)
// extern CApp__CreateGame_t CApp__CreateGame;
extern CWorkspace__ExecUrlScript_t CWorkspace__ExecUrlScript;
extern CRobloxApp__CreateDocument_t CRobloxApp__CreateDocument;
extern CRobloxApp__InitInstance_t CRobloxApp__InitInstance;
extern CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam;
#endif
@ -49,8 +45,6 @@ void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string*
#endif
#if defined(MFC2010) || defined(MFC2011)
// INT __fastcall CApp__CreateGame_hook(CApp* _this, void*, int a2, LPCWSTR a3);
void __fastcall CWorkspace__ExecUrlScript_hook(CWorkspace* _this, void*, LPCWSTR url, VARIANTARG arg1, VARIANTARG arg2, VARIANTARG arg3, VARIANTARG arg4, LPVOID voidptr);
CRobloxDoc* __fastcall CRobloxApp__CreateDocument_hook(CRobloxApp* _this);
BOOL __fastcall CRobloxApp__InitInstance_hook(CRobloxApp* _this);
void __fastcall CRobloxCommandLineInfo__ParseParam_hook(CRobloxCommandLineInfo* _this, void*, const char* pszParam, BOOL bFlag, BOOL bLast);
#endif

View File

@ -13,8 +13,6 @@ ADD_PATCH(StandardOut__print, StandardOut__print_hook)
#endif
#if defined(MFC2010) || defined(MFC2011)
// ADD_PATCH(CApp__CreateGame, CApp__CreateGame_hook)
ADD_PATCH(CRobloxApp__CreateDocument, CRobloxApp__CreateDocument_hook)
ADD_PATCH(CWorkspace__ExecUrlScript, CWorkspace__ExecUrlScript_hook)
ADD_PATCH(CRobloxApp__InitInstance, CRobloxApp__InitInstance_hook)
ADD_PATCH(CRobloxCommandLineInfo__ParseParam, CRobloxCommandLineInfo__ParseParam_hook)
#endif