Compare commits

..

5 Commits

Author SHA1 Message Date
neru a8b5e0148f style: add additional comments
Build / build (push) Successful in 3m17s
2026-04-11 15:51:11 -03:00
neru 50413eb420 feat: fix bloodweb for spoofed inventories 2026-04-11 15:50:51 -03:00
neru ea49c39e53 feat: define PLACEHOLDER_ITEMID 2026-04-11 15:43:29 -03:00
neru f599a9a648 fix: remove early return 2026-04-11 15:43:18 -03:00
neru b8b24a5c30 fix: X509_NAME typedef compiler issue on gcc
Build / build (push) Successful in 3m18s
2026-04-11 13:48:46 -03:00
3 changed files with 37 additions and 10 deletions
+34 -8
View File
@@ -14,6 +14,8 @@
#include <nlohmann/json.hpp>
#define PLACEHOLDER_ITEMID "Anniversary2025Offering"
using json = nlohmann::json;
static std::random_device rd;
@@ -202,7 +204,7 @@ std::string Spoofer::getRandomItem()
for (auto* s : allSets)
if (!s->empty()) validSets.push_back(s);
if (validSets.empty()) return "Spring2024Offering";
if (validSets.empty()) return PLACEHOLDER_ITEMID;
std::uniform_int_distribution<> setDist(0, static_cast<int>(validSets.size()) - 1);
const auto& selectedSet = *validSets[setDist(gen)];
@@ -304,10 +306,6 @@ void Spoofer::modifyCharacterData(json& js)
if (js.contains("bloodWebData")) generateBloodweb(js["bloodWebData"]);
}
}
else
{
if (js.value("isEntitled", false) == false) return;
}
/*
item spoofing
@@ -329,9 +327,9 @@ void Spoofer::modifyCharacterData(json& js)
for (auto& item : js["characterItems"])
{
/*
set existing items to rnd number
*/
/*
set existing items to rnd number
*/
if (item.contains("itemId") && item["itemId"].is_string())
{
std::string itemId = item["itemId"];
@@ -541,6 +539,9 @@ void Spoofer::onBloodweb(std::string& body, std::string& respHeaders)
json doc = json::parse(body, nullptr, false);
if (doc.is_discarded()) return Log::error("JSON parse error for bloodweb response");
/*
return fake bloodweb data
*/
if (_config.spoofCharacterOwnership)
{
if (body.find("NotAllowedException") != std::string::npos && body.find("not owned") != std::string::npos)
@@ -576,6 +577,31 @@ void Spoofer::onBloodweb(std::string& body, std::string& respHeaders)
}
}
/*
bloodweb fixup for perks
(if all perks are unlocked, the game will interpret bloodwebs with perks as invalid so perks will be replaced with PLACEHOLDER_ITEMID)
*/
if (_config.spoofInventory)
{
if (doc.contains("bloodWebData") && doc["bloodWebData"].contains("ringData"))
{
for (auto& ring : doc["bloodWebData"]["ringData"])
{
if (!ring.contains("nodeData")) continue;
for (auto& node : ring["nodeData"])
{
if (!node.contains("contentId")) continue;
std::string contentId = node["contentId"];
if (_camperPerkIds.contains(contentId) || _slasherPerkIds.contains(contentId))
node["contentId"] = PLACEHOLDER_ITEMID;
}
}
}
}
/*
prevent bloodweb reqs from overriding inventory values
*/
modifyCharacterData(doc);
body = doc.dump();
#ifdef _DEBUG
+2 -2
View File
@@ -145,7 +145,7 @@ bool CertManager::generateCA()
X509_gmtime_adj(X509_get_notBefore(cert.get()), 0);
X509_gmtime_adj(X509_get_notAfter(cert.get()), 31536000L); // 1 year
X509_NAME* subjName = X509_get_subject_name(cert.get());
X509_name_st* subjName = X509_get_subject_name(cert.get());
std::string randomCN = utils::randomizeString(16);
X509_NAME_add_entry_by_txt(subjName, "CN", MBSTRING_ASC, (unsigned char*)randomCN.c_str(), -1, -1, 0);
X509_set_issuer_name(cert.get(), subjName);
@@ -198,7 +198,7 @@ SSL_CTX* CertManager::createHostContext(const std::string& host)
X509_gmtime_adj(X509_get_notBefore(cert.get()), 0);
X509_gmtime_adj(X509_get_notAfter(cert.get()), 31536000L);
X509_NAME* subjName = X509_get_subject_name(cert.get());
X509_name_st* subjName = X509_get_subject_name(cert.get());
X509_NAME_add_entry_by_txt(subjName, "CN", MBSTRING_ASC, (unsigned char*)host.c_str(), -1, -1, 0);
X509_set_issuer_name(cert.get(), X509_get_subject_name(_caCert));
X509_set_pubkey(cert.get(), _sessionPkey);
+1
View File
@@ -5,6 +5,7 @@
#include <mutex>
struct x509_st;
struct X509_name_st;
struct ssl_st;
struct ssl_ctx_st;
struct evp_pkey_st;