add s13 hybrid support untested

This commit is contained in:
Gray
2024-03-08 19:12:42 -05:00
parent d3e30220dc
commit c55a72befa
3 changed files with 19 additions and 2 deletions

View File

@@ -23,6 +23,15 @@ inline CURLcode CurlSetOpt_(struct Curl_easy* data, CURLoption option, ...)
return result; 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 #define XOR
inline CURLcode CurlEasySetOptDetour(struct Curl_easy* data, CURLoption tag, ...) 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); 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'; std::cout << "URL: " << uri.Host << uri.Path << '\n';
#if defined(URL_HOST) && defined(URL_PROTOCOL) && defined(URL_PORT) #if defined(URL_HOST) && defined(URL_PROTOCOL) && defined(URL_PORT)

View File

@@ -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"); 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) 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) if (!CurlSetOptAddr)

View File

@@ -14,4 +14,5 @@ enum class ECobaltUsage
#define SHOW_WINDOWS_CONSOLE #define SHOW_WINDOWS_CONSOLE
constexpr static ECobaltUsage CobaltUsage = ECobaltUsage::Private; constexpr static ECobaltUsage CobaltUsage = ECobaltUsage::Private;
constexpr bool bIsS13Epic = false; // S13 Hybrid Windows -> IOS fake