diff --git a/Kiseki.Patcher/Header/Discord.hpp b/Kiseki.Patcher/Header/Discord.hpp index ddb9435..e6e22c4 100644 --- a/Kiseki.Patcher/Header/Discord.hpp +++ b/Kiseki.Patcher/Header/Discord.hpp @@ -6,7 +6,7 @@ #include #include -#include "Configuration.hpp" +#include "Globals.hpp" #include "Hooks/CRoblox.hpp" diff --git a/Kiseki.Patcher/Header/Configuration.hpp b/Kiseki.Patcher/Header/Globals.hpp similarity index 85% rename from Kiseki.Patcher/Header/Configuration.hpp rename to Kiseki.Patcher/Header/Globals.hpp index e943833..7adfd75 100644 --- a/Kiseki.Patcher/Header/Configuration.hpp +++ b/Kiseki.Patcher/Header/Globals.hpp @@ -16,19 +16,16 @@ #define RBX__MESSAGE_WARNING 2 #define RBX__MESSAGE_ERROR 3 -// TODO: Verify this #define CLASSPADDING_DATAMODEL__JOBID 739 -#define ADDRESS_HTTP__HTTPGETPOSTWININET 0x0 +#define ADDRESS_HTTP__HTTPGETPOSTWININET 0x006F03B0 +#define ADDRESS_HTTP__HTTPGETPOSTWINHTTP 0x006EEE70 #define ADDRESS_HTTP__TRUSTCHECK 0x005B7050 #define ADDRESS_CRYPT__VERIFYSIGNATUREBASE64 0x00809EC0 -#define ADDRESS_CONTEXT__REQUIREPERMISSION 0x0 -#define ADDRESS_CONTEXT__ISINROLE 0x0 #define ADDRESS_DATAMODEL__GETJOBID 0x005E70C0 #define ADDRESS_STANDARDOUT__PRINT 0x005B25E0 #define ADDRESS_SERVERREPLICATOR__SENDTOP 0x00513E80 #define ADDRESS_SERVERREPLICATOR__PROCESSTICKET 0x00514B60 -#define ADDRESS_SERVERREPLICATOR__PROCESSPACKET 0x00514B60 #define CLASSLOCATION_CROBLOXAPP 0x00CBA8A0 #define CLASSLOCATION_CAPP 0x00406D80 diff --git a/Kiseki.Patcher/Header/Helpers.hpp b/Kiseki.Patcher/Header/Helpers.hpp index 1b94d56..5c53241 100644 --- a/Kiseki.Patcher/Header/Helpers.hpp +++ b/Kiseki.Patcher/Header/Helpers.hpp @@ -2,7 +2,7 @@ #include -#include "Configuration.hpp" +#include "Globals.hpp" class Helpers { diff --git a/Kiseki.Patcher/Header/Hooks/CRoblox.hpp b/Kiseki.Patcher/Header/Hooks/CRoblox.hpp index 763ade8..f23d0c2 100644 --- a/Kiseki.Patcher/Header/Hooks/CRoblox.hpp +++ b/Kiseki.Patcher/Header/Hooks/CRoblox.hpp @@ -2,7 +2,7 @@ #include -#include "Configuration.hpp" +#include "Globals.hpp" #include "Helpers.hpp" #include "Discord.hpp" diff --git a/Kiseki.Patcher/Header/Hooks/Context.hpp b/Kiseki.Patcher/Header/Hooks/Context.hpp deleted file mode 100644 index 4a1ef5f..0000000 --- a/Kiseki.Patcher/Header/Hooks/Context.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#ifdef _DEBUG - -#pragma once - -#include "Configuration.hpp" - -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; - -#endif \ No newline at end of file diff --git a/Kiseki.Patcher/Header/Hooks/Crypt.hpp b/Kiseki.Patcher/Header/Hooks/Crypt.hpp index e1c718f..1a51ca2 100644 --- a/Kiseki.Patcher/Header/Hooks/Crypt.hpp +++ b/Kiseki.Patcher/Header/Hooks/Crypt.hpp @@ -2,7 +2,7 @@ #include -#include "Configuration.hpp" +#include "Globals.hpp" typedef void(__thiscall* Crypt__verifySignatureBase64_t)(HCRYPTPROV* _this, int a2, BYTE* pbData, int a4, int a5, int a6, DWORD dwDataLen, int a8, int a9, int a10, int a11, int a12, int a13, int a14, int a15); void __fastcall Crypt__verifySignatureBase64_hook(HCRYPTPROV* _this, void*, int a2, BYTE* pbData, int a4, int a5, int a6, DWORD dwDataLen, int a8, int a9, int a10, int a11, int a12, int a13, int a14, int a15); diff --git a/Kiseki.Patcher/Header/Hooks/DataModel.hpp b/Kiseki.Patcher/Header/Hooks/DataModel.hpp index cd7b639..74ce905 100644 --- a/Kiseki.Patcher/Header/Hooks/DataModel.hpp +++ b/Kiseki.Patcher/Header/Hooks/DataModel.hpp @@ -4,7 +4,7 @@ #include "Hooks/CRoblox.hpp" -#include "Configuration.hpp" +#include "Globals.hpp" #include "Helpers.hpp" struct DataModel diff --git a/Kiseki.Patcher/Header/Hooks/Http.hpp b/Kiseki.Patcher/Header/Hooks/Http.hpp index f9175f8..4cf4d6d 100644 --- a/Kiseki.Patcher/Header/Hooks/Http.hpp +++ b/Kiseki.Patcher/Header/Hooks/Http.hpp @@ -5,7 +5,7 @@ #include "Hooks/StandardOut.hpp" #endif -#include "Configuration.hpp" +#include "Globals.hpp" #include "Helpers.hpp" struct Http diff --git a/Kiseki.Patcher/Header/Hooks/ServerReplicator.hpp b/Kiseki.Patcher/Header/Hooks/ServerReplicator.hpp index 52df50b..6ac3089 100644 --- a/Kiseki.Patcher/Header/Hooks/ServerReplicator.hpp +++ b/Kiseki.Patcher/Header/Hooks/ServerReplicator.hpp @@ -2,7 +2,7 @@ #pragma once -#include "Configuration.hpp" +#include "Globals.hpp" struct Packet { diff --git a/Kiseki.Patcher/Header/Hooks/StandardOut.hpp b/Kiseki.Patcher/Header/Hooks/StandardOut.hpp index de9bf59..09ad762 100644 --- a/Kiseki.Patcher/Header/Hooks/StandardOut.hpp +++ b/Kiseki.Patcher/Header/Hooks/StandardOut.hpp @@ -2,9 +2,9 @@ #pragma once -#include "Configuration.hpp" +#include "Globals.hpp" #include "Helpers.hpp" -#include "Patches.hpp" +#include "Patcher.hpp" #include "Server.hpp" typedef void(__thiscall* StandardOut__print_t)(int _this, int type, std::string* message); diff --git a/Kiseki.Patcher/Header/Server.hpp b/Kiseki.Patcher/Header/Server.hpp index 3ba2331..d31aafa 100644 --- a/Kiseki.Patcher/Header/Server.hpp +++ b/Kiseki.Patcher/Header/Server.hpp @@ -2,7 +2,7 @@ #pragma once -#include "Configuration.hpp" +#include "Globals.hpp" #include "Helpers.hpp" #include "Hooks/StandardOut.hpp" diff --git a/Kiseki.Patcher/Source/Hooks/Context.cpp b/Kiseki.Patcher/Source/Hooks/Context.cpp deleted file mode 100644 index d1fc049..0000000 --- a/Kiseki.Patcher/Source/Hooks/Context.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef _DEBUG - -#include "Hooks/Context.hpp" - -Context__requirePermission_t Context__requirePermission = (Context__requirePermission_t)ADDRESS_CONTEXT__REQUIREPERMISSION; - -void __fastcall Context__requirePermission_hook(void* _this, void*, int permission, const char* operation) -{ - int identity = ((int*)_this)[0]; - - if (!Context__isInRole(identity, permission)) - { - if (operation != 0) - { - throw std::runtime_error("The current identity (" + std::to_string(identity) + ") cannot " + std::string(operation) + " (requires " + std::to_string(permission) + ")"); - } - else - { - throw std::runtime_error("The current identity (" + std::to_string(identity) + ") cannot perform the requested operation (requires " + std::to_string(permission) + ")"); - } - } -} - -#endif \ No newline at end of file diff --git a/Kiseki.Patcher/Source/Hooks/Crypt.cpp b/Kiseki.Patcher/Source/Hooks/Crypt.cpp index 8ca82d6..4e66b5f 100644 --- a/Kiseki.Patcher/Source/Hooks/Crypt.cpp +++ b/Kiseki.Patcher/Source/Hooks/Crypt.cpp @@ -1,7 +1,7 @@ #include "Hooks/Crypt.hpp" #include "Helpers.hpp" -#include "Patches.hpp" +#include "Patcher.hpp" Crypt::Crypt() { diff --git a/Kiseki.Patcher/Source/main.cpp b/Kiseki.Patcher/Source/main.cpp index d3d25e6..0934fb4 100644 --- a/Kiseki.Patcher/Source/main.cpp +++ b/Kiseki.Patcher/Source/main.cpp @@ -1,6 +1,6 @@ -#include "Configuration.hpp" -#include "Patches.hpp" +#include "Globals.hpp" +#include "Patcher.hpp" #ifdef PLAYER #include "Discord.hpp" @@ -14,10 +14,6 @@ #include "Hooks/Crypt.hpp" #include "Hooks/CRoblox.hpp" -#ifdef _DEBUG -#include "Hooks/Context.hpp" -#endif - #ifdef SERVER #include "Hooks/DataModel.hpp" #include "Hooks/StandardOut.hpp" @@ -34,10 +30,6 @@ ADD_PATCH(Crypt__verifySignatureBase64, Crypt__verifySignatureBase64_hook) ADD_PATCH(CRobloxApp__InitInstance, CRobloxApp__InitInstance_hook) ADD_PATCH(CRobloxCommandLineInfo__ParseParam, CRobloxCommandLineInfo__ParseParam_hook) -#ifdef _DEBUG -ADD_PATCH(Context__requirePermission, Context__requirePermission_hook) -#endif - #ifdef SERVER ADD_PATCH(DataModel__getJobId, DataModel__getJobId_hook) diff --git a/vcpkg.json b/vcpkg.json index fa5f666..d7318bb 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -6,7 +6,8 @@ "curl", "detours", "discord-rpc", - "rapidjson", - "pugixml" + "openssl", + "pugixml", + "rapidjson" ] } \ No newline at end of file