This commit is contained in:
Milxnor
2023-05-20 21:35:50 -04:00
parent 6f8a123750
commit de55d319f6
6 changed files with 18 additions and 14 deletions

View File

@@ -148,6 +148,7 @@
<ClInclude Include="curldefinitions.h" />
<ClInclude Include="exithook.h" />
<ClInclude Include="memcury.h" />
<ClInclude Include="settings.h" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

View File

@@ -32,6 +32,9 @@
<ClInclude Include="exithook.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="settings.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

View File

@@ -1,2 +0,0 @@
# Cobalt
SSL Bypass for Fortnite

View File

@@ -5,13 +5,12 @@
#include "curldefinitions.h"
#include "memcury.h"
#include "settings.h"
// #define HYBRID_ENABLED
auto (*curl_easy_setopt_original)(CURL* Curl, uintptr_t opt, ...)->CURLcode;
std::string FNhost = "127.0.0.1:3551";
//This routine is used for setting up curl. we will be hijacking this to change the values.
auto Hijacked_curl_easy_setopt(CURL* Curl, uintptr_t opt, va_list info) -> CURLcode
{
@@ -36,22 +35,22 @@ auto Hijacked_curl_easy_setopt(CURL* Curl, uintptr_t opt, va_list info) -> CURLc
std::regex Host(("(.*).ol.epicgames.com"));
#ifdef HYBRID_ENABLED
if (std::regex_search(info, std::regex(("/fortnite/api/cloudstorage/system")))) {
url = std::regex_replace(info, Host, FNhost);
url = std::regex_replace(info, Host, REDIRECT_TO_HOST);
}
else if (std::regex_search(info, std::regex(("/fortnite/api/v2/versioncheck/")))) {
url = std::regex_replace(info, Host, FNhost);
url = std::regex_replace(info, Host, REDIRECT_TO_HOST);
}
else if (std::regex_search(info, std::regex(("/fortnite/api/game/v2/profile")))) {
url = std::regex_replace(info, Host, FNhost);
url = std::regex_replace(info, Host, REDIRECT_TO_HOST);
}
else if (std::regex_search(info, std::regex(("/content/api/pages/fortnite-game")))) {
url = std::regex_replace(info, Host, FNhost);
url = std::regex_replace(info, Host, REDIRECT_TO_HOST);
}
else if (std::regex_search(info, std::regex(("/affiliate/api/public/affiliates/slug")))) {
url = std::regex_replace(info, Host, FNhost);
url = std::regex_replace(info, Host, REDIRECT_TO_HOST);
}
else if (std::regex_search(info, std::regex(("/socialban/api/public/v1")))) {
url = std::regex_replace(info, Host, FNhost);
url = std::regex_replace(info, Host, REDIRECT_TO_HOST);
}
/* else if (std::regex_search(info, std::regex(ENC("player.platform")))) { // idk if this even works
if (version == S13)
@@ -62,7 +61,7 @@ auto Hijacked_curl_easy_setopt(CURL* Curl, uintptr_t opt, va_list info) -> CURLc
} */
#else
if (std::regex_search(info, Host)) {
url = std::regex_replace(info, Host, FNhost);
url = std::regex_replace(info, Host, REDIRECT_TO_HOST);
}
#endif
return curl_easy_setopt_original(Curl, opt, url.c_str());

View File

@@ -26,7 +26,7 @@ bool InitializeCurlHook()
if (!CurlEasySetOptAddr)
{
std::cout << "Failed to find CurlEasySetOptAddr!";
std::cout << "Failed to find CurlEasySetOptAddr!\n";
return false;
}
@@ -38,7 +38,7 @@ bool InitializeCurlHook()
}
else
{
Memcury::VEHHook::AddHook(curl_easy_setopt_original, Hijacked_curl_easy_setopt);
Memcury::VEHHook::AddHook(curl_easy_setopt_original, Hijacked_curl_easy_setopt); // TODO find a better way to "bypass" UAC.
}
return true;
@@ -81,7 +81,7 @@ DWORD WINAPI Main(LPVOID)
if (result)
{
std::cout << "Cobalt v0.1 initialized sucessfully.";
std::cout << "Cobalt v0.1 initialized sucessfully.\n";
}
else
{

3
Cobalt/settings.h Normal file
View File

@@ -0,0 +1,3 @@
#pragma once
#define REDIRECT_TO_HOST "127.0.0.1:3551"