From c55a72befadf8b2825f9c5e8328efd410180cb5f Mon Sep 17 00:00:00 2001 From: Gray <84999745+Milxnor@users.noreply.github.com> Date: Fri, 8 Mar 2024 19:12:42 -0500 Subject: [PATCH] add s13 hybrid support untested --- Cobalt/curlhook.h | 16 ++++++++++++++++ Cobalt/dllmain.cpp | 2 +- Cobalt/settings.h | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Cobalt/curlhook.h b/Cobalt/curlhook.h index c1fe52b..523c4f1 100644 --- a/Cobalt/curlhook.h +++ b/Cobalt/curlhook.h @@ -23,6 +23,15 @@ inline CURLcode CurlSetOpt_(struct Curl_easy* data, CURLoption option, ...) return result; } +std::string ReplaceString(std::string subject, const std::string& search, const std::string& replace) { + size_t pos = 0; + while ((pos = subject.find(search, pos)) != std::string::npos) { + subject.replace(pos, search.length(), replace); + pos += replace.length(); + } + return subject; +} + #define XOR inline CURLcode CurlEasySetOptDetour(struct Curl_easy* data, CURLoption tag, ...) @@ -53,6 +62,13 @@ inline CURLcode CurlEasySetOptDetour(struct Curl_easy* data, CURLoption tag, ... Uri uri = Uri::Parse(url); + if (bIsS13Epic) + { + // this *should* work + uri.QueryString = ReplaceString(uri.QueryString.data(), "Windows", "IOS"); + url = ReplaceString(uri.QueryString.data(), "Windows", "IOS"); // Uhh this should be fine + } + std::cout << "URL: " << uri.Host << uri.Path << '\n'; #if defined(URL_HOST) && defined(URL_PROTOCOL) && defined(URL_PORT) diff --git a/Cobalt/dllmain.cpp b/Cobalt/dllmain.cpp index 1ff5f30..257e6e0 100644 --- a/Cobalt/dllmain.cpp +++ b/Cobalt/dllmain.cpp @@ -82,7 +82,7 @@ bool InitializeCurlHook() CurlSetOptAddr = sigscan("48 89 5C 24 08 48 89 6C 24 10 56 57 41 56 48 83 EC 50 33 ED 49 8B F0 8B DA 48 8B F9"); if (!CurlSetOptAddr) - CurlSetOptAddr = sigscan("48 89 5C 24 ? 55 56 57 41 56 41 57 48 83 EC 50 33 DB 49 8B F0 48 8B F9 8B EB 81 FA"); // tested 28.00 + CurlSetOptAddr = sigscan("48 89 5C 24 ? 55 56 57 41 56 41 57 48 83 EC 50 33 DB 49 8B F0 48 8B F9 8B EB 81 FA"); // tested 28.00 // fixed crash } if (!CurlSetOptAddr) diff --git a/Cobalt/settings.h b/Cobalt/settings.h index 2fdca58..4eca3bf 100644 --- a/Cobalt/settings.h +++ b/Cobalt/settings.h @@ -14,4 +14,5 @@ enum class ECobaltUsage #define SHOW_WINDOWS_CONSOLE -constexpr static ECobaltUsage CobaltUsage = ECobaltUsage::Private; \ No newline at end of file +constexpr static ECobaltUsage CobaltUsage = ECobaltUsage::Private; +constexpr bool bIsS13Epic = false; // S13 Hybrid Windows -> IOS fake \ No newline at end of file