diff --git a/PolygonClientUtilities/Classes.h b/PolygonClientUtilities/Classes.h index 018bd6b..af38489 100644 --- a/PolygonClientUtilities/Classes.h +++ b/PolygonClientUtilities/Classes.h @@ -18,20 +18,16 @@ struct DataModel struct Game { - // void* padding1[26]; // 2010 has a class size of 104 + // 2010 has a class size of 104 bytes void* padding1[8]; - // int dataModel; - // void* padding2[17]; std::shared_ptr dataModel; void* padding2[9]; }; -const auto Game__initializeClass = (Game * (__thiscall*)(void* _this, int a2))0x455D40; +const auto Game__initializeClass = (Game * (__thiscall*)(Game* _this, int a2))0x455D40; +const auto Game__construct = (int(__thiscall*)(Game* _this))0x47DBF0; -const auto sub_47C280 = (int(__thiscall*)(int _this, int a2))0x47C280; -const auto sub_902680 = (void * (__thiscall*)(void * _this))0x902680; const auto ServiceProvider__createScriptContext = (void * (__thiscall*)(void* _this))0x4282E0; -const auto ScriptContext__setTimeout = (void (__thiscall*)(void* _this, double seconds))0x616EB0; // 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; diff --git a/PolygonClientUtilities/Debug/PolygonClientUtilities.ilk b/PolygonClientUtilities/Debug/PolygonClientUtilities.ilk index 972eb3f..d44fe4b 100644 Binary files a/PolygonClientUtilities/Debug/PolygonClientUtilities.ilk and b/PolygonClientUtilities/Debug/PolygonClientUtilities.ilk differ diff --git a/PolygonClientUtilities/DebugGame.cpp b/PolygonClientUtilities/DebugGame.cpp deleted file mode 100644 index 0e05547..0000000 --- a/PolygonClientUtilities/DebugGame.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#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); -} \ No newline at end of file diff --git a/PolygonClientUtilities/DebugGame.h b/PolygonClientUtilities/DebugGame.h deleted file mode 100644 index 9ea8346..0000000 --- a/PolygonClientUtilities/DebugGame.h +++ /dev/null @@ -1,7 +0,0 @@ -#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; \ No newline at end of file diff --git a/PolygonClientUtilities/PolygonClientUtilities.vcxproj b/PolygonClientUtilities/PolygonClientUtilities.vcxproj index ff00ca4..c345c27 100644 --- a/PolygonClientUtilities/PolygonClientUtilities.vcxproj +++ b/PolygonClientUtilities/PolygonClientUtilities.vcxproj @@ -163,7 +163,6 @@ - @@ -180,7 +179,6 @@ - diff --git a/PolygonClientUtilities/PolygonClientUtilities.vcxproj.filters b/PolygonClientUtilities/PolygonClientUtilities.vcxproj.filters index 8d0ad7e..d0e65f5 100644 --- a/PolygonClientUtilities/PolygonClientUtilities.vcxproj.filters +++ b/PolygonClientUtilities/PolygonClientUtilities.vcxproj.filters @@ -63,9 +63,6 @@ Header Files\Hooks - - Header Files\Hooks - Header Files\Hooks @@ -110,9 +107,6 @@ Source Files\Hooks - - Source Files\Hooks - Source Files\Hooks diff --git a/PolygonClientUtilities/RCCOutput.cpp b/PolygonClientUtilities/RCCOutput.cpp index 75fcb4c..062ce3f 100644 --- a/PolygonClientUtilities/RCCOutput.cpp +++ b/PolygonClientUtilities/RCCOutput.cpp @@ -1,6 +1,5 @@ #include "pch.h" #include "RCCOutput.h" -#include "DebugGame.h" #include "Patches.h" HANDLE outputHandle; @@ -36,16 +35,9 @@ void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string* message = reinterpret_cast(messagePtr); #endif - /* if (message->compare("MakeDatamodel") == 0) - { - printf("Attempting to create DataModel...\n"); - DataModel__createDataModel(true); - } */ - - if (message->compare("NewGame") == 0) + if (message->compare("NewGame") == 0 || message->compare("NewGame2") == 0) { printf("\n"); - printf("Attempting to create new Game...\n"); Game* game = new Game(); @@ -57,29 +49,14 @@ void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string* } else { - // int datamodel = game[4]; printf("Successfully created new Game! (%p)\n", game); - // printf("Address of DataModel: %08X\n", game->dataModel); - // printf("Attempting to set DataModel Job ID to 'deez nuts'...\n"); - // game->dataModel->jobId = "deez nuts"; - printf("Length of DataModel Job ID: %d\n", game->dataModel->jobId.length()); - printf("Attempting to create service provider...\n"); + game->dataModel->jobId = "deez nuts"; + auto scriptContext = ServiceProvider__createScriptContext(game->dataModel.get()); - void* dataModelPointer = game->dataModel.get(); - printf("Address of dataModelPointer: %p\n", dataModelPointer); - - printf("Calling ServiceProvider::create()...\n"); - void* scriptContext = ServiceProvider__createScriptContext(dataModelPointer); - printf("Address of scriptContext: %p\n", scriptContext); - - printf("Calling ScriptContext::execute()...\n"); - // void* arg; - // ScriptContext__execute(scriptContext, &arg, 1, "print('hi')", "hi", 0); - ScriptContext__execute(scriptContext, 1, "print('hi')", "hi"); - - // printf("Calling ScriptContext::setTimeout()...\n"); - // ScriptContext__setTimeout(scriptContext, 5); + ScriptContext__execute(scriptContext, 5, "print(\"hi this should be inside the dll's created datamodel i think\")", "hi"); + ScriptContext__execute(scriptContext, 5, "print(\"job id: \" .. game.jobId)", "hi"); + ScriptContext__execute(scriptContext, 5, "printidentity()", "hi"); printf("\n"); } diff --git a/PolygonClientUtilities/dllmain.cpp b/PolygonClientUtilities/dllmain.cpp index da41a1a..60dfc1d 100644 --- a/PolygonClientUtilities/dllmain.cpp +++ b/PolygonClientUtilities/dllmain.cpp @@ -3,7 +3,6 @@ #include "Patches.h" //#include "RobloxMFCHooks.h" -#include "DebugGame.h" #include "DebugScriptContext.h" // #include "TestHttpGetPost.h" #include "TrustCheck.h" @@ -26,7 +25,6 @@ #endif START_PATCH_LIST() -ADD_PATCH(Game__construct, Game__construct_hook) // ADD_PATCH(ScriptContext__execute, ScriptContext__execute_hook) // ADD_PATCH(Http_httpGetPostWinInet, Http_httpGetPostWinInet_hook)