|
|
@@ -36,7 +36,7 @@ using json = nlohmann::json; |
|
|
|
#include "include/easywsclient.cpp" |
|
|
|
|
|
|
|
using easywsclient::WebSocket; |
|
|
|
WebSocket::pointer ws = NULL; |
|
|
|
WebSocket::pointer ws = nullptr; |
|
|
|
|
|
|
|
//#include <map> |
|
|
|
//#include <fstream> |
|
|
@@ -91,6 +91,8 @@ auto getNewsServicePattern = xorstr("45 8B C7 48 8D 15 ?? ?? ?? ?? 48 8D 8D ?? ? |
|
|
|
auto mallocPattern = xorstr("48 89 5C 24 ?? 57 48 83 EC 20 48 8B F9 8B DA 48 8B 0D ?? ?? ?? ?? 48 85 C9 75 0C E8 ?? ?? ?? ?? 48 8B 0D ?? ?? ?? ?? 48 8B 01 44 8B C3 48 8B D7 48 8B 5C 24 ?? 48 83 C4 20 5F 48 FF 60 10"); |
|
|
|
auto reallocPattern = xorstr("48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC 20 48 8B F1 41 8B D8 48 8B 0D ?? ?? ?? ?? 48 8B FA 48 85 C9 75 0C E8 ?? ?? ?? ?? 48 8B 0D ?? ?? ?? ?? 48 8B 01 44 8B CB 4C 8B C7 48 8B D6 48 8B 5C 24 ?? 48 8B 74 24 ?? 48 83 C4 20 5F 48 FF 60 18"); |
|
|
|
|
|
|
|
auto hardcodedHotfixCallPattern = xorstr("40 55 53 56 57 41 54 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 48 8B BD"); |
|
|
|
|
|
|
|
CRITICAL_SECTION critsec; |
|
|
|
|
|
|
|
static bool isInInternalMode = false; |
|
|
@@ -333,6 +335,11 @@ tRealloc oRealloc; |
|
|
|
typedef void (__fastcall* tGetNewsItems)(void*); |
|
|
|
tGetNewsItems oGetNewsItems = NULL; |
|
|
|
|
|
|
|
using EMicropatchOperation = uintptr_t; |
|
|
|
|
|
|
|
typedef bool (__fastcall* tHardcodedHotfixes)(EMicropatchOperation, const wchar_t* patchString, const wchar_t*, bool, void* pFunc, void* someObject); |
|
|
|
tHardcodedHotfixes oHardcodedHotfixes = NULL; |
|
|
|
|
|
|
|
template<class T> |
|
|
|
struct TArray |
|
|
|
{ |
|
|
@@ -1228,6 +1235,12 @@ void hkGetNewsItems(void* newsWidget) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
bool hkHardcodedHotfixes(EMicropatchOperation unknown, const wchar_t* patchString, const wchar_t* unknown_2, bool unknown_3, void* pFunc, void* someObject) |
|
|
|
{ |
|
|
|
pFunc = 0; |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
//typedef DNS_STATUS(WINAPI* DNSQUERYEX)(PDNS_QUERY_REQUEST pQueryRequest, PDNS_QUERY_RESULT pQueryResults, PDNS_QUERY_CANCEL pCancelHandle); |
|
|
|
//DNSQUERYEX fpDnsQueryEx = NULL; |
|
|
|
// |
|
|
@@ -1381,6 +1394,17 @@ DWORD WINAPI MainThread(LPVOID param) |
|
|
|
Sleep(100); |
|
|
|
} |
|
|
|
|
|
|
|
uintptr_t hardcodedHotfixesProcessingAddress = PatternScan::FindSignature(NULL, hardcodedHotfixCallPattern.crypt_get()); |
|
|
|
while(hardcodedHotfixesProcessingAddress == NULL) |
|
|
|
{ |
|
|
|
hardcodedHotfixesProcessingAddress = PatternScan::FindSignature(NULL, hardcodedHotfixCallPattern.crypt_get()); |
|
|
|
Sleep(100); |
|
|
|
} |
|
|
|
/* |
|
|
|
int32_t hardcodedHotfixOffset = *(int32_t*)(hardcodedHotfixesProcessingAddress + 35); |
|
|
|
uintptr_t finalHardcodedHotfixAddress = hardcodedHotfixesProcessingAddress + 34 + hardcodedHotfixOffset + 5;*/ |
|
|
|
|
|
|
|
|
|
|
|
uintptr_t sparkModuleAddress = PatternScan::FindSignature(NULL, FGbxSparkModuleStartupModulePattern.crypt_get()); |
|
|
|
while (sparkModuleAddress == NULL) { |
|
|
|
sparkModuleAddress = PatternScan::FindSignature(NULL, FGbxSparkModuleStartupModulePattern.crypt_get()); |
|
|
@@ -1427,6 +1451,8 @@ DWORD WINAPI MainThread(LPVOID param) |
|
|
|
Sleep(200); |
|
|
|
while (MH_CreateHookEx((LPVOID)areMicropatchesDifferentAddress, &hkAreMicropatchesDifferent, &oAreMicropatchesDifferent) != MH_OK) |
|
|
|
Sleep(200); |
|
|
|
// while (MH_CreateHookEx((LPVOID)hardcodedHotfixesProcessingAddress, &hkHardcodedHotfixes, &oHardcodedHotfixes) != MH_OK) |
|
|
|
// Sleep(200); |
|
|
|
std::cout << "Placed 5/7 hooks" << std::endl; |
|
|
|
|
|
|
|
std::cout << "Placed 7/7 hooks" << std::endl; |
|
|
@@ -1444,7 +1470,6 @@ struct ArgStruct { |
|
|
|
bool boolValue; |
|
|
|
}; |
|
|
|
|
|
|
|
// TODO: Send log messages on success/errors |
|
|
|
extern "C" __declspec(dllexport) DWORD __stdcall ToggleOperationalMode(ArgStruct* argStruct) |
|
|
|
{ |
|
|
|
EnterCriticalSection(&critsec); |
|
|
|