Compare commits
27 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 |
+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));
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
+89
-15
@@ -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>
|
||||||
|
|
||||||
@@ -34,8 +35,7 @@ void Spoofer::registerListeners(Proxy* proxy)
|
|||||||
this->serverResponseHandler(url, body, respHeaders);
|
this->serverResponseHandler(url, body, respHeaders);
|
||||||
});
|
});
|
||||||
|
|
||||||
proxy->OnClientRequest.addListener(
|
proxy->OnClientRequest.addListener([this](std::string& url, const std::string& body, std::string& reqHeaders) {
|
||||||
[this](const std::string& url, const std::string& body, std::string& reqHeaders) {
|
|
||||||
this->clientRequestHandler(url, body, reqHeaders);
|
this->clientRequestHandler(url, body, reqHeaders);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -200,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;
|
||||||
@@ -208,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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (js.contains("prestigeLevel") && js["prestigeLevel"].get<int>() <= 1)
|
||||||
|
if (js.contains("bloodWebLevel") && js["bloodWebLevel"].get<int>() <= 15) js["bloodWebLevel"] = 16;
|
||||||
|
|
||||||
|
if (js.contains("bloodWebData"))
|
||||||
|
{
|
||||||
|
static std::random_device rd;
|
||||||
|
static std::mt19937 rng(rd());
|
||||||
|
|
||||||
std::unordered_set<std::string> stackableIds;
|
std::unordered_set<std::string> stackableIds;
|
||||||
stackableIds.insert(_camperItemIds.begin(), _camperItemIds.end());
|
stackableIds.insert(_camperItemIds.begin(), _camperItemIds.end());
|
||||||
stackableIds.insert(_camperOfferingIds.begin(), _camperOfferingIds.end());
|
stackableIds.insert(_camperOfferingIds.begin(), _camperOfferingIds.end());
|
||||||
stackableIds.insert(_camperAddonIds.begin(), _camperAddonIds.end());
|
stackableIds.insert(_camperAddonIds.begin(), _camperAddonIds.end());
|
||||||
stackableIds.insert(_slasherAddonIds.begin(), _slasherAddonIds.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())
|
||||||
@@ -266,7 +328,9 @@ 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);
|
||||||
|
|
||||||
@@ -382,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);
|
||||||
@@ -408,11 +485,11 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s
|
|||||||
|
|
||||||
if (body.find("NotAllowedException") != std::string::npos && body.find("not owned") != std::string::npos)
|
if (body.find("NotAllowedException") != std::string::npos && body.find("not owned") != std::string::npos)
|
||||||
{
|
{
|
||||||
Log::info("Spoofing bloodweb error error for unowned character");
|
Log::info("Spoofing bloodweb error for unowned character");
|
||||||
json mock;
|
json mock;
|
||||||
mock["bloodWebLevelChanged"] = false;
|
mock["bloodWebLevelChanged"] = false;
|
||||||
mock["updatedWallets"] = json::array();
|
mock["updatedWallets"] = json::array();
|
||||||
mock["bloodWebLevel"] = 15;
|
mock["bloodWebLevel"] = 16;
|
||||||
mock["prestigeLevel"] = 0;
|
mock["prestigeLevel"] = 0;
|
||||||
mock["bloodWebData"] = {{"ringData", json::array()}, {"paths", json::array()}};
|
mock["bloodWebData"] = {{"ringData", json::array()}, {"paths", json::array()}};
|
||||||
mock["characterItems"] = json::array();
|
mock["characterItems"] = json::array();
|
||||||
@@ -421,10 +498,7 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s
|
|||||||
modifyCharacterData(mock);
|
modifyCharacterData(mock);
|
||||||
|
|
||||||
size_t firstSpace = respHeaders.find(' ');
|
size_t firstSpace = respHeaders.find(' ');
|
||||||
if (firstSpace != std::string::npos)
|
if (firstSpace != std::string::npos) respHeaders.replace(firstSpace + 1, 3, "200");
|
||||||
{
|
|
||||||
respHeaders.replace(firstSpace + 1, 3, "200");
|
|
||||||
}
|
|
||||||
|
|
||||||
body = mock.dump();
|
body = mock.dump();
|
||||||
return;
|
return;
|
||||||
@@ -444,7 +518,7 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spoofer::clientRequestHandler(const std::string& url, const std::string& body, std::string& /*reqHeaders*/)
|
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 ||
|
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)
|
url.find("api/v1/dbd-character-data/bulk-spending-bloodweb") != std::string::npos)
|
||||||
|
|||||||
@@ -22,7 +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);
|
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user