diff --git a/.idea/.idea.BL3ProxySettings/.idea/.gitignore b/.idea/.idea.BL3ProxySettings/.idea/.gitignore new file mode 100644 index 0000000..6cacb97 --- /dev/null +++ b/.idea/.idea.BL3ProxySettings/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/contentModel.xml +/.idea.BL3ProxySettings.iml +/projectSettingsUpdater.xml +/modules.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.BL3ProxySettings/.idea/dictionaries/c0dycode.xml b/.idea/.idea.BL3ProxySettings/.idea/dictionaries/c0dycode.xml new file mode 100644 index 0000000..ce4de7e --- /dev/null +++ b/.idea/.idea.BL3ProxySettings/.idea/dictionaries/c0dycode.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/.idea.BL3ProxySettings/.idea/encodings.xml b/.idea/.idea.BL3ProxySettings/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.BL3ProxySettings/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.BL3ProxySettings/.idea/indexLayout.xml b/.idea/.idea.BL3ProxySettings/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.BL3ProxySettings/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.BL3ProxySettings/.idea/vcs.xml b/.idea/.idea.BL3ProxySettings/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.BL3ProxySettings/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BL3ProxySettings.cpp b/BL3ProxySettings.cpp index ea6b09d..450f8f5 100644 --- a/BL3ProxySettings.cpp +++ b/BL3ProxySettings.cpp @@ -36,7 +36,7 @@ using json = nlohmann::json; #include "include/easywsclient.cpp" using easywsclient::WebSocket; -WebSocket::pointer ws = NULL; +WebSocket::pointer ws = nullptr; //#include //#include @@ -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 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); diff --git a/BL3ProxySettings.sln.DotSettings.user b/BL3ProxySettings.sln.DotSettings.user new file mode 100644 index 0000000..cf38752 --- /dev/null +++ b/BL3ProxySettings.sln.DotSettings.user @@ -0,0 +1,2 @@ + + ERROR \ No newline at end of file diff --git a/BL3ProxySettings.vcxproj b/BL3ProxySettings.vcxproj index 9ff2bc9..1bb8ff5 100644 --- a/BL3ProxySettings.vcxproj +++ b/BL3ProxySettings.vcxproj @@ -31,6 +31,7 @@ true Unicode false + x64 @@ -78,6 +79,7 @@ stdcpp17 false OldStyle + true Console @@ -102,6 +104,7 @@ AnySuitable false None + true Console diff --git a/x64/Debug/BL3ProxySettings.tlog/BL3ProxySettings.lastbuildstate b/x64/Debug/BL3ProxySettings.tlog/BL3ProxySettings.lastbuildstate index 62e8aba..b8e7571 100644 --- a/x64/Debug/BL3ProxySettings.tlog/BL3ProxySettings.lastbuildstate +++ b/x64/Debug/BL3ProxySettings.tlog/BL3ProxySettings.lastbuildstate @@ -1,2 +1,2 @@ -PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.28.29910:TargetPlatformVersion=10.0.19041.0: +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: Debug|x64|F:\Programmieren\C++\BL3\BL3ProxySettings\| diff --git a/x64/Debug/BL3ProxySettings.tlog/CL.command.1.tlog b/x64/Debug/BL3ProxySettings.tlog/CL.command.1.tlog index 7d50f4a..96d8d14 100644 Binary files a/x64/Debug/BL3ProxySettings.tlog/CL.command.1.tlog and b/x64/Debug/BL3ProxySettings.tlog/CL.command.1.tlog differ diff --git a/x64/Debug/BL3ProxySettings.tlog/CL.read.1.tlog b/x64/Debug/BL3ProxySettings.tlog/CL.read.1.tlog index 313ffd8..e9db2f1 100644 Binary files a/x64/Debug/BL3ProxySettings.tlog/CL.read.1.tlog and b/x64/Debug/BL3ProxySettings.tlog/CL.read.1.tlog differ diff --git a/x64/Debug/BL3ProxySettings.tlog/link.command.1.tlog b/x64/Debug/BL3ProxySettings.tlog/link.command.1.tlog index ae6bae9..4f8fbdd 100644 Binary files a/x64/Debug/BL3ProxySettings.tlog/link.command.1.tlog and b/x64/Debug/BL3ProxySettings.tlog/link.command.1.tlog differ diff --git a/x64/Debug/BL3ProxySettings.tlog/link.read.1.tlog b/x64/Debug/BL3ProxySettings.tlog/link.read.1.tlog index a979484..4519534 100644 Binary files a/x64/Debug/BL3ProxySettings.tlog/link.read.1.tlog and b/x64/Debug/BL3ProxySettings.tlog/link.read.1.tlog differ