Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 492677d5bb | |||
| a325ee5fb5 | |||
| 2812d225cd | |||
| 603627bd33 |
@@ -133,8 +133,9 @@ bool CertManager::GenerateCA()
|
|||||||
|
|
||||||
Log::info("Generated new CA key and certificate files. Installing to Windows Root CA store automatically...");
|
Log::info("Generated new CA key and certificate files. Installing to Windows Root CA store automatically...");
|
||||||
|
|
||||||
STARTUPINFOA si = {sizeof(si)};
|
STARTUPINFOA si = {0};
|
||||||
PROCESS_INFORMATION pi;
|
si.cb = sizeof(si);
|
||||||
|
PROCESS_INFORMATION pi = {0};
|
||||||
char cmd[] = "certutil.exe -user -addstore root ca_cert.pem";
|
char cmd[] = "certutil.exe -user -addstore root ca_cert.pem";
|
||||||
if (CreateProcessA(NULL, cmd, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
|
if (CreateProcessA(NULL, cmd, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
|
||||||
{
|
{
|
||||||
|
|||||||
+57
-50
@@ -33,6 +33,11 @@ void Spoofer::registerListeners(Proxy* proxy)
|
|||||||
proxy->OnServerResponse.addListener([this](const std::string& url, std::string& body, std::string& respHeaders) {
|
proxy->OnServerResponse.addListener([this](const std::string& url, std::string& body, std::string& respHeaders) {
|
||||||
this->serverResponseHandler(url, body, respHeaders);
|
this->serverResponseHandler(url, body, respHeaders);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
proxy->OnClientRequest.addListener(
|
||||||
|
[this](const std::string& url, const std::string& body, std::string& reqHeaders) {
|
||||||
|
this->clientRequestHandler(url, body, reqHeaders);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spoofer::loadData()
|
void Spoofer::loadData()
|
||||||
@@ -259,7 +264,7 @@ void Spoofer::modifyCharacterData(json& js)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spoofer::serverResponseHandler(const std::string& url, std::string& body, std::string& /*respHeaders*/)
|
void Spoofer::serverResponseHandler(const std::string& url, std::string& body, std::string& respHeaders)
|
||||||
{
|
{
|
||||||
if (url.find("bhvrdbd.com") != std::string::npos) Log::verbose("BHVR api res @ {}", url);
|
if (url.find("bhvrdbd.com") != std::string::npos) Log::verbose("BHVR api res @ {}", url);
|
||||||
|
|
||||||
@@ -278,14 +283,6 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s
|
|||||||
std::unordered_set<std::string> foundOfferings;
|
std::unordered_set<std::string> foundOfferings;
|
||||||
std::unordered_set<std::string> foundCatalogItems;
|
std::unordered_set<std::string> foundCatalogItems;
|
||||||
|
|
||||||
//std::unordered_set<std::string> objectIds;
|
|
||||||
//objectIds.insert(_camperItemIds.begin(), _camperItemIds.end());
|
|
||||||
//objectIds.insert(_slasherPowerIds.begin(), _slasherPowerIds.end());
|
|
||||||
|
|
||||||
//std::unordered_set<std::string> addonIds;
|
|
||||||
//addonIds.insert(_camperAddonIds.begin(), _camperAddonIds.end());
|
|
||||||
//addonIds.insert(_slasherAddonIds.begin(), _slasherAddonIds.end());
|
|
||||||
|
|
||||||
std::unordered_set<std::string> offeringIds;
|
std::unordered_set<std::string> offeringIds;
|
||||||
offeringIds.insert(_camperOfferingIds.begin(), _camperOfferingIds.end());
|
offeringIds.insert(_camperOfferingIds.begin(), _camperOfferingIds.end());
|
||||||
offeringIds.insert(_slasherOfferingIds.begin(), _slasherOfferingIds.end());
|
offeringIds.insert(_slasherOfferingIds.begin(), _slasherOfferingIds.end());
|
||||||
@@ -302,20 +299,6 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s
|
|||||||
{
|
{
|
||||||
std::string objectId = item["objectId"];
|
std::string objectId = item["objectId"];
|
||||||
|
|
||||||
/*if (objectIds.find(objectId) != objectIds.end())
|
|
||||||
{
|
|
||||||
foundObjects.insert(objectId);
|
|
||||||
item["quantity"] = 100;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (addonIds.find(objectId) != addonIds.end())
|
|
||||||
{
|
|
||||||
foundAddons.insert(objectId);
|
|
||||||
item["quantity"] = 100;
|
|
||||||
continue;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (perkIds.find(objectId) != perkIds.end())
|
if (perkIds.find(objectId) != perkIds.end())
|
||||||
{
|
{
|
||||||
foundPerks.insert(objectId);
|
foundPerks.insert(objectId);
|
||||||
@@ -337,30 +320,6 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*for (const std::string& id : objectIds)
|
|
||||||
{
|
|
||||||
if (foundObjects.find(id) == foundObjects.end())
|
|
||||||
{
|
|
||||||
itemsArr.push_back({
|
|
||||||
{"objectId", id},
|
|
||||||
{"quantity", 100},
|
|
||||||
{"lastUpdateAt", std::time(nullptr)},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const std::string& id : addonIds)
|
|
||||||
{
|
|
||||||
if (foundAddons.find(id) == foundAddons.end())
|
|
||||||
{
|
|
||||||
itemsArr.push_back({
|
|
||||||
{"objectId", id},
|
|
||||||
{"quantity", 100},
|
|
||||||
{"lastUpdateAt", std::time(nullptr)},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
for (const std::string& id : perkIds)
|
for (const std::string& id : perkIds)
|
||||||
{
|
{
|
||||||
if (foundPerks.find(id) == foundPerks.end())
|
if (foundPerks.find(id) == foundPerks.end())
|
||||||
@@ -446,8 +405,36 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
json doc = json::parse(body);
|
json doc = json::parse(body);
|
||||||
modifyCharacterData(doc);
|
|
||||||
body = doc.dump();
|
if (body.find("NotAllowedException") != std::string::npos && body.find("not owned") != std::string::npos)
|
||||||
|
{
|
||||||
|
Log::info("Spoofing bloodweb error error for unowned character");
|
||||||
|
json mock;
|
||||||
|
mock["bloodWebLevelChanged"] = false;
|
||||||
|
mock["updatedWallets"] = json::array();
|
||||||
|
mock["bloodWebLevel"] = 15;
|
||||||
|
mock["prestigeLevel"] = 0;
|
||||||
|
mock["bloodWebData"] = {{"ringData", json::array()}, {"paths", json::array()}};
|
||||||
|
mock["characterItems"] = json::array();
|
||||||
|
mock["characterName"] = this->_lastBloodWebChar;
|
||||||
|
|
||||||
|
modifyCharacterData(mock);
|
||||||
|
|
||||||
|
size_t firstSpace = respHeaders.find(' ');
|
||||||
|
if (firstSpace != std::string::npos)
|
||||||
|
{
|
||||||
|
respHeaders.replace(firstSpace + 1, 3, "200");
|
||||||
|
}
|
||||||
|
|
||||||
|
body = mock.dump();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
modifyCharacterData(doc);
|
||||||
|
body = doc.dump();
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
catch (const json::parse_error& e)
|
catch (const json::parse_error& e)
|
||||||
{
|
{
|
||||||
@@ -455,4 +442,24 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Spoofer::clientRequestHandler(const std::string& url, const std::string& body, std::string& /*reqHeaders*/)
|
||||||
|
{
|
||||||
|
if (url.find("api/v1/dbd-character-data/bloodweb") != std::string::npos ||
|
||||||
|
url.find("api/v1/dbd-character-data/bulk-spending-bloodweb") != std::string::npos)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
json req = json::parse(body);
|
||||||
|
if (req.contains("characterName"))
|
||||||
|
{
|
||||||
|
this->_lastBloodWebChar = req["characterName"];
|
||||||
|
Log::info("Detected bloodweb request for character: {}", this->_lastBloodWebChar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class Spoofer
|
|||||||
void modifyCharacterData(nlohmann::json& js);
|
void modifyCharacterData(nlohmann::json& js);
|
||||||
|
|
||||||
void serverResponseHandler(const std::string& url, std::string& body, std::string& respHeaders);
|
void serverResponseHandler(const std::string& url, std::string& body, std::string& respHeaders);
|
||||||
|
void clientRequestHandler(const std::string& url, const std::string& body, std::string& reqHeaders);
|
||||||
|
|
||||||
std::unordered_set<std::string> _camperItemIds;
|
std::unordered_set<std::string> _camperItemIds;
|
||||||
std::unordered_set<std::string> _slasherPowerIds;
|
std::unordered_set<std::string> _slasherPowerIds;
|
||||||
@@ -37,4 +38,6 @@ class Spoofer
|
|||||||
|
|
||||||
std::unordered_set<std::string> _catalogOutfitIds;
|
std::unordered_set<std::string> _catalogOutfitIds;
|
||||||
std::unordered_set<std::string> _catalogItemIds;
|
std::unordered_set<std::string> _catalogItemIds;
|
||||||
|
|
||||||
|
std::string _lastBloodWebChar = "Ace";
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user