Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c795a335f | |||
| 015a13eb86 | |||
| b0524c0589 | |||
| abd3c18040 | |||
| afb4a9c157 | |||
| 9c83499f0f | |||
| cd6d8df243 | |||
| 64ded73f89 | |||
| 022c67cab9 | |||
| cc07cd139c | |||
| 490feb1be7 | |||
| b5a8477ba2 | |||
| e933515e45 | |||
| ff7284dfbf | |||
| 7a710f2e17 | |||
| b36d47a8fb | |||
| 6e2c709426 | |||
| 8929c0e39b | |||
| ab2385fc2f | |||
| 510241e311 | |||
| 5e701e1e1b | |||
| edc4a8b500 | |||
| 7e878a1ac1 | |||
| 5f7ab419b0 | |||
| 38b98bc3ab | |||
| fd0f55bd5e | |||
| 502a35357c | |||
| f3020200a0 | |||
| 492677d5bb | |||
| a325ee5fb5 | |||
| 2812d225cd | |||
| 603627bd33 |
+1
-1
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
+6
-6
@@ -13,9 +13,9 @@ using Newtonsoft.Json;
|
|||||||
|
|
||||||
class DumpByDaylight
|
class DumpByDaylight
|
||||||
{
|
{
|
||||||
private const string _pakDir = "E:\\Program Files (x86)\\Steam\\steamapps\\common\\Dead by Daylight\\DeadByDaylight\\Content\\Paks";
|
private const string _pakDir = "D:\\XboxGames\\Dead By Daylight\\Content\\DeadByDaylight\\Content\\Paks";
|
||||||
private const string _aesKey = "0x22B1639B548124925CF7B9CBAA09F9AC295FCF0324586D6B37EE1D42670B39B3";
|
private const string _aesKey = "0x22B1639B548124925CF7B9CBAA09F9AC295FCF0324586D6B37EE1D42670B39B3";
|
||||||
private const string _mappingURL = "https://github.com/Masusder/FModel-DbdMappings/raw/refs/heads/main/Mappings/9.5.0/5.4.4-3172922+++DeadByDaylight+Quiche_REL-DeadByDaylight.usmap";
|
private const string _mappingURL = "https://git.neru.rip/neru/UnlockedByDaylight/raw/branch/main/res/mappings/latest-xbox.usmap";
|
||||||
|
|
||||||
public static async Task<string?> DownloadMappingFileAsync(string url, string savePath)
|
public static async Task<string?> DownloadMappingFileAsync(string url, string savePath)
|
||||||
{
|
{
|
||||||
@@ -67,7 +67,7 @@ class DumpByDaylight
|
|||||||
|
|
||||||
Console.WriteLine("\nProvider Initialized. Extracting Databases...");
|
Console.WriteLine("\nProvider Initialized. Extracting Databases...");
|
||||||
|
|
||||||
var dataPak = provider.GetArchive("pakchunk4-Windows.utoc");
|
var dataPak = provider.GetArchive("pakchunk4-WinGDK.utoc");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* itemdb dump
|
* itemdb dump
|
||||||
@@ -114,7 +114,7 @@ class DumpByDaylight
|
|||||||
*/
|
*/
|
||||||
searchPaths = dataPak.Files.Keys.Where(x => x.Contains($"/ItemAddonDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
searchPaths = dataPak.Files.Keys.Where(x => x.Contains($"/ItemAddonDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
var camperAddons = new List<string>();
|
var camperAddons = new List<string>();
|
||||||
var slaherAddons = new List<string>();
|
var slasherAddons = new List<string>();
|
||||||
|
|
||||||
foreach (var path in searchPaths)
|
foreach (var path in searchPaths)
|
||||||
{
|
{
|
||||||
@@ -135,7 +135,7 @@ class DumpByDaylight
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isSlasherAddon)
|
if (isSlasherAddon)
|
||||||
slaherAddons.Add(row.Key.Text);
|
slasherAddons.Add(row.Key.Text);
|
||||||
else
|
else
|
||||||
camperAddons.Add(row.Key.Text);
|
camperAddons.Add(row.Key.Text);
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ class DumpByDaylight
|
|||||||
|
|
||||||
var addonsSerialized = new
|
var addonsSerialized = new
|
||||||
{
|
{
|
||||||
Slashers = slaherAddons.OrderBy(x => x).ToList(),
|
Slashers = slasherAddons.OrderBy(x => x).ToList(),
|
||||||
Campers = camperAddons.OrderBy(x => x).ToList()
|
Campers = camperAddons.OrderBy(x => x).ToList()
|
||||||
};
|
};
|
||||||
File.WriteAllText("addons.json", JsonConvert.SerializeObject(addonsSerialized, Formatting.Indented));
|
File.WriteAllText("addons.json", JsonConvert.SerializeObject(addonsSerialized, Formatting.Indented));
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
#include <processthreadsapi.h>
|
#include <processthreadsapi.h>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
std::string randomizeString(size_t length)
|
std::string randomizeString(size_t length)
|
||||||
{
|
{
|
||||||
@@ -133,8 +134,11 @@ 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;
|
||||||
|
memset(&si, 0, sizeof(si));
|
||||||
|
si.cb = sizeof(si);
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
|
memset(&pi, 0, sizeof(pi));
|
||||||
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))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,18 +5,6 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <wininet.h>
|
#include <wininet.h>
|
||||||
//#include <fstream>
|
|
||||||
//#include <iostream>
|
|
||||||
//#include <string>
|
|
||||||
//#include <string_view>
|
|
||||||
//#include <vector>
|
|
||||||
//#include <format>
|
|
||||||
//#include <mutex>
|
|
||||||
//#include <ctime>
|
|
||||||
//#include <regex>
|
|
||||||
//#include <unordered_set>
|
|
||||||
//#include <simdjson.h>
|
|
||||||
|
|
||||||
|
|
||||||
bool setProxy(bool enable, const std::string& proxyAddr)
|
bool setProxy(bool enable, const std::string& proxyAddr)
|
||||||
{
|
{
|
||||||
@@ -83,7 +71,6 @@ BOOL WINAPI consoleHandler(DWORD dwType)
|
|||||||
running = false;
|
running = false;
|
||||||
cleanup();
|
cleanup();
|
||||||
exit(0);
|
exit(0);
|
||||||
//return TRUE;
|
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -335,6 +335,9 @@ void Proxy::handleClient(SOCKET hClientSocket)
|
|||||||
{
|
{
|
||||||
std::string emptyBody = "";
|
std::string emptyBody = "";
|
||||||
OnClientRequest.run(url, emptyBody, headers);
|
OnClientRequest.run(url, emptyBody, headers);
|
||||||
|
|
||||||
|
if (!pendingUrls.empty()) pendingUrls.back() = url;
|
||||||
|
|
||||||
SSL_write(remoteSSL, headers.data(), (int)headers.size());
|
SSL_write(remoteSSL, headers.data(), (int)headers.size());
|
||||||
clientStream.buffer.erase(0, clientStream.headersEnd + 4);
|
clientStream.buffer.erase(0, clientStream.headersEnd + 4);
|
||||||
clientStream.reset();
|
clientStream.reset();
|
||||||
@@ -383,6 +386,8 @@ void Proxy::handleClient(SOCKET hClientSocket)
|
|||||||
if (complete)
|
if (complete)
|
||||||
{
|
{
|
||||||
OnClientRequest.run(url, body, headers);
|
OnClientRequest.run(url, body, headers);
|
||||||
|
if (!pendingUrls.empty() && pendingUrls.back() != url) pendingUrls.back() = url;
|
||||||
|
|
||||||
SSL_write(remoteSSL, headers.data(), (int)headers.size());
|
SSL_write(remoteSSL, headers.data(), (int)headers.size());
|
||||||
SSL_write(remoteSSL, clientStream.buffer.data() + bodyStart,
|
SSL_write(remoteSSL, clientStream.buffer.data() + bodyStart,
|
||||||
(int)(clientStream.buffer.size() - bodyStart));
|
(int)(clientStream.buffer.size() - bodyStart));
|
||||||
@@ -534,10 +539,6 @@ void Proxy::handleClient(SOCKET hClientSocket)
|
|||||||
if (!pendingUrls.empty()) pendingUrls.pop_front();
|
if (!pendingUrls.empty()) pendingUrls.pop_front();
|
||||||
|
|
||||||
std::string respHeaders = serverStream.buffer.substr(0, bStart);
|
std::string respHeaders = serverStream.buffer.substr(0, bStart);
|
||||||
size_t firstSpace = respHeaders.find(' ');
|
|
||||||
int sc =
|
|
||||||
(firstSpace != std::string::npos) ? safe_stoi(respHeaders.substr(firstSpace + 1, 3)) : 0;
|
|
||||||
|
|
||||||
OnServerResponse.run(url, body, respHeaders);
|
OnServerResponse.run(url, body, respHeaders);
|
||||||
|
|
||||||
removeHeader(respHeaders, "Transfer-Encoding");
|
removeHeader(respHeaders, "Transfer-Encoding");
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class Proxy
|
|||||||
bool Init();
|
bool Init();
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
|
|
||||||
CallbackEvent<const std::string&, const std::string&, std::string&> OnClientRequest;
|
CallbackEvent<std::string&, const std::string&, std::string&> OnClientRequest;
|
||||||
CallbackEvent<const std::string&, std::string&, std::string&> OnServerResponse;
|
CallbackEvent<const std::string&, std::string&, std::string&> OnServerResponse;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
+141
-60
@@ -3,6 +3,7 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
#include <minwindef.h>
|
#include <minwindef.h>
|
||||||
|
|
||||||
@@ -33,6 +34,10 @@ 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](std::string& url, const std::string& body, std::string& reqHeaders) {
|
||||||
|
this->clientRequestHandler(url, body, reqHeaders);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spoofer::loadData()
|
void Spoofer::loadData()
|
||||||
@@ -195,6 +200,10 @@ void Spoofer::parseAndDumpCatalog(std::string& data)
|
|||||||
parseCatalog(data);
|
parseCatalog(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<std::string> killerNames = {
|
||||||
|
"Chuckles", "Bob", "HillBilly", "Nurse", "Shape", "Witch", "Killer07", "Cannibal", "Bear",
|
||||||
|
"Nightmare", "Pig", "Clown", "Spirit", "Plague", "Ghostface", "Demogorgon", "Oni", "Gunslinger"};
|
||||||
|
|
||||||
void Spoofer::modifyCharacterData(json& js)
|
void Spoofer::modifyCharacterData(json& js)
|
||||||
{
|
{
|
||||||
std::unordered_set<std::string> existingItemIds;
|
std::unordered_set<std::string> existingItemIds;
|
||||||
@@ -203,18 +212,76 @@ void Spoofer::modifyCharacterData(json& js)
|
|||||||
if (js.contains("characterName") && js["characterName"].is_string())
|
if (js.contains("characterName") && js["characterName"].is_string())
|
||||||
{
|
{
|
||||||
std::string name = js["characterName"];
|
std::string name = js["characterName"];
|
||||||
if (name == "Bear" || name == "Bob" || name == "Chuckles" || (name.length() >= 2 && name[0] == 'K'))
|
if (killerNames.contains(name) || (name.length() == 3 && name[0] == 'K')) isSlasher = true;
|
||||||
isSlasher = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unordered_set<std::string> stackableIds;
|
if (js.contains("prestigeLevel") && js["prestigeLevel"].get<int>() <= 1)
|
||||||
stackableIds.insert(_camperItemIds.begin(), _camperItemIds.end());
|
if (js.contains("bloodWebLevel") && js["bloodWebLevel"].get<int>() <= 15) js["bloodWebLevel"] = 16;
|
||||||
stackableIds.insert(_camperOfferingIds.begin(), _camperOfferingIds.end());
|
|
||||||
stackableIds.insert(_camperAddonIds.begin(), _camperAddonIds.end());
|
if (js.contains("bloodWebData"))
|
||||||
stackableIds.insert(_slasherAddonIds.begin(), _slasherAddonIds.end());
|
{
|
||||||
|
static std::random_device rd;
|
||||||
|
static std::mt19937 rng(rd());
|
||||||
|
|
||||||
|
std::unordered_set<std::string> stackableIds;
|
||||||
|
stackableIds.insert(_camperItemIds.begin(), _camperItemIds.end());
|
||||||
|
stackableIds.insert(_camperOfferingIds.begin(), _camperOfferingIds.end());
|
||||||
|
stackableIds.insert(_camperAddonIds.begin(), _camperAddonIds.end());
|
||||||
|
stackableIds.insert(_slasherAddonIds.begin(), _slasherAddonIds.end());
|
||||||
|
stackableIds.insert(_slasherOfferingIds.begin(), _slasherOfferingIds.end());
|
||||||
|
|
||||||
|
std::string selectedContentId = "Spring2024Offering";
|
||||||
|
auto it = stackableIds.begin();
|
||||||
|
std::advance(it, std::uniform_int_distribution<>(0, static_cast<int>(_camperOfferingIds.size()) - 1)(rng));
|
||||||
|
selectedContentId = *it;
|
||||||
|
|
||||||
|
std::vector<std::string> paths;
|
||||||
|
json ringDataArray = json::array();
|
||||||
|
|
||||||
|
ringDataArray.push_back({{"nodeData", json::array({{{"nodeId", "0"}, {"state", "Collected"}}})}});
|
||||||
|
|
||||||
|
int nodesPerRing[] = {6, 12, 12};
|
||||||
|
std::vector<std::string> prevRingNodes = {"0"};
|
||||||
|
|
||||||
|
for (int ring = 1; ring <= 3; ++ring)
|
||||||
|
{
|
||||||
|
json nodeDataArray = json::array();
|
||||||
|
std::vector<std::string> currentRingNodes;
|
||||||
|
int numNodes = nodesPerRing[ring - 1];
|
||||||
|
|
||||||
|
for (int i = 1; i <= numNodes; ++i)
|
||||||
|
{
|
||||||
|
std::string childId = std::to_string((ring * 100) + i);
|
||||||
|
currentRingNodes.push_back(childId);
|
||||||
|
|
||||||
|
int parentIndex = (i - 1) / (numNodes / static_cast<int>(prevRingNodes.size()));
|
||||||
|
|
||||||
|
if (parentIndex >= prevRingNodes.size()) parentIndex = static_cast<int>(prevRingNodes.size()) - 1;
|
||||||
|
|
||||||
|
std::string parentId = prevRingNodes[parentIndex];
|
||||||
|
paths.push_back(parentId + "_" + childId);
|
||||||
|
|
||||||
|
nodeDataArray.push_back(
|
||||||
|
{{"nodeId", childId}, {"state", "Collected"}, {"contentId", selectedContentId}});
|
||||||
|
}
|
||||||
|
|
||||||
|
ringDataArray.push_back({{"nodeData", nodeDataArray}});
|
||||||
|
prevRingNodes = std::move(currentRingNodes);
|
||||||
|
}
|
||||||
|
|
||||||
|
js["bloodWebData"]["paths"] = paths;
|
||||||
|
js["bloodWebData"]["ringData"] = ringDataArray;
|
||||||
|
}
|
||||||
|
|
||||||
if (js.contains("characterItems") && js["characterItems"].is_array())
|
if (js.contains("characterItems") && js["characterItems"].is_array())
|
||||||
{
|
{
|
||||||
|
std::unordered_set<std::string> stackableIds;
|
||||||
|
stackableIds.insert(_camperItemIds.begin(), _camperItemIds.end());
|
||||||
|
stackableIds.insert(_camperOfferingIds.begin(), _camperOfferingIds.end());
|
||||||
|
stackableIds.insert(_camperAddonIds.begin(), _camperAddonIds.end());
|
||||||
|
stackableIds.insert(_slasherAddonIds.begin(), _slasherAddonIds.end());
|
||||||
|
stackableIds.insert(_slasherOfferingIds.begin(), _slasherOfferingIds.end());
|
||||||
|
|
||||||
for (auto& item : js["characterItems"])
|
for (auto& item : js["characterItems"])
|
||||||
{
|
{
|
||||||
if (item.contains("itemId") && item["itemId"].is_string())
|
if (item.contains("itemId") && item["itemId"].is_string())
|
||||||
@@ -259,9 +326,11 @@ 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)
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
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);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (url.find("api/v1/extensions/store/getCatalogItems") != std::string::npos) return parseAndDumpCatalog(body);
|
if (url.find("api/v1/extensions/store/getCatalogItems") != std::string::npos) return parseAndDumpCatalog(body);
|
||||||
|
|
||||||
@@ -278,14 +347,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 +363,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 +384,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())
|
||||||
@@ -423,11 +446,24 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s
|
|||||||
|
|
||||||
for (auto& charInfo : charList)
|
for (auto& charInfo : charList)
|
||||||
{
|
{
|
||||||
charInfo["isEntitled"] = true;
|
if (charInfo.contains("bloodWebLevel") && charInfo.at("bloodWebLevel").get<int>() <= 15)
|
||||||
if (charInfo.contains("bloodWebLevel") && charInfo["bloodWebLevel"] <= 1)
|
if (!charInfo.contains("prestigeLevel") || charInfo.at("prestigeLevel").get<int>() <= 0)
|
||||||
|
charInfo["bloodWebLevel"] = 16;
|
||||||
|
|
||||||
|
if (charInfo.contains("bloodWebData") && charInfo.at("bloodWebData").contains("level"))
|
||||||
|
charInfo["bloodWebData"]["level"] = 1;
|
||||||
|
|
||||||
|
if (charInfo["isEntitled"] == false)
|
||||||
{
|
{
|
||||||
charInfo["bloodWebLevel"] = 15;
|
charInfo["isEntitled"] = true;
|
||||||
if (charInfo["bloodWebData"].contains("level")) charInfo["bloodWebData"]["level"] = 1;
|
if (charInfo.contains("origin"))
|
||||||
|
{
|
||||||
|
charInfo["purchaseInfo"] = {{"quantity", 1},
|
||||||
|
{"origin", "PlayerInventory"},
|
||||||
|
{"reason", "Item(s) added via Purchase"},
|
||||||
|
{"lastUpdateAt", 1770702482},
|
||||||
|
{"objectId", charInfo["characterName"]}};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
modifyCharacterData(charInfo);
|
modifyCharacterData(charInfo);
|
||||||
@@ -446,8 +482,33 @@ 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 for unowned character");
|
||||||
|
json mock;
|
||||||
|
mock["bloodWebLevelChanged"] = false;
|
||||||
|
mock["updatedWallets"] = json::array();
|
||||||
|
mock["bloodWebLevel"] = 16;
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
@@ -456,3 +517,23 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Spoofer::clientRequestHandler(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(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