Compare commits
32 Commits
4a71bc6f1b
...
v0.1.35
| Author | SHA1 | Date | |
|---|---|---|---|
| 9637931164 | |||
| 290307aa84 | |||
| f3552ce79c | |||
| 441c49d31a | |||
| e282a10f4d | |||
| 8f6fbbb244 | |||
| 5adf5e6417 | |||
| a421793a54 | |||
| bda519e70a | |||
| b7aa912e1b | |||
| 7db8048469 | |||
| 091418eb53 | |||
| 533b992a45 | |||
| 937734ff7b | |||
| 72c5466ce6 | |||
| 8a828db908 | |||
| 3b461cd845 | |||
| b2dfd9e1e5 | |||
| 448f6b7167 | |||
| ebe2000993 | |||
| 26038a03d1 | |||
| 698ac445e0 | |||
| 45431e29f1 | |||
| 5bd481eb1e | |||
| 4559b9d4ec | |||
| de418a6568 | |||
| 2bf8407640 | |||
| a8b5e0148f | |||
| 50413eb420 | |||
| ea49c39e53 | |||
| f599a9a648 | |||
| b8b24a5c30 |
@@ -7,3 +7,6 @@
|
|||||||
[submodule "vendor/json"]
|
[submodule "vendor/json"]
|
||||||
path = vendor/json
|
path = vendor/json
|
||||||
url = https://github.com/nlohmann/json
|
url = https://github.com/nlohmann/json
|
||||||
|
[submodule "vendor/zlib"]
|
||||||
|
path = vendor/zlib
|
||||||
|
url = https://github.com/madler/zlib
|
||||||
|
|||||||
+1
-1
@@ -76,7 +76,7 @@ add_executable(dbd-unlocker ${UNLOCKER_SOURCES})
|
|||||||
string(RANDOM LENGTH 12 ALPHABET "abcdefghijklmnopqrstuvwxyz0123456789" RANDOM_EXE_NAME)
|
string(RANDOM LENGTH 12 ALPHABET "abcdefghijklmnopqrstuvwxyz0123456789" RANDOM_EXE_NAME)
|
||||||
set_target_properties(dbd-unlocker PROPERTIES OUTPUT_NAME "${RANDOM_EXE_NAME}")
|
set_target_properties(dbd-unlocker PROPERTIES OUTPUT_NAME "${RANDOM_EXE_NAME}")
|
||||||
|
|
||||||
target_link_libraries(dbd-unlocker PRIVATE dbd-unlocker-warnings OpenSSL::SSL OpenSSL::Crypto nerutils wsock32 ws2_32 wininet crypt32 nlohmann_json)
|
target_link_libraries(dbd-unlocker PRIVATE dbd-unlocker-warnings OpenSSL::SSL OpenSSL::Crypto nerutils wsock32 ws2_32 wininet crypt32 nlohmann_json zlibstatic )
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
target_link_options(dbd-unlocker PRIVATE -static -static-libgcc -static-libstdc++)
|
target_link_options(dbd-unlocker PRIVATE -static -static-libgcc -static-libstdc++)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,95 @@
|
|||||||
|
[
|
||||||
|
"Ace",
|
||||||
|
"Adam",
|
||||||
|
"Ash",
|
||||||
|
"Bear",
|
||||||
|
"Bill",
|
||||||
|
"Bob",
|
||||||
|
"Cannibal",
|
||||||
|
"Chuckles",
|
||||||
|
"Claudette",
|
||||||
|
"Clown",
|
||||||
|
"Demogorgon",
|
||||||
|
"Dwight",
|
||||||
|
"Eric",
|
||||||
|
"Feng",
|
||||||
|
"Ghostface",
|
||||||
|
"Gunslinger",
|
||||||
|
"HillBilly",
|
||||||
|
"Jake",
|
||||||
|
"Jane",
|
||||||
|
"Jeff",
|
||||||
|
"K20",
|
||||||
|
"K21",
|
||||||
|
"K22",
|
||||||
|
"K23",
|
||||||
|
"K24",
|
||||||
|
"K25",
|
||||||
|
"K26",
|
||||||
|
"K27",
|
||||||
|
"K28",
|
||||||
|
"K29",
|
||||||
|
"K30",
|
||||||
|
"K31",
|
||||||
|
"K32",
|
||||||
|
"K33",
|
||||||
|
"K34",
|
||||||
|
"K35",
|
||||||
|
"K36",
|
||||||
|
"K37",
|
||||||
|
"K38",
|
||||||
|
"K39",
|
||||||
|
"K40",
|
||||||
|
"K41",
|
||||||
|
"K42",
|
||||||
|
"Kate",
|
||||||
|
"Killer07",
|
||||||
|
"Laurie",
|
||||||
|
"Legion",
|
||||||
|
"Meg",
|
||||||
|
"Nancy",
|
||||||
|
"Nea",
|
||||||
|
"Nightmare",
|
||||||
|
"Nurse",
|
||||||
|
"Oni",
|
||||||
|
"Pig",
|
||||||
|
"Plague",
|
||||||
|
"Quentin",
|
||||||
|
"S22",
|
||||||
|
"S23",
|
||||||
|
"S24",
|
||||||
|
"S25",
|
||||||
|
"S26",
|
||||||
|
"S27",
|
||||||
|
"S28",
|
||||||
|
"S29",
|
||||||
|
"S30",
|
||||||
|
"S31",
|
||||||
|
"S32",
|
||||||
|
"S33",
|
||||||
|
"S34",
|
||||||
|
"S35",
|
||||||
|
"S36",
|
||||||
|
"S37",
|
||||||
|
"S38",
|
||||||
|
"S39",
|
||||||
|
"S40",
|
||||||
|
"S41",
|
||||||
|
"S42",
|
||||||
|
"S43",
|
||||||
|
"S44",
|
||||||
|
"S45",
|
||||||
|
"S46",
|
||||||
|
"S47",
|
||||||
|
"S48",
|
||||||
|
"S49",
|
||||||
|
"S50",
|
||||||
|
"S51",
|
||||||
|
"Shape",
|
||||||
|
"Smoke",
|
||||||
|
"Spirit",
|
||||||
|
"Steve",
|
||||||
|
"Witch",
|
||||||
|
"Yui",
|
||||||
|
"Zarina"
|
||||||
|
]
|
||||||
File diff suppressed because it is too large
Load Diff
+427
@@ -0,0 +1,427 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "The 80's Suitcase",
|
||||||
|
"grdk": "9NF6VS6NVC2P",
|
||||||
|
"egs": "a1f208be98e64c5ea5e946b86f7d19c3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ACPack_01",
|
||||||
|
"grdk": "9N4LWJH8J800",
|
||||||
|
"egs": "168d750b4a6f451ca6eb68618a741f2c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ACPack_02",
|
||||||
|
"grdk": "9NSD3C05HVNM",
|
||||||
|
"egs": "d9ba2a71c7664785a1cfff524edb768c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ACPack_03",
|
||||||
|
"grdk": "9N6FGJW61X23",
|
||||||
|
"egs": "81c99b3171f941ff9f7915b51e371f05"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ACPack_04",
|
||||||
|
"grdk": "9PLG9SM9GNLM",
|
||||||
|
"egs": "916bfd0101c24561b75e984751e46e95"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ACPack_05",
|
||||||
|
"grdk": "9N310FS0QMG8",
|
||||||
|
"egs": "920f365a9b454af3a9bc675f839bed64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ACPack_06",
|
||||||
|
"grdk": "9N82ZN5T0VB3",
|
||||||
|
"egs": "87bb22af1b6c4ee19404b34b7321fb4c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "All Things Wicked Chapter",
|
||||||
|
"grdk": "9NLCTCL61ZZ2",
|
||||||
|
"egs": "9a0c250555c14679a6208e57d89918d2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A Binding of Kin Chapter",
|
||||||
|
"grdk": "9N02CL4TC7CQ",
|
||||||
|
"egs": "ffda316a960d4f41930027dbe0772e0f"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BaseGame",
|
||||||
|
"grdk": "9NMS4SFNBGBH",
|
||||||
|
"egs": "daedda2898b74feeac35f222ef02539a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Leatherface\u2122 Chapter",
|
||||||
|
"grdk": "9NKNQ2DZMLZW",
|
||||||
|
"egs": "06f5b0d8cf56445390f14516b28ea5c2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ChineseEventOct2017",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Dungeons & Dragons Chapter",
|
||||||
|
"grdk": "9PCWX77XPKLP",
|
||||||
|
"egs": "19bb1e99cbaa41b08fa06ddde6befa28"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ChurrosCust",
|
||||||
|
"grdk": "9PC5X94ST9QK",
|
||||||
|
"egs": "f5940ef33904476b945229c70c0508b3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "All Kill Chapter",
|
||||||
|
"grdk": "9N54CBKZBV44",
|
||||||
|
"egs": "87fafa3c2a724dddb87fb2a5cd350dae"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DeathGarden",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tomb Raider Chapter",
|
||||||
|
"grdk": "9P7BL680J1XZ",
|
||||||
|
"egs": "b12e9ce935c04bda8624a02d5d14ea02"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DonutCust",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Terror Expansion Pack",
|
||||||
|
"grdk": "9N343FZ245RD",
|
||||||
|
"egs": "489ff36aa1ba47089591bf623f0af9df"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Escape Expansion Pack",
|
||||||
|
"grdk": "9NR9FPF9G79L",
|
||||||
|
"egs": "f8c85b036b0c418097f7abf10384c821"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Castlevania Chapter",
|
||||||
|
"grdk": "9NGXBJNF1C13",
|
||||||
|
"egs": "18a5a780992347afa03d190a9c1927f9"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Resident Evil Chapter",
|
||||||
|
"grdk": "9P29W29LSSG2",
|
||||||
|
"egs": "dbf62759c9cc439699256801ee09095c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "EpicBrillFreeWeek",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": "a9e88f5bd1a047539c772370f15deb48"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "EpicBrillGeneral",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": "daedda2898b74feeac35f222ef02539a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "The Saw\u00ae Chapter",
|
||||||
|
"grdk": "9N2P7KNZ816R",
|
||||||
|
"egs": "18b030008f8847af868aff2f0eaab510"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "GStar2017",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Doomed Course Chapter",
|
||||||
|
"grdk": "9P4PV6KXJGL2",
|
||||||
|
"egs": "80cf38fedc164b2c97d6d9570a9ab2cc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Hellraiser Chapter",
|
||||||
|
"grdk": "9PJNHM94SW0S",
|
||||||
|
"egs": "bc146268c50b4716a65a132a70d12c0a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Curtain Call Chapter",
|
||||||
|
"grdk": "9P0HLNG7X2D0",
|
||||||
|
"egs": "2e8b8ed7a3cd481abcae1f7986153e50"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Shattered Bloodline Chapter",
|
||||||
|
"grdk": "9N78HGQN56L7",
|
||||||
|
"egs": "ca6f548dabef4026b804aaa0a606a8fa"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Maddening Darkness Pack",
|
||||||
|
"grdk": "9NB4CC8GN5S7",
|
||||||
|
"egs": "c8d9fd67a4184f069c3c080f104b89a4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Old Wounds Pack",
|
||||||
|
"grdk": "9NGRVV847PN9",
|
||||||
|
"egs": "ac0bf77a00eb43cd822b8ac3690f3731"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Macabre Tales Pack",
|
||||||
|
"grdk": "9NP99MKHQHZS",
|
||||||
|
"egs": "b96de0a9a2294e69a6fb0667ef6ddf74"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Endless Hunt Pack",
|
||||||
|
"grdk": "9NVVCQKVPTQR",
|
||||||
|
"egs": "e0d3d8e56d934016be3ebf74c5ecc85e"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Hour of The Witch Chapter",
|
||||||
|
"grdk": "9N1XTPLC8DGB",
|
||||||
|
"egs": "4eb6bf2cdef2438b924c5d8cd2137cc5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tokyo Ghoul Chapter",
|
||||||
|
"grdk": "9NRWN81GQ9CJ",
|
||||||
|
"egs": "cee46f4734a94018be459b5a642f0536"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "@#DLC_IcecreamCust_SHORT_NAME",
|
||||||
|
"grdk": "9NPTQDMHG1DT",
|
||||||
|
"egs": "71836318753941dd8efb7ab68575005b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Portrait of a Murder Chapter",
|
||||||
|
"grdk": "9NZFJHT080C9",
|
||||||
|
"egs": "9e8f8dace7a243c480c6d6d06ab429c9"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Steady Pulse Chapter",
|
||||||
|
"grdk": "9P7GG0L4LJBN",
|
||||||
|
"egs": "e65a462d873046499c01f29910b00b1a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Kabuki",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Darkness Among Us Chapter",
|
||||||
|
"grdk": "9P62QBBJZSD4",
|
||||||
|
"egs": "268cae6e74134dee92198670d7b30bcc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Sadako Rising Chapter",
|
||||||
|
"grdk": "9PKPS8SDQQM8",
|
||||||
|
"egs": "1f3b9ad501c24864b20a9e6faef38310"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Five Nights at Freddy's Chapter",
|
||||||
|
"grdk": "9NK4H61J4B39",
|
||||||
|
"egs": "ea868d5b96b94b8ba2c2392d9a8505c0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "The Walking Dead Chapter",
|
||||||
|
"grdk": "9NZJ81G57RGT",
|
||||||
|
"egs": "f7dfa0fab53146358c1f87bc08d00b7c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Demise of the Faithful Chapter",
|
||||||
|
"grdk": "9N29SR96GQS4",
|
||||||
|
"egs": "4f8625dec370441da5fd0a11ff0732d8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Sinister Grace Chapter",
|
||||||
|
"grdk": "9N7WDS85VBZG",
|
||||||
|
"egs": "8ddd7882dca64a5f80ec9f1bea49892d"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Roots of Dread Chapter",
|
||||||
|
"grdk": "9PKZR14F59HK",
|
||||||
|
"egs": "511e4db16dc544faa03b8fb6811efcc5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Ash vs Evil Dead Chapter",
|
||||||
|
"grdk": "9N55M38QNMCS",
|
||||||
|
"egs": "f8ead4a3752f41e69632bfce9838ca9b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Ghost Face\u00ae Chapter",
|
||||||
|
"grdk": "9NMC8SZPD9GF",
|
||||||
|
"egs": "cd2c0734ab444693884d200be769be0c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "@#DLC_Omelet_SHORT_NAME",
|
||||||
|
"grdk": "9NMS4SFNBGBH",
|
||||||
|
"egs": "daedda2898b74feeac35f222ef02539a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Resident Evil: PROJECT W Chapter",
|
||||||
|
"grdk": "9P47ZQQJM1N4",
|
||||||
|
"egs": "a523401428b54369880fd3e9d343ffe8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Resident Evil: Project W Chapter",
|
||||||
|
"grdk": "9NX0ZCNSRNR1",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Stranger Things Chapter 2",
|
||||||
|
"grdk": "9PJ0JD3ZWTBX",
|
||||||
|
"egs": "76d10ee1eacd469797a5d13bddd3850a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Pulcinella Chapter",
|
||||||
|
"grdk": "9MTC8NRZLQ5T",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Stranger Things Chapter",
|
||||||
|
"grdk": "9MSMWW173HB5",
|
||||||
|
"egs": "42e370c2688e4e96a7bf67d87a01874a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Forged in Fog Chapter",
|
||||||
|
"grdk": "9N6Z2RG4GSD4",
|
||||||
|
"egs": "f6ac362ab0aa462e894e698682a92801"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "All-Kill: Comeback Chapter",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A Nightmare on Elm Street\u2122 Chapter",
|
||||||
|
"grdk": "9NW2X83B4JJV",
|
||||||
|
"egs": "439c3c5df54b468696f880401660d7ad"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tools of Torment Chapter",
|
||||||
|
"grdk": "9PCSC363JX1B",
|
||||||
|
"egs": "e3ec01697342406c89110b8d117eccaf"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "StoreItem",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Cursed Legacy Chapter",
|
||||||
|
"grdk": "9NJG10XN1LGL",
|
||||||
|
"egs": "01bbc39db2f446daab0b283343fc99c8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Chains of Hate Chapter",
|
||||||
|
"grdk": "9PK2JHM3C71C",
|
||||||
|
"egs": "9a109c018e17400eae350a423e595107"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "End Transmission Chapter",
|
||||||
|
"grdk": "9N5390XWCVZ6",
|
||||||
|
"egs": "19e7cf4f9329474fa0a2692a14e37fe2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Attack on Titans Armored Chapter",
|
||||||
|
"grdk": "9P4SDDKMV045",
|
||||||
|
"egs": "956738aff598412c9a5247cfc7dae735"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Attack on Titans War Hammer Chapter",
|
||||||
|
"grdk": "9NRRQPTBW978",
|
||||||
|
"egs": "7dbb037c212947fc8011d0c934dd89f5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Nicolas Cage Chapter",
|
||||||
|
"grdk": "9NCZMBJCLTJ3",
|
||||||
|
"egs": "29fe12a4cb51431793239261cb1fd8c3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Silent Hill Chapter",
|
||||||
|
"grdk": "9NWVSBTG89KQ",
|
||||||
|
"egs": "e7d0828eb497411c813951058d8fd931"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Silent Hill Chapter",
|
||||||
|
"grdk": "9PHV0FJ8HXVJ",
|
||||||
|
"egs": "3280c01d39a74adc83be41e3fd74b5d1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "WinterEvent2017",
|
||||||
|
"grdk": "9NMS4SFNBGBH",
|
||||||
|
"egs": "daedda2898b74feeac35f222ef02539a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Alien Chapter",
|
||||||
|
"grdk": "9NC2M3W7NHB5",
|
||||||
|
"egs": "4ebd4f31838549e38eecb23130e57700"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "XboxPerkNov2020",
|
||||||
|
"grdk": "9N2DHTZ1D9CC",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Descend Beyond Chapter",
|
||||||
|
"grdk": "9NFXH0QD1M7C",
|
||||||
|
"egs": "89120707a96a4210a9e23dced174632e"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Chucky Chapter",
|
||||||
|
"grdk": "9P0NJ7CS0TM1",
|
||||||
|
"egs": "f1e1bce49652456e85de167fbcc52a6a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Alan Wake Chapter",
|
||||||
|
"grdk": "9MZ841F14MXK",
|
||||||
|
"egs": "8fbd0077488b4334ae91de61588870ff"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "bloodletting",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "The Bloodstained Sack",
|
||||||
|
"grdk": "9NW55H5J9NH2",
|
||||||
|
"egs": "abc74084457d46f5a51f062f540bdeee"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "A Lullaby for the Dark Chapter",
|
||||||
|
"grdk": "9NMS4SFNBGBH",
|
||||||
|
"egs": "daedda2898b74feeac35f222ef02539a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Charity Case",
|
||||||
|
"grdk": "9P1CNFD3MMC7",
|
||||||
|
"egs": "0885718299d640708080b66ddb9dceb1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "development",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Of Flesh and Mud Chapter",
|
||||||
|
"grdk": "9NJQTSL5PZJL",
|
||||||
|
"egs": "b18a490a58d548588eb60c2fd6b4c3cc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Halloween\u00ae Chapter",
|
||||||
|
"grdk": "9NJ77BPBRSFH",
|
||||||
|
"egs": "c9d4a48a9576483fb6ba27a99bcb3780"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Headcase",
|
||||||
|
"grdk": "9NCLGTXXZ18Q",
|
||||||
|
"egs": "93f4e154df3a4254a0ece7241659d84e"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "The Last Breath Chapter",
|
||||||
|
"grdk": "9NMS4SFNBGBH",
|
||||||
|
"egs": "daedda2898b74feeac35f222ef02539a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Spark of Madness Chapter",
|
||||||
|
"grdk": "9NX58MLKKQWD",
|
||||||
|
"egs": "4b9c8d9424ca4a2899505254ba46b109"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "steamOnly",
|
||||||
|
"grdk": "9ZZZZZZZZZZZ",
|
||||||
|
"egs": ""
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Campers": [
|
"Campers": [
|
||||||
"Father_Key_Card",
|
|
||||||
"FireflyLantern",
|
"FireflyLantern",
|
||||||
"Item_Camper_AlexsToolbox",
|
"Item_Camper_AlexsToolbox",
|
||||||
"Item_Camper_AnniversaryToolbox",
|
"Item_Camper_AnniversaryToolbox",
|
||||||
@@ -25,7 +24,6 @@
|
|||||||
"Item_Camper_JerryCan_Spring2025",
|
"Item_Camper_JerryCan_Spring2025",
|
||||||
"Item_Camper_K29InfectionRemover",
|
"Item_Camper_K29InfectionRemover",
|
||||||
"Item_Camper_K32Emp",
|
"Item_Camper_K32Emp",
|
||||||
"Item_Camper_K33Turret",
|
|
||||||
"Item_Camper_K36MagicItem_Boots",
|
"Item_Camper_K36MagicItem_Boots",
|
||||||
"Item_Camper_K36MagicItem_Bracers",
|
"Item_Camper_K36MagicItem_Bracers",
|
||||||
"Item_Camper_K36MagicItem_VecnaEye",
|
"Item_Camper_K36MagicItem_VecnaEye",
|
||||||
@@ -44,7 +42,6 @@
|
|||||||
"Item_Camper_MedKit03",
|
"Item_Camper_MedKit03",
|
||||||
"Item_Camper_MedKit04",
|
"Item_Camper_MedKit04",
|
||||||
"Item_Camper_Medkit05",
|
"Item_Camper_Medkit05",
|
||||||
"Item_Camper_OnryoTape",
|
|
||||||
"Item_Camper_RainbowMap",
|
"Item_Camper_RainbowMap",
|
||||||
"Item_Camper_Toolbox",
|
"Item_Camper_Toolbox",
|
||||||
"Item_Camper_Toolbox_Anniversary2022",
|
"Item_Camper_Toolbox_Anniversary2022",
|
||||||
@@ -52,56 +49,10 @@
|
|||||||
"Item_Camper_VoidBomb_Halloween2024",
|
"Item_Camper_VoidBomb_Halloween2024",
|
||||||
"Item_Camper_WornoutToolbox",
|
"Item_Camper_WornoutToolbox",
|
||||||
"Item_FragileObject",
|
"Item_FragileObject",
|
||||||
"Item_LamentConfiguration",
|
|
||||||
"Item_Survivor_CalamariContaminationAntidote",
|
"Item_Survivor_CalamariContaminationAntidote",
|
||||||
"Item_Survivor_K41Mushroom",
|
"Item_Survivor_K41Mushroom",
|
||||||
"Item_Survivor_MakeshiftFogVial",
|
"Item_Survivor_MakeshiftFogVial",
|
||||||
"Item_Survivor_PrototypeFogVial",
|
"Item_Survivor_PrototypeFogVial",
|
||||||
"Item_Survivor_VigosFogVial"
|
"Item_Survivor_VigosFogVial"
|
||||||
],
|
|
||||||
"Slashers": [
|
|
||||||
"Item_Blighted_Serum",
|
|
||||||
"Item_Slasher_Beartrap",
|
|
||||||
"Item_Slasher_Blinker",
|
|
||||||
"Item_Slasher_Chainsaw",
|
|
||||||
"Item_Slasher_CloakBell",
|
|
||||||
"Item_Slasher_DreamInducer",
|
|
||||||
"Item_Slasher_Frenzy",
|
|
||||||
"Item_Slasher_GasBomb",
|
|
||||||
"Item_Slasher_GhostPower",
|
|
||||||
"Item_Slasher_HarpoonRifle",
|
|
||||||
"Item_Slasher_Hatchet",
|
|
||||||
"Item_Slasher_K21Power",
|
|
||||||
"Item_Slasher_K22Power",
|
|
||||||
"Item_Slasher_K24Power",
|
|
||||||
"Item_Slasher_K25Power",
|
|
||||||
"Item_Slasher_K26Power",
|
|
||||||
"Item_Slasher_K27Power",
|
|
||||||
"Item_Slasher_K28Power",
|
|
||||||
"Item_Slasher_K29Power",
|
|
||||||
"Item_Slasher_K30Power",
|
|
||||||
"Item_Slasher_K31Power",
|
|
||||||
"Item_Slasher_K32Power",
|
|
||||||
"Item_Slasher_K33Power",
|
|
||||||
"Item_Slasher_K34Power",
|
|
||||||
"Item_Slasher_K35Power",
|
|
||||||
"Item_Slasher_K36Power",
|
|
||||||
"Item_Slasher_K37Power",
|
|
||||||
"Item_Slasher_K38Power",
|
|
||||||
"Item_Slasher_K39Power",
|
|
||||||
"Item_Slasher_K40Power",
|
|
||||||
"Item_Slasher_K41Power",
|
|
||||||
"Item_Slasher_K42Power",
|
|
||||||
"Item_Slasher_Kanobo",
|
|
||||||
"Item_Slasher_Killer07Item",
|
|
||||||
"Item_Slasher_LFChainsaw",
|
|
||||||
"Item_Slasher_PhantomTrap",
|
|
||||||
"Item_Slasher_PhaseWalker",
|
|
||||||
"Item_Slasher_PlaguePower",
|
|
||||||
"Item_Slasher_QatarKillerPower",
|
|
||||||
"Item_Slasher_ReverseBearTrap",
|
|
||||||
"Item_Slasher_Stalker",
|
|
||||||
"Item_Slasher_ThrowingKnives",
|
|
||||||
"Item_Slasher_TormentMode"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
+30
-28
@@ -32,6 +32,36 @@
|
|||||||
"TanagerWreath"
|
"TanagerWreath"
|
||||||
],
|
],
|
||||||
"Campers": [
|
"Campers": [
|
||||||
|
"BlackSaltStatuette",
|
||||||
|
"BogLaurelSachet",
|
||||||
|
"BoundEnvelope",
|
||||||
|
"ChalkPouch",
|
||||||
|
"CreamChalkPouch",
|
||||||
|
"CrispleafAmaranthSachet",
|
||||||
|
"EscapeCake",
|
||||||
|
"FragrantBogLaurel",
|
||||||
|
"FragrantCrispleafAmaranth",
|
||||||
|
"FragrantPrimroseBlossom",
|
||||||
|
"FragrantSweetWilliam",
|
||||||
|
"FreshBogLaurel",
|
||||||
|
"FreshCrispleafAmaranth",
|
||||||
|
"FreshPrimroseBlossom",
|
||||||
|
"FreshSweetWilliam",
|
||||||
|
"IvoryChalkPouch",
|
||||||
|
"PetrifiedOak",
|
||||||
|
"PrimroseBlossomSachet",
|
||||||
|
"SaltPouch",
|
||||||
|
"SealedEnvelope",
|
||||||
|
"ShinyCoin",
|
||||||
|
"ShroudofBinding",
|
||||||
|
"ShroudofUnion",
|
||||||
|
"SweetWilliamSachet",
|
||||||
|
"TarnishedCoin",
|
||||||
|
"VigosJarOfSaltyLips",
|
||||||
|
"VigosShroud",
|
||||||
|
"WhiteWard"
|
||||||
|
],
|
||||||
|
"All": [
|
||||||
"Anniversary2019Offering",
|
"Anniversary2019Offering",
|
||||||
"Anniversary2020Offering",
|
"Anniversary2020Offering",
|
||||||
"Anniversary2021Offering",
|
"Anniversary2021Offering",
|
||||||
@@ -41,33 +71,18 @@
|
|||||||
"Anniversary2025Offering",
|
"Anniversary2025Offering",
|
||||||
"AnnotatedBlueprint",
|
"AnnotatedBlueprint",
|
||||||
"AzarovKey",
|
"AzarovKey",
|
||||||
"BlackSaltStatuette",
|
|
||||||
"BloodiedBlueprint",
|
"BloodiedBlueprint",
|
||||||
"BloodyPartyStreamers",
|
"BloodyPartyStreamers",
|
||||||
"BogLaurelSachet",
|
|
||||||
"BoundEnvelope",
|
|
||||||
"CattleTag28",
|
"CattleTag28",
|
||||||
"ChalkPouch",
|
|
||||||
"CharredWeddingPhotograph",
|
"CharredWeddingPhotograph",
|
||||||
"ChildrensBook",
|
"ChildrensBook",
|
||||||
"ClearReagent",
|
"ClearReagent",
|
||||||
"ColdwindCattleTag81",
|
"ColdwindCattleTag81",
|
||||||
"CreamChalkPouch",
|
|
||||||
"CrescentMoonBouquet",
|
"CrescentMoonBouquet",
|
||||||
"CrispleafAmaranthSachet",
|
|
||||||
"DecrepitClapboard",
|
"DecrepitClapboard",
|
||||||
"EclipseThemeOffering",
|
"EclipseThemeOffering",
|
||||||
"EmergencyCertificate",
|
"EmergencyCertificate",
|
||||||
"EscapeCake",
|
|
||||||
"FaintReagent",
|
"FaintReagent",
|
||||||
"FragrantBogLaurel",
|
|
||||||
"FragrantCrispleafAmaranth",
|
|
||||||
"FragrantPrimroseBlossom",
|
|
||||||
"FragrantSweetWilliam",
|
|
||||||
"FreshBogLaurel",
|
|
||||||
"FreshCrispleafAmaranth",
|
|
||||||
"FreshPrimroseBlossom",
|
|
||||||
"FreshSweetWilliam",
|
|
||||||
"FullMoonBouquet",
|
"FullMoonBouquet",
|
||||||
"FumingCordage",
|
"FumingCordage",
|
||||||
"FumingWelcomeSign",
|
"FumingWelcomeSign",
|
||||||
@@ -79,7 +94,6 @@
|
|||||||
"HazyReagent",
|
"HazyReagent",
|
||||||
"HeartLocket",
|
"HeartLocket",
|
||||||
"IonThemeOffering",
|
"IonThemeOffering",
|
||||||
"IvoryChalkPouch",
|
|
||||||
"JapaneseCountrySide",
|
"JapaneseCountrySide",
|
||||||
"Jigsawpiece",
|
"Jigsawpiece",
|
||||||
"KenyaThemeOffering",
|
"KenyaThemeOffering",
|
||||||
@@ -91,8 +105,6 @@
|
|||||||
"NewMoonBouquet",
|
"NewMoonBouquet",
|
||||||
"PaintedRiverRock",
|
"PaintedRiverRock",
|
||||||
"PElliotLunacyTicket",
|
"PElliotLunacyTicket",
|
||||||
"PetrifiedOak",
|
|
||||||
"PrimroseBlossomSachet",
|
|
||||||
"PsychiatricAssessmentReport",
|
"PsychiatricAssessmentReport",
|
||||||
"QatarThemeOffering",
|
"QatarThemeOffering",
|
||||||
"QuantumThemeOffering",
|
"QuantumThemeOffering",
|
||||||
@@ -100,30 +112,20 @@
|
|||||||
"QuicheThemeOffering",
|
"QuicheThemeOffering",
|
||||||
"RedMoney",
|
"RedMoney",
|
||||||
"SacrificalWard",
|
"SacrificalWard",
|
||||||
"SaltPouch",
|
|
||||||
"SealedEnvelope",
|
|
||||||
"ShatteredGlasses",
|
"ShatteredGlasses",
|
||||||
"ShinyCoin",
|
|
||||||
"ShreddedPlate",
|
"ShreddedPlate",
|
||||||
"ShroudofBinding",
|
|
||||||
"ShroudofUnion",
|
|
||||||
"SignedLedgerPage",
|
"SignedLedgerPage",
|
||||||
"Spring2024Offering",
|
"Spring2024Offering",
|
||||||
"StrodeRealtyKey",
|
"StrodeRealtyKey",
|
||||||
"SummerOffering",
|
"SummerOffering",
|
||||||
"SweetWilliamSachet",
|
|
||||||
"TarnishedCoin",
|
|
||||||
"TheLastMask",
|
"TheLastMask",
|
||||||
"ThePiedPiper",
|
"ThePiedPiper",
|
||||||
"TornBlueprint",
|
"TornBlueprint",
|
||||||
"UkraineThemeOffering",
|
"UkraineThemeOffering",
|
||||||
"UmbraThemeOffering",
|
"UmbraThemeOffering",
|
||||||
"VigosBlueprint",
|
"VigosBlueprint",
|
||||||
"VigosJarOfSaltyLips",
|
|
||||||
"VigosShroud",
|
|
||||||
"VirginiaPlate",
|
"VirginiaPlate",
|
||||||
"WalesThemeOffering",
|
"WalesThemeOffering",
|
||||||
"WhiteWard",
|
|
||||||
"Winter2024Offering",
|
"Winter2024Offering",
|
||||||
"WormholeThemeOffering"
|
"WormholeThemeOffering"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
public static class Constants
|
||||||
|
{
|
||||||
|
public static readonly string MappingURL = "https://git.neru.rip/neru/UnlockedByDaylight/raw/branch/main/res/mappings/latest-xbox.usmap";
|
||||||
|
|
||||||
|
public static readonly string PackageName = "BehaviourInteractive.DeadbyDaylightWindows";
|
||||||
|
|
||||||
|
public static readonly string AESKey = "0x22B1639B548124925CF7B9CBAA09F9AC295FCF0324586D6B37EE1D42670B39B3";
|
||||||
|
|
||||||
|
public static readonly string[] BlacklistedCustomizationItems = ["NK_Torso01_Crew01Kraken"];
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
public enum EItemAvailability : byte
|
||||||
|
{
|
||||||
|
Available,
|
||||||
|
Disabled,
|
||||||
|
Retired
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ECustomizationCategory : byte
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
SurvivorHead,
|
||||||
|
SurvivorTorso,
|
||||||
|
SurvivorLegs,
|
||||||
|
KillerHead,
|
||||||
|
KillerBody,
|
||||||
|
KillerWeapon,
|
||||||
|
Outfits,
|
||||||
|
Charm,
|
||||||
|
Badge,
|
||||||
|
Banner,
|
||||||
|
PortraitBackground
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum EPlayerRole : byte
|
||||||
|
{
|
||||||
|
VE_None,
|
||||||
|
VE_Slasher,
|
||||||
|
VE_Camper,
|
||||||
|
VE_Observer
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct AvailabilityStruct
|
||||||
|
{
|
||||||
|
public EItemAvailability itemAvailability;
|
||||||
|
public string DLCId;
|
||||||
|
public string[] AdditionalDlcIds;
|
||||||
|
public Int32 CloudInventoryId;
|
||||||
|
public string CommunityId;
|
||||||
|
public bool _isLicensed;
|
||||||
|
}
|
||||||
@@ -0,0 +1,404 @@
|
|||||||
|
using CUE4Parse.Compression;
|
||||||
|
using CUE4Parse.Encryption.Aes;
|
||||||
|
using CUE4Parse.FileProvider;
|
||||||
|
using CUE4Parse.MappingsProvider;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.Actor;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.Engine;
|
||||||
|
using CUE4Parse.UE4.Assets.Exports.Texture;
|
||||||
|
using CUE4Parse.UE4.Assets.Objects;
|
||||||
|
using CUE4Parse.UE4.Assets.Objects.Properties;
|
||||||
|
using CUE4Parse.UE4.Objects.Core.Misc;
|
||||||
|
using CUE4Parse.UE4.Versions;
|
||||||
|
using CUE4Parse.UE4.VirtualFileSystem;
|
||||||
|
using CUE4Parse.UE4.Wwise.Plugins.MasteringSuite;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
class Dumper
|
||||||
|
{
|
||||||
|
private DefaultFileProvider? _provider = null;
|
||||||
|
private IAesVfsReader? _dataPak = null;
|
||||||
|
|
||||||
|
public async Task<bool> InitAsync()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* ensure mapping
|
||||||
|
*/
|
||||||
|
string mappingPath = Path.Combine(Path.GetTempPath(), "DeadByDaylight.usmap");
|
||||||
|
bool hasDownloadedMapping = await DownloadMappingFileAsync(Constants.MappingURL, mappingPath);
|
||||||
|
if (!hasDownloadedMapping)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* compression setup
|
||||||
|
*/
|
||||||
|
ZlibHelper.Initialize();
|
||||||
|
|
||||||
|
var oodlePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, OodleHelper.OodleFileName);
|
||||||
|
OodleHelper.Initialize(oodlePath);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* game localization
|
||||||
|
*/
|
||||||
|
var gamePath = getGamePath();
|
||||||
|
if (gamePath == null) return false;
|
||||||
|
|
||||||
|
var pakDir = gamePath + "\\DeadByDaylight\\Content\\Paks";
|
||||||
|
if (!Directory.Exists(pakDir))
|
||||||
|
{
|
||||||
|
Console.WriteLine("PAK dir does not exist. (Invalid install?)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* provider setup
|
||||||
|
*/
|
||||||
|
var version = new VersionContainer(EGame.GAME_DeadByDaylight, ETexturePlatform.DesktopMobile);
|
||||||
|
_provider = new DefaultFileProvider(pakDir, SearchOption.TopDirectoryOnly, version);
|
||||||
|
_provider.MappingsContainer = new FileUsmapTypeMappingsProvider(mappingPath);
|
||||||
|
|
||||||
|
_provider.Initialize();
|
||||||
|
_provider.SubmitKey(new FGuid(), new FAesKey(Constants.AESKey));
|
||||||
|
_provider.Mount();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* load db pak
|
||||||
|
*/
|
||||||
|
bool hasDataPak = _provider.TryGetArchive("pakchunk4-WinGDK.utoc", out _dataPak);
|
||||||
|
if (!hasDataPak)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Failed to load pakchunk4-WinGDK.utoc");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string? DumpCustomizationItems()
|
||||||
|
{
|
||||||
|
if (_dataPak == null || _provider == null) return null;
|
||||||
|
|
||||||
|
var searchPaths = _dataPak.Files.Keys.Where(x => x.Contains($"/CustomizationItemDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
|
|
||||||
|
var characterItems = new List<string>();
|
||||||
|
var outfits = new List<string>();
|
||||||
|
|
||||||
|
foreach (var path in searchPaths)
|
||||||
|
{
|
||||||
|
var cleanPath = path.Contains('.') ? path.Substring(0, path.LastIndexOf('.')) : path;
|
||||||
|
if (_provider.TryLoadPackageObject<UDataTable>(cleanPath, out var dataTable))
|
||||||
|
{
|
||||||
|
foreach (var row in dataTable.RowMap)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* props
|
||||||
|
*/
|
||||||
|
var props = row.Value.Properties;
|
||||||
|
|
||||||
|
FPropertyTag? categoryProp = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Category");
|
||||||
|
if (categoryProp == null || categoryProp.Tag == null) continue;
|
||||||
|
|
||||||
|
FPropertyTag? availabilityProp = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Availability");
|
||||||
|
if (availabilityProp == null || availabilityProp.Tag == null) continue;
|
||||||
|
|
||||||
|
FStructFallback? availabilityFallback = availabilityProp.Tag.GetValue<FStructFallback>();
|
||||||
|
if (availabilityFallback == null) continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* real data
|
||||||
|
*/
|
||||||
|
string itemName = row.Key.Text;
|
||||||
|
AvailabilityStruct availability = availabilityFallback.MapToStruct<AvailabilityStruct>();
|
||||||
|
ECustomizationCategory category = categoryProp.Tag.GetValue<ECustomizationCategory>();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* sketchy item filtering
|
||||||
|
*/
|
||||||
|
if (availability.DLCId == "development") continue;
|
||||||
|
if (category < ECustomizationCategory.SurvivorHead || category > ECustomizationCategory.KillerWeapon) continue;
|
||||||
|
if (Constants.BlacklistedCustomizationItems.Contains(itemName)) continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* storing
|
||||||
|
*/
|
||||||
|
characterItems.Add(itemName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
searchPaths = _dataPak.Files.Keys.Where(x => x.Contains($"/OutfitDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
|
|
||||||
|
foreach (var path in searchPaths)
|
||||||
|
{
|
||||||
|
var cleanPath = path.Contains('.') ? path.Substring(0, path.LastIndexOf('.')) : path;
|
||||||
|
if (_provider.TryLoadPackageObject<UDataTable>(cleanPath, out var dataTable))
|
||||||
|
{
|
||||||
|
foreach (var row in dataTable.RowMap)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* props
|
||||||
|
*/
|
||||||
|
var props = row.Value.Properties;
|
||||||
|
|
||||||
|
FPropertyTag? availabilityProp = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Availability");
|
||||||
|
if (availabilityProp == null || availabilityProp.Tag == null) continue;
|
||||||
|
|
||||||
|
FStructFallback? availabilityFallback = availabilityProp.Tag.GetValue<FStructFallback>();
|
||||||
|
if (availabilityFallback == null) continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* real data
|
||||||
|
*/
|
||||||
|
string outfitName = row.Key.Text;
|
||||||
|
AvailabilityStruct availability = availabilityFallback.MapToStruct<AvailabilityStruct>();
|
||||||
|
|
||||||
|
if (availability.DLCId == "development")
|
||||||
|
continue;
|
||||||
|
|
||||||
|
outfits.Add(outfitName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var customizationsSerialized = new
|
||||||
|
{
|
||||||
|
Items = characterItems.OrderBy(x => x).ToList(),
|
||||||
|
Outfits = outfits.OrderBy(x => x).ToList()
|
||||||
|
};
|
||||||
|
|
||||||
|
return JsonConvert.SerializeObject(customizationsSerialized, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string? DumpItems()
|
||||||
|
{
|
||||||
|
if (_dataPak == null || _provider == null) return null;
|
||||||
|
|
||||||
|
var searchPaths = _dataPak.Files.Keys.Where(x => x.Contains($"/ItemDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
|
|
||||||
|
var camperItems = new List<string>();
|
||||||
|
//var slasherPowers = new List<string>();
|
||||||
|
|
||||||
|
foreach (var path in searchPaths)
|
||||||
|
{
|
||||||
|
var cleanPath = path.Contains('.') ? path.Substring(0, path.LastIndexOf('.')) : path;
|
||||||
|
if (_provider.TryLoadPackageObject<UDataTable>(cleanPath, out var dataTable))
|
||||||
|
{
|
||||||
|
foreach (var row in dataTable.RowMap)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* props
|
||||||
|
*/
|
||||||
|
var props = row.Value.Properties;
|
||||||
|
|
||||||
|
FPropertyTag? roleProp = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Role");
|
||||||
|
if (roleProp == null || roleProp.Tag == null) continue;
|
||||||
|
|
||||||
|
//FPropertyTag? typeProp = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Type");
|
||||||
|
//if (typeProp == null || typeProp.Tag == null) continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* real data
|
||||||
|
*/
|
||||||
|
string itemName = row.Key.Text;
|
||||||
|
EPlayerRole role = roleProp.Tag.GetValue<EPlayerRole>();
|
||||||
|
|
||||||
|
if (role == EPlayerRole.VE_Camper)
|
||||||
|
camperItems.Add(itemName);
|
||||||
|
//else
|
||||||
|
// slasherPowers.Add(itemName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var itemsSerialized = new
|
||||||
|
{
|
||||||
|
Campers = camperItems.OrderBy(x => x).ToList()
|
||||||
|
};
|
||||||
|
|
||||||
|
return JsonConvert.SerializeObject(itemsSerialized, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string? DumpAddons()
|
||||||
|
{
|
||||||
|
if (_dataPak == null || _provider == null) return null;
|
||||||
|
|
||||||
|
var searchPaths = _dataPak.Files.Keys.Where(x => x.Contains($"/ItemAddonDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
|
|
||||||
|
var camperAddons = new List<string>();
|
||||||
|
var slasherAddons = new List<string>();
|
||||||
|
|
||||||
|
foreach (var path in searchPaths)
|
||||||
|
{
|
||||||
|
var cleanPath = path.Contains('.') ? path.Substring(0, path.LastIndexOf('.')) : path;
|
||||||
|
if (_provider.TryLoadPackageObject<UDataTable>(cleanPath, out var dataTable))
|
||||||
|
{
|
||||||
|
foreach (var row in dataTable.RowMap)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* props
|
||||||
|
*/
|
||||||
|
var props = row.Value.Properties;
|
||||||
|
|
||||||
|
FPropertyTag? roleProp = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Role");
|
||||||
|
if (roleProp == null || roleProp.Tag == null) continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* real data
|
||||||
|
*/
|
||||||
|
string itemName = row.Key.Text;
|
||||||
|
EPlayerRole role = roleProp.Tag.GetValue<EPlayerRole>();
|
||||||
|
|
||||||
|
if (role == EPlayerRole.VE_Camper)
|
||||||
|
camperAddons.Add(itemName);
|
||||||
|
else
|
||||||
|
slasherAddons.Add(itemName);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var addonsSerialized = new
|
||||||
|
{
|
||||||
|
Slashers = slasherAddons.OrderBy(x => x).ToList(),
|
||||||
|
Campers = camperAddons.OrderBy(x => x).ToList()
|
||||||
|
};
|
||||||
|
|
||||||
|
return JsonConvert.SerializeObject(addonsSerialized, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string? DumpOfferings()
|
||||||
|
{
|
||||||
|
if (_dataPak == null || _provider == null) return null;
|
||||||
|
|
||||||
|
var searchPaths = _dataPak.Files.Keys.Where(x => x.Contains($"/OfferingDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
|
|
||||||
|
var globalOfferings = new List<string>();
|
||||||
|
var camperOfferings = new List<string>();
|
||||||
|
var slasherOfferings = new List<string>();
|
||||||
|
|
||||||
|
foreach (var path in searchPaths)
|
||||||
|
{
|
||||||
|
var cleanPath = path.Contains('.') ? path.Substring(0, path.LastIndexOf('.')) : path;
|
||||||
|
if (_provider.TryLoadPackageObject<UDataTable>(cleanPath, out var dataTable))
|
||||||
|
{
|
||||||
|
foreach (var row in dataTable.RowMap)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* props
|
||||||
|
*/
|
||||||
|
var props = row.Value.Properties;
|
||||||
|
|
||||||
|
FPropertyTag? roleProp = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Role");
|
||||||
|
if (roleProp == null || roleProp.Tag == null) continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* real data
|
||||||
|
*/
|
||||||
|
string itemName = row.Key.Text;
|
||||||
|
EPlayerRole role = roleProp.Tag.GetValue<EPlayerRole>();
|
||||||
|
|
||||||
|
if (role == EPlayerRole.VE_Camper)
|
||||||
|
camperOfferings.Add(itemName);
|
||||||
|
else if (role == EPlayerRole.VE_Slasher)
|
||||||
|
slasherOfferings.Add(itemName);
|
||||||
|
else
|
||||||
|
globalOfferings.Add(itemName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var offeringsSerialized = new
|
||||||
|
{
|
||||||
|
Slashers = slasherOfferings.OrderBy(x => x).ToList(),
|
||||||
|
Campers = camperOfferings.OrderBy(x => x).ToList(),
|
||||||
|
All = globalOfferings.OrderBy(x => x).ToList()
|
||||||
|
};
|
||||||
|
|
||||||
|
return JsonConvert.SerializeObject(offeringsSerialized, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string? DumpPerks()
|
||||||
|
{
|
||||||
|
if (_dataPak == null || _provider == null) return null;
|
||||||
|
|
||||||
|
var searchPaths = _dataPak.Files.Keys.Where(x => x.Contains($"/PerkDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
|
|
||||||
|
var camperPerks = new List<string>();
|
||||||
|
var slasherPerks = new List<string>();
|
||||||
|
|
||||||
|
foreach (var path in searchPaths)
|
||||||
|
{
|
||||||
|
var cleanPath = path.Contains('.') ? path.Substring(0, path.LastIndexOf('.')) : path;
|
||||||
|
if (_provider.TryLoadPackageObject<UDataTable>(cleanPath, out var dataTable))
|
||||||
|
{
|
||||||
|
foreach (var row in dataTable.RowMap)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* props
|
||||||
|
*/
|
||||||
|
var props = row.Value.Properties;
|
||||||
|
|
||||||
|
FPropertyTag? roleProp = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Role");
|
||||||
|
if (roleProp == null || roleProp.Tag == null) continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* real data
|
||||||
|
*/
|
||||||
|
string itemName = row.Key.Text;
|
||||||
|
EPlayerRole role = roleProp.Tag.GetValue<EPlayerRole>();
|
||||||
|
|
||||||
|
if (role == EPlayerRole.VE_Camper)
|
||||||
|
camperPerks.Add(itemName);
|
||||||
|
else
|
||||||
|
slasherPerks.Add(itemName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var perksSerialized = new
|
||||||
|
{
|
||||||
|
Slashers = slasherPerks.OrderBy(x => x).ToList(),
|
||||||
|
Campers = camperPerks.OrderBy(x => x).ToList()
|
||||||
|
};
|
||||||
|
|
||||||
|
return JsonConvert.SerializeObject(perksSerialized, Formatting.Indented);
|
||||||
|
}
|
||||||
|
private string? getGamePath()
|
||||||
|
{
|
||||||
|
const string packagesPath = @"Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages";
|
||||||
|
|
||||||
|
using var key = Registry.CurrentUser.OpenSubKey(packagesPath);
|
||||||
|
|
||||||
|
if (key == null) return null;
|
||||||
|
string? matchingKeyName = key.GetSubKeyNames()
|
||||||
|
.FirstOrDefault(name => name.StartsWith(Constants.PackageName, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
if (matchingKeyName != null)
|
||||||
|
{
|
||||||
|
using (RegistryKey? subKey = key.OpenSubKey(matchingKeyName))
|
||||||
|
return subKey?.GetValue("PackageRootFolder")?.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("Failed to find game install dir");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
private async Task<bool> DownloadMappingFileAsync(string url, string outPath)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var httpClient = new HttpClient())
|
||||||
|
{
|
||||||
|
var bytes = await httpClient.GetByteArrayAsync(url);
|
||||||
|
Console.WriteLine("Downloading mapping file...");
|
||||||
|
await File.WriteAllBytesAsync(outPath, bytes);
|
||||||
|
Console.WriteLine($"Mapping file downloaded to: {outPath}");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Error occured while downloading mapping: {ex.Message}");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
+69
-225
@@ -1,228 +1,72 @@
|
|||||||
using CUE4Parse.Compression;
|
using CUE4Parse.UE4.Assets.Exports.CustomizableObject;
|
||||||
using CUE4Parse.Encryption.Aes;
|
|
||||||
using CUE4Parse.FileProvider;
|
|
||||||
using CUE4Parse.MappingsProvider;
|
|
||||||
using CUE4Parse.UE4.Assets.Exports.Actor;
|
|
||||||
using CUE4Parse.UE4.Assets.Exports.Engine;
|
|
||||||
using CUE4Parse.UE4.Assets.Exports.Texture;
|
|
||||||
using CUE4Parse.UE4.Assets.Objects.Properties;
|
|
||||||
using CUE4Parse.UE4.Objects.Core.Misc;
|
|
||||||
using CUE4Parse.UE4.Objects.UObject;
|
|
||||||
using CUE4Parse.UE4.Versions;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
class DumpByDaylight
|
int displayError(string err)
|
||||||
{
|
{
|
||||||
private const string _pakDir = "D:\\XboxGames\\Dead By Daylight\\Content\\DeadByDaylight\\Content\\Paks";
|
Console.WriteLine($"Dumper error: {err}");
|
||||||
private const string _aesKey = "0x22B1639B548124925CF7B9CBAA09F9AC295FCF0324586D6B37EE1D42670B39B3";
|
Console.WriteLine("Press any key to exit");
|
||||||
private const string _mappingURL = "https://git.neru.rip/neru/UnlockedByDaylight/raw/branch/main/res/mappings/latest-xbox.usmap";
|
Console.ReadKey();
|
||||||
|
return 1;
|
||||||
public static async Task<string?> DownloadMappingFileAsync(string url, string savePath)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (var httpClient = new HttpClient())
|
|
||||||
{
|
|
||||||
Console.WriteLine("downloading mapping file...");
|
|
||||||
var bytes = await httpClient.GetByteArrayAsync(url);
|
|
||||||
await File.WriteAllBytesAsync(savePath, bytes);
|
|
||||||
Console.WriteLine($"mapping file downloaded to: {savePath}");
|
|
||||||
return savePath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"failed to download mapping: {ex.Message}");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static async Task Main(string[] args)
|
|
||||||
{
|
|
||||||
// mapping
|
|
||||||
string mappingPath = Path.Combine(Path.GetTempPath(), "DeadByDaylight.usmap");
|
|
||||||
string? downloadedMapping = await DownloadMappingFileAsync(_mappingURL, mappingPath);
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(downloadedMapping))
|
|
||||||
{
|
|
||||||
Console.WriteLine("failed to download mapping file, press any key to exit");
|
|
||||||
Console.ReadKey();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZlibHelper.Initialize();
|
|
||||||
|
|
||||||
var oodlePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, OodleHelper.OodleFileName);
|
|
||||||
OodleHelper.Initialize(oodlePath);
|
|
||||||
|
|
||||||
|
|
||||||
// parsing setup
|
|
||||||
var version = new VersionContainer(EGame.GAME_DeadByDaylight, ETexturePlatform.DesktopMobile);
|
|
||||||
var provider = new DefaultFileProvider(_pakDir, SearchOption.TopDirectoryOnly, version);
|
|
||||||
provider.MappingsContainer = new FileUsmapTypeMappingsProvider(downloadedMapping);
|
|
||||||
|
|
||||||
provider.Initialize();
|
|
||||||
provider.SubmitKey(new FGuid(), new FAesKey(_aesKey));
|
|
||||||
provider.Mount();
|
|
||||||
|
|
||||||
Console.WriteLine("\nProvider Initialized. Extracting Databases...");
|
|
||||||
|
|
||||||
var dataPak = provider.GetArchive("pakchunk4-WinGDK.utoc");
|
|
||||||
|
|
||||||
/*
|
|
||||||
* itemdb dump
|
|
||||||
*/
|
|
||||||
var searchPaths = dataPak.Files.Keys.Where(x => x.Contains($"/ItemDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
|
||||||
var camperItems = new List<string>();
|
|
||||||
|
|
||||||
var slasherPowers = new List<string>();
|
|
||||||
|
|
||||||
foreach (var path in searchPaths)
|
|
||||||
{
|
|
||||||
var cleanPath = path.Contains('.') ? path.Substring(0, path.LastIndexOf('.')) : path;
|
|
||||||
if (provider.TryLoadPackageObject<UDataTable>(cleanPath, out var dataTable))
|
|
||||||
{
|
|
||||||
Console.WriteLine($"getting items / powers from {Path.GetFullPath(path)}");
|
|
||||||
|
|
||||||
foreach (var row in dataTable.RowMap)
|
|
||||||
{
|
|
||||||
var roleProperty = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Role");
|
|
||||||
var typeProperty = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Type");
|
|
||||||
if (typeProperty?.Tag is EnumProperty typeProp && roleProperty?.Tag is EnumProperty roleProp)
|
|
||||||
{
|
|
||||||
string typeName = typeProp.Value.ToString() ?? "null";
|
|
||||||
string roleName = roleProp.Value.ToString() ?? "null";
|
|
||||||
|
|
||||||
if (roleName == "EPlayerRole::VE_Slasher")
|
|
||||||
slasherPowers.Add(row.Key.Text);
|
|
||||||
else
|
|
||||||
camperItems.Add(row.Key.Text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var itemsSerialized = new
|
|
||||||
{
|
|
||||||
Campers = camperItems.OrderBy(x => x).ToList(),
|
|
||||||
Slashers = slasherPowers.OrderBy(x => x).ToList()
|
|
||||||
};
|
|
||||||
File.WriteAllText("items.json", JsonConvert.SerializeObject(itemsSerialized, Formatting.Indented));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* addon dump
|
|
||||||
*/
|
|
||||||
searchPaths = dataPak.Files.Keys.Where(x => x.Contains($"/ItemAddonDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
|
||||||
var camperAddons = new List<string>();
|
|
||||||
var slasherAddons = new List<string>();
|
|
||||||
|
|
||||||
foreach (var path in searchPaths)
|
|
||||||
{
|
|
||||||
var cleanPath = path.Contains('.') ? path.Substring(0, path.LastIndexOf('.')) : path;
|
|
||||||
if (provider.TryLoadPackageObject<UDataTable>(cleanPath, out var dataTable))
|
|
||||||
{
|
|
||||||
Console.WriteLine($"getting item / power addons from {Path.GetFullPath(path)}");
|
|
||||||
|
|
||||||
foreach (var row in dataTable.RowMap)
|
|
||||||
{
|
|
||||||
bool isSlasherAddon = false;
|
|
||||||
var roleProperty = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Role");
|
|
||||||
if (roleProperty?.Tag is EnumProperty roleEnumProp)
|
|
||||||
{
|
|
||||||
string roleName = roleEnumProp.Value.ToString() ?? "null";
|
|
||||||
if (roleName == "EPlayerRole::VE_Slasher")
|
|
||||||
isSlasherAddon = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isSlasherAddon)
|
|
||||||
slasherAddons.Add(row.Key.Text);
|
|
||||||
else
|
|
||||||
camperAddons.Add(row.Key.Text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var addonsSerialized = new
|
|
||||||
{
|
|
||||||
Slashers = slasherAddons.OrderBy(x => x).ToList(),
|
|
||||||
Campers = camperAddons.OrderBy(x => x).ToList()
|
|
||||||
};
|
|
||||||
File.WriteAllText("addons.json", JsonConvert.SerializeObject(addonsSerialized, Formatting.Indented));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* offerings
|
|
||||||
*/
|
|
||||||
searchPaths = dataPak.Files.Keys.Where(x => x.Contains($"/OfferingDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
|
||||||
|
|
||||||
var camperOfferings = new List<string>();
|
|
||||||
var slasherOfferings = new List<string>();
|
|
||||||
|
|
||||||
foreach (var path in searchPaths)
|
|
||||||
{
|
|
||||||
var cleanPath = path.Contains('.') ? path.Substring(0, path.LastIndexOf('.')) : path;
|
|
||||||
if (provider.TryLoadPackageObject<UDataTable>(cleanPath, out var dataTable))
|
|
||||||
{
|
|
||||||
Console.WriteLine($"getting offerings from {Path.GetFullPath(path)}");
|
|
||||||
|
|
||||||
foreach (var row in dataTable.RowMap)
|
|
||||||
{
|
|
||||||
var roleProperty = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Role");
|
|
||||||
if (roleProperty?.Tag is EnumProperty roleEnumProp)
|
|
||||||
{
|
|
||||||
string roleName = roleEnumProp.Value.ToString() ?? "null";
|
|
||||||
if (roleName == "EPlayerRole::VE_Slasher")
|
|
||||||
slasherOfferings.Add(row.Key.Text);
|
|
||||||
else
|
|
||||||
camperOfferings.Add(row.Key.Text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var offeringsSerialized = new
|
|
||||||
{
|
|
||||||
Slashers = slasherOfferings.OrderBy(x => x).ToList(),
|
|
||||||
Campers = camperOfferings.OrderBy(x => x).ToList()
|
|
||||||
};
|
|
||||||
File.WriteAllText("offerings.json", JsonConvert.SerializeObject(offeringsSerialized, Formatting.Indented));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* perks
|
|
||||||
*/
|
|
||||||
searchPaths = dataPak.Files.Keys.Where(x => x.Contains($"/PerkDB.uasset", StringComparison.OrdinalIgnoreCase)).ToList();
|
|
||||||
|
|
||||||
var slasherPerks = new List<string>();
|
|
||||||
var camperPerks = new List<string>();
|
|
||||||
|
|
||||||
foreach (var path in searchPaths)
|
|
||||||
{
|
|
||||||
var cleanPath = path.Contains('.') ? path.Substring(0, path.LastIndexOf('.')) : path;
|
|
||||||
if (provider.TryLoadPackageObject<UDataTable>(cleanPath, out var dataTable))
|
|
||||||
{
|
|
||||||
Console.WriteLine($"getting perks from {Path.GetFullPath(path)}");
|
|
||||||
|
|
||||||
foreach (var row in dataTable.RowMap)
|
|
||||||
{
|
|
||||||
var roleProperty = row.Value.Properties.FirstOrDefault(p => p.Name.Text == "Role");
|
|
||||||
if (roleProperty?.Tag is EnumProperty roleEnumProp)
|
|
||||||
{
|
|
||||||
string roleName = roleEnumProp.Value.ToString() ?? "null";
|
|
||||||
if (roleName == "EPlayerRole::VE_Slasher")
|
|
||||||
slasherPerks.Add(row.Key.Text);
|
|
||||||
else
|
|
||||||
camperPerks.Add(row.Key.Text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var perksSerialized = new
|
|
||||||
{
|
|
||||||
Slashers = slasherPerks.OrderBy(x => x).ToList(),
|
|
||||||
Campers = camperPerks.OrderBy(x => x).ToList()
|
|
||||||
};
|
|
||||||
File.WriteAllText("perks.json", JsonConvert.SerializeObject(perksSerialized, Formatting.Indented));
|
|
||||||
|
|
||||||
Console.WriteLine("\nAll dumper operations finished. Press any key to Close.");
|
|
||||||
Console.ReadKey();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("Dumper start");
|
||||||
|
var dumper = new Dumper();
|
||||||
|
|
||||||
|
bool hasInitialized = await dumper.InitAsync();
|
||||||
|
if (!hasInitialized) return displayError("Dumper.InitAsync failed");
|
||||||
|
|
||||||
|
Console.WriteLine("Dumper initialized");
|
||||||
|
|
||||||
|
string? customizationItemsJSON = dumper.DumpCustomizationItems();
|
||||||
|
if (customizationItemsJSON != null)
|
||||||
|
{
|
||||||
|
File.WriteAllText("customizations.json", customizationItemsJSON);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Failed to dump customizations");
|
||||||
|
}
|
||||||
|
|
||||||
|
string? itemsJSON = dumper.DumpItems();
|
||||||
|
if (itemsJSON != null)
|
||||||
|
{
|
||||||
|
File.WriteAllText("items.json", itemsJSON);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Failed to dump items");
|
||||||
|
}
|
||||||
|
|
||||||
|
string? addonsJSON = dumper.DumpAddons();
|
||||||
|
if (addonsJSON != null)
|
||||||
|
{
|
||||||
|
File.WriteAllText("addons.json", addonsJSON);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Failed to dump addons");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string? offeringsJSON = dumper.DumpOfferings();
|
||||||
|
if (offeringsJSON != null)
|
||||||
|
{
|
||||||
|
File.WriteAllText("offerings.json", offeringsJSON);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Failed to dump offerings");
|
||||||
|
}
|
||||||
|
|
||||||
|
string? perksJSON = dumper.DumpPerks();
|
||||||
|
if (perksJSON != null)
|
||||||
|
{
|
||||||
|
File.WriteAllText("perks.json", perksJSON);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Failed to dump perks");
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("Dumper finished");
|
||||||
|
|
||||||
|
return 0;
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using CUE4Parse.UE4.Assets.Objects;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
public static class StructMapper
|
||||||
|
{
|
||||||
|
public static T MapToStruct<T>(this FStructFallback fallback) where T : struct
|
||||||
|
{
|
||||||
|
object result = new T();
|
||||||
|
var fields = typeof(T).GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
|
||||||
|
|
||||||
|
foreach (var field in fields)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var method = typeof(CUE4Parse.UE4.Assets.Exports.AbstractPropertyHolder)
|
||||||
|
.GetMethods()
|
||||||
|
.FirstOrDefault(m => m.Name == "GetOrDefault" && m.GetGenericArguments().Length == 1);
|
||||||
|
|
||||||
|
if (method != null)
|
||||||
|
{
|
||||||
|
var genericMethod = method.MakeGenericMethod(field.FieldType);
|
||||||
|
|
||||||
|
var value = genericMethod.Invoke(fallback, new object[] { field.Name, null!, StringComparison.Ordinal });
|
||||||
|
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
field.SetValue(result, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Mapping failed for {field.Name}: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (T)result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
#include "cachecleaner.h"
|
||||||
|
|
||||||
|
#include <nerutils/log.h>
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <shlobj.h>
|
||||||
|
#include <tlhelp32.h>
|
||||||
|
|
||||||
|
CacheCleaner::CacheCleaner() : _running(false), _monitorThread(nullptr) {}
|
||||||
|
|
||||||
|
CacheCleaner::~CacheCleaner()
|
||||||
|
{
|
||||||
|
shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CacheCleaner::init()
|
||||||
|
{
|
||||||
|
std::string localAppData = getLocalAppDataPath();
|
||||||
|
if (localAppData == "") return Log::error("Failed to get LocalAppData?");
|
||||||
|
|
||||||
|
_cacheDir = localAppData + "\\DeadByDaylight\\Saved\\PersistentDownloadDir";
|
||||||
|
|
||||||
|
// this is pointless but just in case
|
||||||
|
std::filesystem::create_directories(_cacheDir);
|
||||||
|
|
||||||
|
clearFolder(_cacheDir);
|
||||||
|
|
||||||
|
_running = true;
|
||||||
|
//_monitorThread = std::make_unique<std::thread>(&CacheCleaner::monitorLoop, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CacheCleaner::shutdown()
|
||||||
|
{
|
||||||
|
if (!_running) return;
|
||||||
|
_running = false;
|
||||||
|
|
||||||
|
if (_monitorThread && _monitorThread->joinable()) _monitorThread->join();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string CacheCleaner::getLocalAppDataPath()
|
||||||
|
{
|
||||||
|
char buffer[MAX_PATH];
|
||||||
|
if (SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, buffer) == S_OK)
|
||||||
|
{
|
||||||
|
return std::string(buffer);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
void CacheCleaner::clearFolder(std::string& path)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for (const auto& entry : std::filesystem::directory_iterator(path))
|
||||||
|
{
|
||||||
|
std::filesystem::remove_all(entry.path());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CacheCleaner::monitorLoop()
|
||||||
|
{
|
||||||
|
HANDLE changeHandle = FindFirstChangeNotificationA(_cacheDir.c_str(), TRUE,
|
||||||
|
FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME |
|
||||||
|
FILE_NOTIFY_CHANGE_LAST_WRITE);
|
||||||
|
|
||||||
|
if (changeHandle == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
Log::error("Failed to create change notification");
|
||||||
|
_running = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log::verbose("Cache cleaner monitoring started");
|
||||||
|
|
||||||
|
std::unordered_set<DWORD> previousPids;
|
||||||
|
|
||||||
|
while (_running)
|
||||||
|
{
|
||||||
|
// Wait 2 seconds between checks
|
||||||
|
for (int i = 0; i < 20 && _running; i++)
|
||||||
|
Sleep(100);
|
||||||
|
|
||||||
|
if (!_running) break;
|
||||||
|
|
||||||
|
// Take snapshot and check for new processes in one pass
|
||||||
|
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
|
||||||
|
if (hSnapshot == INVALID_HANDLE_VALUE) continue;
|
||||||
|
|
||||||
|
PROCESSENTRY32 pe32;
|
||||||
|
pe32.dwSize = sizeof(PROCESSENTRY32);
|
||||||
|
|
||||||
|
std::unordered_set<DWORD> currentPids;
|
||||||
|
|
||||||
|
if (Process32First(hSnapshot, &pe32))
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
DWORD pid = pe32.th32ProcessID;
|
||||||
|
currentPids.insert(pid);
|
||||||
|
|
||||||
|
if (previousPids.find(pid) == previousPids.end())
|
||||||
|
{
|
||||||
|
std::string processName(pe32.szExeFile);
|
||||||
|
|
||||||
|
for (char& c : processName)
|
||||||
|
c = static_cast<char>(tolower(c));
|
||||||
|
|
||||||
|
if (processName.find("deadbydaylight") != std::string::npos)
|
||||||
|
{
|
||||||
|
Log::verbose("New DeadByDaylight process detected (PID: {}), clearing cache", pid);
|
||||||
|
clearFolder(_cacheDir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} while (Process32Next(hSnapshot, &pe32));
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseHandle(hSnapshot);
|
||||||
|
previousPids = std::move(currentPids);
|
||||||
|
}
|
||||||
|
|
||||||
|
FindCloseChangeNotification(changeHandle);
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <atomic>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
|
class CacheCleaner
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CacheCleaner();
|
||||||
|
~CacheCleaner();
|
||||||
|
|
||||||
|
void init();
|
||||||
|
void shutdown();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string getLocalAppDataPath();
|
||||||
|
void clearFolder(std::string& path);
|
||||||
|
void monitorLoop();
|
||||||
|
|
||||||
|
std::atomic<bool> _running;
|
||||||
|
std::unique_ptr<std::thread> _monitorThread;
|
||||||
|
std::string _cacheDir;
|
||||||
|
};
|
||||||
@@ -0,0 +1,474 @@
|
|||||||
|
#include "dbdcrypt.h"
|
||||||
|
|
||||||
|
#include <nerutils/log.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
#include <zlib.h>
|
||||||
|
|
||||||
|
#include <openssl/types.h>
|
||||||
|
#include <openssl/evp.h>
|
||||||
|
#include <openssl/bio.h>
|
||||||
|
#include <openssl/buffer.h>
|
||||||
|
|
||||||
|
std::string DBDCrypt::decrypt(const std::string& data, const std::string& accessKey, PayloadType* outType)
|
||||||
|
{
|
||||||
|
if (outType) *outType = NONE;
|
||||||
|
|
||||||
|
if (data.starts_with("DbdDAQEB"))
|
||||||
|
{
|
||||||
|
if (outType && *outType == NONE) *outType = TYPE_1;
|
||||||
|
return decType1(data, accessKey, outType);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.starts_with("DbdDAgAC"))
|
||||||
|
{
|
||||||
|
if (outType && *outType == NONE) *outType = TYPE_2;
|
||||||
|
return decType2(data, accessKey, outType);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.starts_with("DbdDAwAC"))
|
||||||
|
{
|
||||||
|
if (outType && *outType == NONE) *outType = TYPE_3;
|
||||||
|
return decType3(data, accessKey, outType);
|
||||||
|
}
|
||||||
|
|
||||||
|
Log::warning("Attempted to decrypt non encrypted string");
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DBDCrypt::encrypt(const std::string& data, const std::string& accessKey, PayloadType type,
|
||||||
|
std::string keyId)
|
||||||
|
{
|
||||||
|
if (type == TYPE_1)
|
||||||
|
{
|
||||||
|
auto compressed = zLibCompress(data); // Type 1 is UTF-8
|
||||||
|
if (compressed.empty()) return "";
|
||||||
|
|
||||||
|
uint32_t rawSize = (uint32_t)data.size();
|
||||||
|
std::vector<uint8_t> fullPayload(4);
|
||||||
|
std::memcpy(fullPayload.data(), &rawSize, 4);
|
||||||
|
|
||||||
|
fullPayload.insert(fullPayload.end(), compressed.begin(), compressed.end());
|
||||||
|
return "DbdDAQEB" + b64Enc(fullPayload);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == TYPE_2)
|
||||||
|
{
|
||||||
|
auto transformedKey = transformCDNKey(CDN_KEY_BASE64);
|
||||||
|
|
||||||
|
std::string utf16Data = utf8ToUtf16(data);
|
||||||
|
for (char& c : utf16Data)
|
||||||
|
c = (char)((unsigned char)c - 1);
|
||||||
|
|
||||||
|
std::vector<uint8_t> padded(utf16Data.begin(), utf16Data.end());
|
||||||
|
|
||||||
|
int padLen = 16 - (padded.size() % 16);
|
||||||
|
if (padLen < 16) padded.insert(padded.end(), padLen, 0);
|
||||||
|
|
||||||
|
auto encryptedBody = aesECBEncrypt(padded, transformedKey);
|
||||||
|
if (encryptedBody.empty()) return "";
|
||||||
|
|
||||||
|
std::vector<uint8_t> fullPayload(encryptedBody.begin(), encryptedBody.end());
|
||||||
|
return "DbdDAgAC" + b64Enc(fullPayload);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == TYPE_3)
|
||||||
|
{
|
||||||
|
auto decodedKey = b64Dec(accessKey);
|
||||||
|
if (decodedKey.empty()) return "";
|
||||||
|
|
||||||
|
std::string utf16Data = utf8ToUtf16(data);
|
||||||
|
for (char& c : utf16Data)
|
||||||
|
c = (char)((unsigned char)c - 1);
|
||||||
|
|
||||||
|
std::vector<uint8_t> padded(utf16Data.begin(), utf16Data.end());
|
||||||
|
|
||||||
|
int padLen = 16 - (padded.size() % 16);
|
||||||
|
if (padLen < 16) padded.insert(padded.end(), padLen, 0);
|
||||||
|
|
||||||
|
auto encryptedBody = aesECBEncrypt(padded, decodedKey);
|
||||||
|
|
||||||
|
if (encryptedBody.empty()) return "";
|
||||||
|
|
||||||
|
std::string shiftedId = shiftKeyID(keyId, -1);
|
||||||
|
std::vector<uint8_t> fullData(shiftedId.begin(), shiftedId.end());
|
||||||
|
fullData.push_back(0); // Null terminator
|
||||||
|
fullData.insert(fullData.end(), (uint8_t*)encryptedBody.data(),
|
||||||
|
(uint8_t*)encryptedBody.data() + encryptedBody.size());
|
||||||
|
|
||||||
|
return "DbdDAwAC" + b64Enc(fullData);
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DBDCrypt::decType1(const std::string& data, const std::string& key, PayloadType* outType)
|
||||||
|
{
|
||||||
|
if (data.length() < 8) return data;
|
||||||
|
auto decoded = b64Dec(data.substr(8));
|
||||||
|
if (decoded.size() < 4)
|
||||||
|
{
|
||||||
|
Log::error("Type 1 base64 too short ({})", decoded.size());
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<uint8_t> body(decoded.begin() + 4, decoded.end());
|
||||||
|
std::string decompressed = zlibDecompress(body);
|
||||||
|
|
||||||
|
if (decompressed.length() >= 2 && decompressed[1] == '\0') decompressed = utf16ToUtf8(decompressed);
|
||||||
|
|
||||||
|
if (decompressed.starts_with("DbdD")) return decrypt(decompressed, key, outType);
|
||||||
|
return decompressed;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DBDCrypt::decType2(const std::string& data, const std::string& key, PayloadType* outType)
|
||||||
|
{
|
||||||
|
if (data.length() < 8) return data;
|
||||||
|
|
||||||
|
auto decoded = b64Dec(data.substr(8));
|
||||||
|
if (decoded.empty()) return "";
|
||||||
|
|
||||||
|
std::vector<uint8_t> body = decoded;
|
||||||
|
|
||||||
|
auto transformedKey = transformCDNKey(CDN_KEY_BASE64);
|
||||||
|
|
||||||
|
std::string decrypted = aesECBDecrypt(body, transformedKey);
|
||||||
|
if (decrypted.empty()) return "";
|
||||||
|
|
||||||
|
for (char& c : decrypted)
|
||||||
|
c = (char)((unsigned char)c + 1);
|
||||||
|
|
||||||
|
if (decrypted.length() >= 2 && decrypted[1] == '\0') decrypted = utf16ToUtf8(decrypted);
|
||||||
|
|
||||||
|
decrypted.erase(std::remove(decrypted.begin(), decrypted.end(), (char)0x01), decrypted.end());
|
||||||
|
decrypted.erase(std::remove(decrypted.begin(), decrypted.end(), (char)0x00), decrypted.end());
|
||||||
|
|
||||||
|
for (size_t offset : {0ULL, 4ULL})
|
||||||
|
{
|
||||||
|
if (offset + 1 < decrypted.size() && (unsigned char)decrypted[offset] == 0x78)
|
||||||
|
{
|
||||||
|
std::vector<uint8_t> zlibPart((uint8_t*)decrypted.data() + offset,
|
||||||
|
(uint8_t*)decrypted.data() + decrypted.size());
|
||||||
|
std::string decompressed = zlibDecompress(zlibPart);
|
||||||
|
if (!decompressed.empty()) return decompressed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (decrypted.starts_with("DbdD")) return decrypt(decrypted, key, outType);
|
||||||
|
return decrypted;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DBDCrypt::decType3(const std::string& data, const std::string& key, PayloadType* outType)
|
||||||
|
{
|
||||||
|
if (data.length() < 8) return data;
|
||||||
|
|
||||||
|
auto rawKey = b64Dec(key);
|
||||||
|
auto decoded = b64Dec(data.substr(8));
|
||||||
|
if (decoded.empty()) return "";
|
||||||
|
|
||||||
|
auto it = std::find(decoded.begin(), decoded.end(), 0);
|
||||||
|
if (it == decoded.end()) return "";
|
||||||
|
|
||||||
|
std::vector<uint8_t> body(it + 1, decoded.end());
|
||||||
|
|
||||||
|
std::string decrypted = aesECBDecrypt(body, rawKey);
|
||||||
|
if (decrypted.empty())
|
||||||
|
{
|
||||||
|
Log::error("AES decryption failed (body size: {})", body.size());
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
for (char& c : decrypted)
|
||||||
|
c = (char)((unsigned char)c + 1);
|
||||||
|
|
||||||
|
if (decrypted.length() >= 2 && decrypted.at(1) == '\0') decrypted = utf16ToUtf8(decrypted);
|
||||||
|
|
||||||
|
decrypted.erase(std::remove(decrypted.begin(), decrypted.end(), (char)0x01), decrypted.end());
|
||||||
|
decrypted.erase(std::remove(decrypted.begin(), decrypted.end(), (char)0x00), decrypted.end());
|
||||||
|
|
||||||
|
for (size_t offset : {0ULL, 4ULL})
|
||||||
|
{
|
||||||
|
if (offset + 1 < decrypted.size() && (unsigned char)decrypted[offset] == 0x78)
|
||||||
|
{
|
||||||
|
//Log::verbose("nested zlib at offset {}", offset);
|
||||||
|
std::vector<uint8_t> zlibPart((uint8_t*)decrypted.data() + offset,
|
||||||
|
(uint8_t*)decrypted.data() + decrypted.size());
|
||||||
|
std::string decompressed = zlibDecompress(zlibPart);
|
||||||
|
if (!decompressed.empty())
|
||||||
|
{
|
||||||
|
//Log::verbose("nested zlib decompressed, size: {}", decompressed.length());
|
||||||
|
return decompressed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (decrypted.starts_with("DbdD")) return decrypt(decrypted, key, outType);
|
||||||
|
return decrypted;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DBDCrypt::aesECBDecrypt(const std::vector<uint8_t>& cipherText, const std::vector<uint8_t>& key)
|
||||||
|
{
|
||||||
|
if (key.size() < 32) return "";
|
||||||
|
|
||||||
|
EVP_CIPHER_CTX* ctx = EVP_CIPHER_CTX_new();
|
||||||
|
EVP_DecryptInit_ex(ctx, EVP_aes_256_ecb(), NULL, key.data(), NULL);
|
||||||
|
EVP_CIPHER_CTX_set_padding(ctx, 0);
|
||||||
|
|
||||||
|
std::string plaintext;
|
||||||
|
plaintext.resize(cipherText.size());
|
||||||
|
|
||||||
|
int len = 0;
|
||||||
|
if (EVP_DecryptUpdate(ctx, (unsigned char*)plaintext.data(), &len, cipherText.data(), (int)cipherText.size()) != 1)
|
||||||
|
{
|
||||||
|
EVP_CIPHER_CTX_free(ctx);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
int outLen = len;
|
||||||
|
|
||||||
|
int finalLen = 0;
|
||||||
|
if (EVP_DecryptFinal_ex(ctx, (unsigned char*)plaintext.data() + len, &finalLen) != 1)
|
||||||
|
{
|
||||||
|
// ignore?
|
||||||
|
}
|
||||||
|
outLen += finalLen;
|
||||||
|
|
||||||
|
EVP_CIPHER_CTX_free(ctx);
|
||||||
|
plaintext.resize(outLen);
|
||||||
|
return plaintext;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DBDCrypt::aesECBEncrypt(const std::vector<uint8_t>& plainText, const std::vector<uint8_t>& key)
|
||||||
|
{
|
||||||
|
if (key.size() < 32) return "";
|
||||||
|
|
||||||
|
EVP_CIPHER_CTX* ctx = EVP_CIPHER_CTX_new();
|
||||||
|
EVP_EncryptInit_ex(ctx, EVP_aes_256_ecb(), NULL, key.data(), NULL);
|
||||||
|
EVP_CIPHER_CTX_set_padding(ctx, 0);
|
||||||
|
|
||||||
|
std::string ciphertext;
|
||||||
|
ciphertext.resize(plainText.size() + 16);
|
||||||
|
|
||||||
|
int len = 0;
|
||||||
|
if (EVP_EncryptUpdate(ctx, (unsigned char*)ciphertext.data(), &len, plainText.data(), (int)plainText.size()) != 1)
|
||||||
|
{
|
||||||
|
EVP_CIPHER_CTX_free(ctx);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
int outLen = len;
|
||||||
|
|
||||||
|
int finalLen = 0;
|
||||||
|
if (EVP_EncryptFinal_ex(ctx, (unsigned char*)ciphertext.data() + outLen, &finalLen) == 1)
|
||||||
|
{
|
||||||
|
outLen += finalLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
EVP_CIPHER_CTX_free(ctx);
|
||||||
|
ciphertext.resize(outLen);
|
||||||
|
return ciphertext;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<uint8_t> DBDCrypt::b64Dec(const std::string& input)
|
||||||
|
{
|
||||||
|
std::string in = input;
|
||||||
|
std::replace(in.begin(), in.end(), '-', '+');
|
||||||
|
std::replace(in.begin(), in.end(), '_', '/');
|
||||||
|
|
||||||
|
BIO *bio, *b64;
|
||||||
|
int decodeLen = (int)in.length();
|
||||||
|
std::vector<uint8_t> buffer(decodeLen);
|
||||||
|
|
||||||
|
bio = BIO_new_mem_buf(in.data(), decodeLen);
|
||||||
|
b64 = BIO_new(BIO_f_base64());
|
||||||
|
bio = BIO_push(b64, bio);
|
||||||
|
|
||||||
|
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
|
||||||
|
int len = BIO_read(bio, buffer.data(), decodeLen);
|
||||||
|
BIO_free_all(bio);
|
||||||
|
|
||||||
|
if (len < 0) return {};
|
||||||
|
buffer.resize(len);
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DBDCrypt::b64Enc(const std::vector<uint8_t>& input)
|
||||||
|
{
|
||||||
|
if (input.empty()) return "";
|
||||||
|
|
||||||
|
BIO *bio, *b64;
|
||||||
|
BUF_MEM* bufferPtr;
|
||||||
|
|
||||||
|
b64 = BIO_new(BIO_f_base64());
|
||||||
|
bio = BIO_new(BIO_s_mem());
|
||||||
|
bio = BIO_push(b64, bio);
|
||||||
|
|
||||||
|
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
|
||||||
|
BIO_write(bio, input.data(), (int)input.size());
|
||||||
|
BIO_flush(bio);
|
||||||
|
BIO_get_mem_ptr(bio, &bufferPtr);
|
||||||
|
|
||||||
|
std::string result(bufferPtr->data, bufferPtr->length);
|
||||||
|
BIO_free_all(bio);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DBDCrypt::zlibDecompress(const std::vector<uint8_t>& compressed)
|
||||||
|
{
|
||||||
|
if (compressed.empty()) return "";
|
||||||
|
|
||||||
|
z_stream strm;
|
||||||
|
strm.zalloc = Z_NULL;
|
||||||
|
strm.zfree = Z_NULL;
|
||||||
|
strm.opaque = Z_NULL;
|
||||||
|
strm.avail_in = (uInt)compressed.size();
|
||||||
|
strm.next_in = (Bytef*)compressed.data();
|
||||||
|
|
||||||
|
if (inflateInit(&strm) != Z_OK) return "";
|
||||||
|
|
||||||
|
std::string result;
|
||||||
|
char buffer[32768];
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
strm.avail_out = sizeof(buffer);
|
||||||
|
strm.next_out = (Bytef*)buffer;
|
||||||
|
int ret = inflate(&strm, Z_NO_FLUSH);
|
||||||
|
if (ret != Z_OK && ret != Z_STREAM_END)
|
||||||
|
{
|
||||||
|
inflateEnd(&strm);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
result.append(buffer, sizeof(buffer) - strm.avail_out);
|
||||||
|
} while (strm.avail_out == 0);
|
||||||
|
|
||||||
|
inflateEnd(&strm);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<uint8_t> DBDCrypt::zLibCompress(const std::string& data)
|
||||||
|
{
|
||||||
|
if (data.empty()) return {};
|
||||||
|
|
||||||
|
z_stream strm;
|
||||||
|
strm.zalloc = Z_NULL;
|
||||||
|
strm.zfree = Z_NULL;
|
||||||
|
strm.opaque = Z_NULL;
|
||||||
|
|
||||||
|
if (deflateInit(&strm, Z_DEFAULT_COMPRESSION) != Z_OK) return {};
|
||||||
|
|
||||||
|
strm.avail_in = (uInt)data.size();
|
||||||
|
strm.next_in = (Bytef*)data.data();
|
||||||
|
|
||||||
|
std::vector<uint8_t> result;
|
||||||
|
uint8_t buffer[32768];
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
strm.avail_out = sizeof(buffer);
|
||||||
|
strm.next_out = (Bytef*)buffer;
|
||||||
|
deflate(&strm, Z_FINISH);
|
||||||
|
result.insert(result.end(), buffer, buffer + (sizeof(buffer) - strm.avail_out));
|
||||||
|
} while (strm.avail_out == 0);
|
||||||
|
|
||||||
|
deflateEnd(&strm);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<uint8_t> DBDCrypt::transformCDNKey(const std::string& b64CDNKey)
|
||||||
|
{
|
||||||
|
auto encryptedKey = b64Dec(b64CDNKey);
|
||||||
|
std::vector<uint8_t> uuidKey(32, 0);
|
||||||
|
std::memcpy(uuidKey.data(), CDN_UUID, std::min((size_t)32, strlen(CDN_UUID)));
|
||||||
|
|
||||||
|
std::string decrypted = aesECBDecrypt(encryptedKey, uuidKey);
|
||||||
|
std::vector<uint8_t> finalKey(decrypted.begin(), decrypted.end());
|
||||||
|
if (finalKey.size() > 32)
|
||||||
|
finalKey.resize(32);
|
||||||
|
else if (finalKey.size() < 32)
|
||||||
|
finalKey.resize(32, 0);
|
||||||
|
return finalKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DBDCrypt::shiftKeyID(const std::string& id, int shift)
|
||||||
|
{
|
||||||
|
std::string res = id;
|
||||||
|
for (char& c : res)
|
||||||
|
c = (char)((unsigned char)c + shift);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DBDCrypt::utf16ToUtf8(const std::string& utf16)
|
||||||
|
{
|
||||||
|
if (utf16.empty()) return "";
|
||||||
|
std::string utf8;
|
||||||
|
for (size_t i = 0; i < utf16.length(); i += 2)
|
||||||
|
{
|
||||||
|
uint16_t cp = *(uint16_t*)(utf16.data() + i);
|
||||||
|
if (cp == 0) break;
|
||||||
|
if (cp < 0x80)
|
||||||
|
utf8 += (char)cp;
|
||||||
|
else if (cp < 0x800)
|
||||||
|
{
|
||||||
|
utf8 += (char)(0xC0 | (cp >> 6));
|
||||||
|
utf8 += (char)(0x80 | (cp & 0x3F));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
utf8 += (char)(0xE0 | (cp >> 12));
|
||||||
|
utf8 += (char)(0x80 | ((cp >> 6) & 0x3F));
|
||||||
|
utf8 += (char)(0x80 | (cp & 0x3F));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return utf8;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DBDCrypt::utf8ToUtf16(const std::string& utf8)
|
||||||
|
{
|
||||||
|
if (utf8.empty()) return "";
|
||||||
|
std::string utf16;
|
||||||
|
for (size_t i = 0; i < utf8.length();)
|
||||||
|
{
|
||||||
|
uint32_t cp = 0;
|
||||||
|
unsigned char c = utf8[i];
|
||||||
|
if (c < 0x80)
|
||||||
|
{
|
||||||
|
cp = c;
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
else if (c < 0xE0)
|
||||||
|
{
|
||||||
|
cp = ((c & 0x1F) << 6) | (utf8[i + 1] & 0x3F);
|
||||||
|
i += 2;
|
||||||
|
}
|
||||||
|
else if (c < 0xF0)
|
||||||
|
{
|
||||||
|
cp = ((c & 0x0F) << 12) | ((utf8[i + 1] & 0x3F) << 6) | (utf8[i + 2] & 0x3F);
|
||||||
|
i += 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cp = ((c & 0x07) << 18) | ((utf8[i + 1] & 0x3F) << 12) | ((utf8[i + 2] & 0x3F) << 6) | (utf8[i + 3] & 0x3F);
|
||||||
|
i += 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cp < 0x10000)
|
||||||
|
{
|
||||||
|
utf16.push_back((char)(cp & 0xFF));
|
||||||
|
utf16.push_back((char)(cp >> 8));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cp -= 0x10000;
|
||||||
|
uint16_t high = (uint16_t)(0xD800 | (cp >> 10));
|
||||||
|
uint16_t low = (uint16_t)(0xDC00 | (cp & 0x3FF));
|
||||||
|
|
||||||
|
utf16.push_back((char)(high & 0xFF));
|
||||||
|
utf16.push_back((char)(high >> 8));
|
||||||
|
utf16.push_back((char)(low & 0xFF));
|
||||||
|
utf16.push_back((char)(low >> 8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return utf16;
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
// 9.5.2_live
|
||||||
|
#define ACCESS_KEY "BGz7nwlRX8QP__fzvqrgpNRVqrlEyuY54vuGVAqDO_g="
|
||||||
|
#define KEY_ID "9.5.2_live"
|
||||||
|
|
||||||
|
/*
|
||||||
|
hardcoded variables (they have been the same since like 2017)
|
||||||
|
*/
|
||||||
|
#define CDN_KEY_BASE64 "lEQWeCt51ET+MIuxdTs7Ig/gzVZP2vdkVZA1BDfz+L0="
|
||||||
|
#define CDN_UUID "6EF35759-454D-4EBC-8041-9A94CB99FD5D"
|
||||||
|
|
||||||
|
class DBDCrypt
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum PayloadType
|
||||||
|
{
|
||||||
|
NONE = 0,
|
||||||
|
TYPE_1, // compressed
|
||||||
|
TYPE_2, // CDN
|
||||||
|
TYPE_3 // dyn / accesskey
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string decrypt(const std::string& data, const std::string& accessKey,
|
||||||
|
PayloadType* outType = nullptr);
|
||||||
|
|
||||||
|
static std::string encrypt(const std::string& data, const std::string& accessKey, PayloadType type,
|
||||||
|
std::string keyId);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static std::string decType1(const std::string& data, const std::string& key, PayloadType* outType);
|
||||||
|
static std::string decType2(const std::string& data, const std::string& key, PayloadType* outType);
|
||||||
|
static std::string decType3(const std::string& data, const std::string& key, PayloadType* outType);
|
||||||
|
|
||||||
|
static std::string aesECBDecrypt(const std::vector<uint8_t>& cipherText, const std::vector<uint8_t>& key);
|
||||||
|
static std::string aesECBEncrypt(const std::vector<uint8_t>& plainText, const std::vector<uint8_t>& key);
|
||||||
|
|
||||||
|
static std::vector<uint8_t> b64Dec(const std::string& input);
|
||||||
|
static std::string b64Enc(const std::vector<uint8_t>& input);
|
||||||
|
|
||||||
|
static std::string zlibDecompress(const std::vector<uint8_t>& compressed);
|
||||||
|
static std::vector<uint8_t> zLibCompress(const std::string& data);
|
||||||
|
|
||||||
|
static std::vector<uint8_t> transformCDNKey(const std::string& b64CDNKey);
|
||||||
|
static std::string shiftKeyID(const std::string& id, int shift);
|
||||||
|
static std::string utf16ToUtf8(const std::string& utf16);
|
||||||
|
static std::string utf8ToUtf16(const std::string& utf8);
|
||||||
|
};
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "proxy.h"
|
#include "proxy.h"
|
||||||
#include "spoofing.h"
|
#include "spoofing.h"
|
||||||
|
#include "cachecleaner.h"
|
||||||
|
|
||||||
#include <nerutils/log.h>
|
#include <nerutils/log.h>
|
||||||
|
|
||||||
@@ -55,6 +56,7 @@ bool setProxyAddress(bool enable, const std::string& proxyAddr)
|
|||||||
|
|
||||||
bool running = true;
|
bool running = true;
|
||||||
Proxy* proxy = nullptr;
|
Proxy* proxy = nullptr;
|
||||||
|
CacheCleaner* cleaner = nullptr;
|
||||||
|
|
||||||
void cleanup()
|
void cleanup()
|
||||||
{
|
{
|
||||||
@@ -72,6 +74,12 @@ void cleanup()
|
|||||||
Log::info("Shutting down proxy");
|
Log::info("Shutting down proxy");
|
||||||
proxy->shutdown();
|
proxy->shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cleaner)
|
||||||
|
{
|
||||||
|
Log::info("Shutting down cache cleaner");
|
||||||
|
cleaner->shutdown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI consoleHandler(DWORD dwType)
|
BOOL WINAPI consoleHandler(DWORD dwType)
|
||||||
@@ -117,6 +125,13 @@ int main()
|
|||||||
|
|
||||||
spoofer->init(proxy);
|
spoofer->init(proxy);
|
||||||
|
|
||||||
|
/*
|
||||||
|
cache cleaner setup
|
||||||
|
*/
|
||||||
|
Log::info("Cache cleaner init");
|
||||||
|
cleaner = new CacheCleaner();
|
||||||
|
cleaner->init();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
pause
|
pause
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -526,6 +526,11 @@ void Proxy::handleClient(SOCKET clientSocket)
|
|||||||
|
|
||||||
OnClientRequest.run(url, fullBody, headers);
|
OnClientRequest.run(url, fullBody, headers);
|
||||||
|
|
||||||
|
removeHeader(headers, "Transfer-Encoding");
|
||||||
|
removeHeader(headers, "Content-Length");
|
||||||
|
headers.insert(headers.size() - 2,
|
||||||
|
"Content-Length: " + std::to_string(fullBody.size()) + "\r\n");
|
||||||
|
|
||||||
SSL_write(remoteSSL.get(), headers.data(), (int)headers.size());
|
SSL_write(remoteSSL.get(), headers.data(), (int)headers.size());
|
||||||
SSL_write(remoteSSL.get(), fullBody.data(), (int)fullBody.size());
|
SSL_write(remoteSSL.get(), fullBody.data(), (int)fullBody.size());
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Proxy
|
|||||||
bool init();
|
bool init();
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
||||||
CallbackEvent<std::string&, const std::string&, std::string&> OnClientRequest;
|
CallbackEvent<const std::string&, std::string&, std::string&> OnClientRequest;
|
||||||
CallbackEvent<const std::string&, std::string&, std::string&> OnServerResponse;
|
CallbackEvent<const std::string&, std::string&, std::string&> OnServerResponse;
|
||||||
|
|
||||||
void addWhitelistDomain(const std::string& domain);
|
void addWhitelistDomain(const std::string& domain);
|
||||||
|
|||||||
+287
-125
@@ -1,4 +1,4 @@
|
|||||||
#include "spoofing.h"
|
#include "spoofing.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
|
#define PLACEHOLDER_ITEMID "Anniversary2025Offering"
|
||||||
|
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
|
|
||||||
static std::random_device rd;
|
static std::random_device rd;
|
||||||
@@ -49,46 +51,108 @@ void Spoofer::registerListeners(Proxy* proxy)
|
|||||||
this->serverResponseHandler(url, body, respHeaders);
|
this->serverResponseHandler(url, body, respHeaders);
|
||||||
});
|
});
|
||||||
|
|
||||||
proxy->OnClientRequest.addListener([this](std::string& url, const std::string& body, std::string& reqHeaders) {
|
proxy->OnClientRequest.addListener([this](const std::string& url, std::string& body, std::string& reqHeaders) {
|
||||||
this->clientRequestHandler(url, body, reqHeaders);
|
this->clientRequestHandler(url, body, reqHeaders);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LOADDATA(fileName, type, camperSet, slasherSet, errorMsg) \
|
|
||||||
std::string path##type = utils::getExePath() + fileName; \
|
|
||||||
std::ifstream file##type(path##type); \
|
|
||||||
if (file##type.is_open()) \
|
|
||||||
{ \
|
|
||||||
std::stringstream buff; \
|
|
||||||
buff << file##type.rdbuf(); \
|
|
||||||
if (!parseStackable(buff.str(), camperSet, slasherSet)) \
|
|
||||||
Log::error("Failed to parse {} - {}", fileName, errorMsg); \
|
|
||||||
else \
|
|
||||||
Log::verbose("Loaded {} camper ids and {} slasher ids from {}", camperSet.size(), slasherSet.size(), \
|
|
||||||
fileName); \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
Log::warning("Missing {} - {}", fileName, errorMsg);
|
|
||||||
|
|
||||||
void Spoofer::loadData()
|
void Spoofer::loadData()
|
||||||
{
|
{
|
||||||
Log::info("Loading data");
|
Log::info("Loading data");
|
||||||
|
|
||||||
std::string catalogPath = utils::getExePath() + "catalog.json";
|
/*
|
||||||
std::ifstream catalogFile(catalogPath);
|
stackables
|
||||||
if (catalogFile.is_open())
|
*/
|
||||||
|
static auto loadData = [this](const char* fileName, std::unordered_set<std::string>* camperSet,
|
||||||
|
std::unordered_set<std::string>* slasherSet,
|
||||||
|
std::unordered_set<std::string>* globalSet, const char* errorMsg) {
|
||||||
|
std::ifstream file(utils::getExePath() + fileName);
|
||||||
|
|
||||||
|
if (file.is_open())
|
||||||
|
{
|
||||||
|
std::stringstream buff;
|
||||||
|
buff << file.rdbuf();
|
||||||
|
if (!parseStackable(buff.str(), camperSet, slasherSet, globalSet))
|
||||||
|
return Log::error("Failed to parse {} - {}", fileName, errorMsg);
|
||||||
|
else
|
||||||
|
Log::verbose("Loaded {}", fileName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Log::warning("Missing file: {} - {}", fileName, errorMsg);
|
||||||
|
};
|
||||||
|
|
||||||
|
loadData("items.json", &_camperItemIds, 0, 0, "Items wont be added");
|
||||||
|
loadData("offerings.json", &_camperOfferingIds, &_slasherOfferingIds, &_globalOfferingIds,
|
||||||
|
"Offerings won't be added");
|
||||||
|
loadData("addons.json", &_camperAddonIds, &_slasherAddonIds, 0, "Offerings won't be added");
|
||||||
|
loadData("perks.json", &_camperPerkIds, &_slasherPerkIds, 0, "Offerings won't be added");
|
||||||
|
|
||||||
|
/*
|
||||||
|
catalog items
|
||||||
|
*/
|
||||||
|
std::ifstream customizationsFile(utils::getExePath() + "customizations.json");
|
||||||
|
if (customizationsFile.is_open())
|
||||||
{
|
{
|
||||||
std::stringstream buff;
|
std::stringstream buff;
|
||||||
buff << catalogFile.rdbuf();
|
buff << customizationsFile.rdbuf();
|
||||||
if (!parseCatalog(buff.str())) Log::warning("Failed to parse catalog.json - Customizations won't be unlocked");
|
if (!parseCustomizations(buff.str()))
|
||||||
|
Log::warning("Failed to parse customizations.json - Outfits and character items won't be added");
|
||||||
|
else
|
||||||
|
Log::verbose("Loaded customizations.json");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
Log::warning("Missing catalog.json - Customizations won't be unlocked");
|
|
||||||
|
|
||||||
LOADDATA("items.json", Items, _camperItemIds, _slasherPowerIds, "Items won't be added");
|
/*
|
||||||
LOADDATA("offerings.json", Offerings, _camperOfferingIds, _slasherOfferingIds, "Offerings won't be added");
|
characters
|
||||||
LOADDATA("addons.json", Addons, _camperAddonIds, _slasherAddonIds, "Addons won't be added");
|
*/
|
||||||
LOADDATA("perks.json", Perks, _camperPerkIds, _slasherPerkIds, "Perks won't be added");
|
std::ifstream characterFile(utils::getExePath() + "characters.json");
|
||||||
|
if (characterFile.is_open())
|
||||||
|
{
|
||||||
|
std::stringstream buff;
|
||||||
|
buff << characterFile.rdbuf();
|
||||||
|
json doc = json::parse(buff.str(), nullptr, false);
|
||||||
|
if (doc.is_discarded())
|
||||||
|
Log::error("Failed to parse characters.json");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (const auto& character : doc)
|
||||||
|
{
|
||||||
|
if (character.is_string()) _characterList.insert(character.get<std::string>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
dlcs
|
||||||
|
*/
|
||||||
|
std::ifstream dlcFile(utils::getExePath() + "dlcs.json");
|
||||||
|
if (dlcFile.is_open())
|
||||||
|
{
|
||||||
|
std::stringstream buff;
|
||||||
|
buff << dlcFile.rdbuf();
|
||||||
|
json doc = json::parse(buff.str(), nullptr, false);
|
||||||
|
if (doc.is_discarded())
|
||||||
|
Log::error("Failed to parse dlcs.json");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (const auto& dlc : doc)
|
||||||
|
{
|
||||||
|
if (dlc.contains("grdk")) _dlcListGRDK.insert(dlc["grdk"].get<std::string>());
|
||||||
|
if (dlc.contains("egs")) _dlcListEGS.insert(dlc["egs"].get<std::string>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Log::verbose("Finished loading data");
|
||||||
|
|
||||||
|
Log::verbose("Items - {} camper", _camperItemIds.size());
|
||||||
|
Log::verbose("Offerings - {} camper | {} slasher | {} global", _camperOfferingIds.size(),
|
||||||
|
_slasherOfferingIds.size(), _globalOfferingIds.size());
|
||||||
|
Log::verbose("Addons - {} camper | {} slasher ", _camperAddonIds.size(), _slasherAddonIds.size());
|
||||||
|
Log::verbose("Perks - {} camper | {} slasher ", _camperPerkIds.size(), _slasherPerkIds.size());
|
||||||
|
|
||||||
|
Log::verbose("Catalog - {} outfits | {} items", _catalogOutfitIds.size(), _catalogItemIds.size());
|
||||||
|
Log::verbose("Characters - {}", _characterList.size());
|
||||||
|
Log::verbose("DLCs - GRDK {} - EGS: {}", _dlcListGRDK.size(), _dlcListEGS.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spoofer::loadConfig()
|
void Spoofer::loadConfig()
|
||||||
@@ -101,11 +165,12 @@ void Spoofer::loadConfig()
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
json configJson = json::parse(configFile);
|
json configJson = json::parse(configFile);
|
||||||
_config.spoofCharacterOwnership = configJson.value("spoofCharacterOwnership", false);
|
_config.spoofCharacterOwnership =
|
||||||
_config.spoofInventory = configJson.value("spoofInventory", true);
|
configJson.value("spoofCharacterOwnership", _config.spoofCharacterOwnership);
|
||||||
_config.spoofCustomization = configJson.value("spoofCustomization", true);
|
_config.spoofInventory = configJson.value("spoofInventory", _config.spoofInventory);
|
||||||
Log::info("Loaded config: Ownership={}, Inventory={}, Customization={}", _config.spoofCharacterOwnership,
|
_config.spoofCustomization = configJson.value("spoofCustomization", _config.spoofCustomization);
|
||||||
_config.spoofInventory, _config.spoofCustomization);
|
_config.accessKey = configJson.value("accessKey", _config.accessKey);
|
||||||
|
_config.keyId = configJson.value("keyId", _config.keyId);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@@ -115,56 +180,25 @@ void Spoofer::loadConfig()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log::info("config.json not found, using default settings");
|
Log::info("config.json not found, using default settings");
|
||||||
json defaultConfig = {
|
json defaultConfig = {{"spoofCharacterOwnership", _config.spoofCharacterOwnership},
|
||||||
{"spoofCharacterOwnership", true}, {"spoofInventory", true}, {"spoofCustomization", true}};
|
{"spoofInventory", _config.spoofInventory},
|
||||||
|
{"spoofCustomization", _config.spoofCustomization},
|
||||||
|
{"accessKey", _config.accessKey},
|
||||||
|
{"keyId", _config.keyId}};
|
||||||
std::ofstream out(configPath);
|
std::ofstream out(configPath);
|
||||||
out << defaultConfig.dump(4);
|
out << defaultConfig.dump(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log::info("Loaded config: Ownership={}, Inventory={}, Customization={}, AccessKey={}, keyId={}",
|
||||||
|
_config.spoofCharacterOwnership, _config.spoofInventory, _config.spoofCustomization, _config.accessKey,
|
||||||
|
_config.keyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
data parsing
|
data parsing
|
||||||
*/
|
*/
|
||||||
bool Spoofer::parseCatalog(std::string data)
|
bool Spoofer::parseStackable(std::string data, std::unordered_set<std::string>* camperSet,
|
||||||
{
|
std::unordered_set<std::string>* slasherSet, std::unordered_set<std::string>* globalSet)
|
||||||
json doc = json::parse(data, nullptr, false);
|
|
||||||
|
|
||||||
if (doc.is_discarded())
|
|
||||||
{
|
|
||||||
Log::error("Failed to parse catalog");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const auto& catalogData = doc.at("data");
|
|
||||||
|
|
||||||
auto extractIds = [&](const std::string& key, std::unordered_set<std::string>& targetSet) {
|
|
||||||
if (catalogData.contains(key) && catalogData[key].contains("items"))
|
|
||||||
for (const auto& id : catalogData[key]["items"])
|
|
||||||
{
|
|
||||||
if (id.is_string()) targetSet.insert(id.get<std::string>());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Log::warning("Catalog missing or invalid category: {}", key);
|
|
||||||
};
|
|
||||||
|
|
||||||
extractIds("item", _catalogItemIds);
|
|
||||||
extractIds("outfit", _catalogOutfitIds);
|
|
||||||
}
|
|
||||||
catch (const json::exception& e)
|
|
||||||
{
|
|
||||||
Log::error("Invalid catalog format: {}", e.what());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Log::info("Parsed {} items and {} outfits from catalog", _catalogItemIds.size(), _catalogOutfitIds.size());
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Spoofer::parseStackable(std::string data, std::unordered_set<std::string>& camperSet,
|
|
||||||
std::unordered_set<std::string>& slasherSet)
|
|
||||||
{
|
{
|
||||||
json doc = json::parse(data, nullptr, false);
|
json doc = json::parse(data, nullptr, false);
|
||||||
if (doc.is_discarded())
|
if (doc.is_discarded())
|
||||||
@@ -173,18 +207,47 @@ bool Spoofer::parseStackable(std::string data, std::unordered_set<std::string>&
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto populate = [&](const std::string& key, std::unordered_set<std::string>& targetSet) {
|
auto populate = [&](const std::string& key, std::unordered_set<std::string>* targetSet) {
|
||||||
if (doc.contains(key) && doc[key].is_array())
|
if (doc.contains(key) && doc[key].is_array())
|
||||||
for (const auto& item : doc[key])
|
for (const auto& item : doc[key])
|
||||||
{
|
{
|
||||||
if (item.is_string()) targetSet.insert(item.get<std::string>());
|
if (item.is_string()) targetSet->insert(item.get<std::string>());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Log::warning("Missing stackables array ({})", key);
|
Log::warning("Missing stackables array ({})", key);
|
||||||
};
|
};
|
||||||
|
|
||||||
populate("Slashers", slasherSet);
|
if (camperSet) populate("Campers", camperSet);
|
||||||
populate("Campers", camperSet);
|
if (slasherSet) populate("Slashers", slasherSet);
|
||||||
|
if (globalSet) populate("All", globalSet);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Spoofer::parseCustomizations(std::string data)
|
||||||
|
{
|
||||||
|
json doc = json::parse(data, nullptr, false);
|
||||||
|
if (doc.is_discarded())
|
||||||
|
{
|
||||||
|
Log::error("JSON parse error @ parseCustomizations");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doc.contains("Items"))
|
||||||
|
{
|
||||||
|
for (const auto& item : doc["Items"])
|
||||||
|
{
|
||||||
|
if (item.is_string()) _catalogItemIds.insert(item.get<std::string>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doc.contains("Outfits"))
|
||||||
|
{
|
||||||
|
for (const auto& outfit : doc["Outfits"])
|
||||||
|
{
|
||||||
|
if (outfit.is_string()) _catalogOutfitIds.insert(outfit.get<std::string>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -195,14 +258,14 @@ bool Spoofer::parseStackable(std::string data, std::unordered_set<std::string>&
|
|||||||
std::string Spoofer::getRandomItem()
|
std::string Spoofer::getRandomItem()
|
||||||
{
|
{
|
||||||
std::vector<const std::unordered_set<std::string>*> allSets = {
|
std::vector<const std::unordered_set<std::string>*> allSets = {
|
||||||
&_camperItemIds, &_slasherPowerIds, &_camperOfferingIds, &_slasherOfferingIds,
|
&_camperItemIds, &_camperOfferingIds, &_slasherOfferingIds, &_camperAddonIds,
|
||||||
&_camperAddonIds, &_slasherAddonIds, &_camperPerkIds, &_slasherPerkIds};
|
&_slasherAddonIds, &_camperPerkIds, &_slasherPerkIds};
|
||||||
|
|
||||||
std::vector<const std::unordered_set<std::string>*> validSets;
|
std::vector<const std::unordered_set<std::string>*> validSets;
|
||||||
for (auto* s : allSets)
|
for (auto* s : allSets)
|
||||||
if (!s->empty()) validSets.push_back(s);
|
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);
|
std::uniform_int_distribution<> setDist(0, static_cast<int>(validSets.size()) - 1);
|
||||||
const auto& selectedSet = *validSets[setDist(gen)];
|
const auto& selectedSet = *validSets[setDist(gen)];
|
||||||
@@ -304,10 +367,6 @@ void Spoofer::modifyCharacterData(json& js)
|
|||||||
if (js.contains("bloodWebData")) generateBloodweb(js["bloodWebData"]);
|
if (js.contains("bloodWebData")) generateBloodweb(js["bloodWebData"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (js.value("isEntitled", false) == false) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
item spoofing
|
item spoofing
|
||||||
@@ -323,15 +382,16 @@ void Spoofer::modifyCharacterData(json& js)
|
|||||||
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(_globalOfferingIds.begin(), _globalOfferingIds.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());
|
stackableIds.insert(_slasherOfferingIds.begin(), _slasherOfferingIds.end());
|
||||||
|
|
||||||
for (auto& item : js["characterItems"])
|
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())
|
if (item.contains("itemId") && item["itemId"].is_string())
|
||||||
{
|
{
|
||||||
std::string itemId = item["itemId"];
|
std::string itemId = item["itemId"];
|
||||||
@@ -360,6 +420,8 @@ void Spoofer::modifyCharacterData(json& js)
|
|||||||
appendItems(_slasherOfferingIds, false);
|
appendItems(_slasherOfferingIds, false);
|
||||||
appendItems(_slasherPerkIds, true);
|
appendItems(_slasherPerkIds, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
appendItems(_globalOfferingIds, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,29 +430,31 @@ void Spoofer::modifyCharacterData(json& js)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Spoofer::onGetAllClient(std::string& body)
|
||||||
|
{
|
||||||
|
if (!_config.spoofCharacterOwnership) return;
|
||||||
|
|
||||||
|
json doc = json::parse(body, nullptr, false);
|
||||||
|
if (doc.is_discarded()) return Log::error("JSON parse error for dbd-inventories/all (client)");
|
||||||
|
|
||||||
|
if (doc.contains("ownedCharacters") && doc["ownedCharacters"].is_array())
|
||||||
|
{
|
||||||
|
auto& jsonList = doc["ownedCharacters"];
|
||||||
|
|
||||||
|
for (const std::string& charName : _characterList)
|
||||||
|
{
|
||||||
|
if (charName == "K25") continue;
|
||||||
|
|
||||||
|
if (std::find(jsonList.begin(), jsonList.end(), charName) == jsonList.end()) jsonList.push_back(charName);
|
||||||
|
}
|
||||||
|
|
||||||
|
body = doc.dump();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
endpoint handlers
|
endpoint handlers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void Spoofer::onGetCatalogItems(std::string& body)
|
|
||||||
{
|
|
||||||
std::thread t([body]() {
|
|
||||||
std::string outPath = utils::getExePath() + "catalog.json";
|
|
||||||
std::ofstream file(outPath);
|
|
||||||
if (file.is_open())
|
|
||||||
{
|
|
||||||
file << body;
|
|
||||||
file.close();
|
|
||||||
Log::verbose("Raw catalog saved to {}", outPath);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Log::error("Unable to write to catalog.json");
|
|
||||||
});
|
|
||||||
t.detach();
|
|
||||||
|
|
||||||
parseCatalog(body);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Spoofer::onGetAll(std::string& body)
|
void Spoofer::onGetAll(std::string& body)
|
||||||
{
|
{
|
||||||
json doc = json::parse(body, nullptr, false);
|
json doc = json::parse(body, nullptr, false);
|
||||||
@@ -536,11 +600,21 @@ void Spoofer::onMessageList(std::string& body)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Spoofer::onBloodwebClient(std::string& body)
|
||||||
|
{
|
||||||
|
json req = json::parse(body, nullptr, false);
|
||||||
|
if (req.is_discarded()) return Log::error("JSON parse error for bloodweb request handler");
|
||||||
|
if (req.contains("characterName")) this->_lastBloodWebChar = req["characterName"];
|
||||||
|
}
|
||||||
|
|
||||||
void Spoofer::onBloodweb(std::string& body, std::string& respHeaders)
|
void Spoofer::onBloodweb(std::string& body, std::string& respHeaders)
|
||||||
{
|
{
|
||||||
json doc = json::parse(body, nullptr, false);
|
json doc = json::parse(body, nullptr, false);
|
||||||
if (doc.is_discarded()) return Log::error("JSON parse error for bloodweb response");
|
if (doc.is_discarded()) return Log::error("JSON parse error for bloodweb response");
|
||||||
|
|
||||||
|
/*
|
||||||
|
return fake bloodweb data
|
||||||
|
*/
|
||||||
if (_config.spoofCharacterOwnership)
|
if (_config.spoofCharacterOwnership)
|
||||||
{
|
{
|
||||||
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)
|
||||||
@@ -576,6 +650,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);
|
modifyCharacterData(doc);
|
||||||
body = doc.dump();
|
body = doc.dump();
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
@@ -583,6 +682,66 @@ void Spoofer::onBloodweb(std::string& body, std::string& respHeaders)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Spoofer::onUpdateEntitlements(const std::string& url, std::string& body)
|
||||||
|
{
|
||||||
|
if (!_config.spoofCharacterOwnership) return;
|
||||||
|
|
||||||
|
json js = json::parse(body, nullptr, false);
|
||||||
|
if (js.is_discarded()) return Log::error("JSON parse error for get-update-entitlements");
|
||||||
|
|
||||||
|
if (js.contains("entitlements"))
|
||||||
|
{
|
||||||
|
auto& jsonList = js["entitlements"];
|
||||||
|
|
||||||
|
std::unordered_set<std::string>* list = nullptr;
|
||||||
|
|
||||||
|
if (url.starts_with("https://grdk.live.bhvrdbd.com/"))
|
||||||
|
list = &_dlcListGRDK;
|
||||||
|
else if (url.starts_with("https://egs.live.bhvrdbd.com/"))
|
||||||
|
list = &_dlcListEGS;
|
||||||
|
else
|
||||||
|
return Log::error("Invalid url?");
|
||||||
|
|
||||||
|
if (list == nullptr) return;
|
||||||
|
for (const std::string& dlcId : *list)
|
||||||
|
{
|
||||||
|
if (std::find(jsonList.begin(), jsonList.end(), dlcId) == jsonList.end()) jsonList.push_back(dlcId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
body = js.dump();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Spoofer::onUpdateEntitlementsClient(const std::string& url, std::string& body)
|
||||||
|
{
|
||||||
|
if (!_config.spoofCharacterOwnership) return;
|
||||||
|
|
||||||
|
json js = json::parse(body, nullptr, false);
|
||||||
|
if (js.is_discarded()) return Log::error("JSON parse error for get-update-entitlements");
|
||||||
|
|
||||||
|
if (js.contains("clientEntitlementIds"))
|
||||||
|
{
|
||||||
|
auto& jsonList = js["clientEntitlementIds"];
|
||||||
|
|
||||||
|
std::unordered_set<std::string>* list = nullptr;
|
||||||
|
|
||||||
|
if (url.starts_with("https://grdk.live.bhvrdbd.com/"))
|
||||||
|
list = &_dlcListGRDK;
|
||||||
|
else if (url.starts_with("https://egs.live.bhvrdbd.com/"))
|
||||||
|
list = &_dlcListEGS;
|
||||||
|
else
|
||||||
|
return Log::error("Invalid url?");
|
||||||
|
|
||||||
|
if (list == nullptr) return;
|
||||||
|
for (const std::string& dlcId : *list)
|
||||||
|
{
|
||||||
|
if (std::find(jsonList.begin(), jsonList.end(), dlcId) == jsonList.end()) jsonList.push_back(dlcId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
body = js.dump();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
event handlers
|
event handlers
|
||||||
*/
|
*/
|
||||||
@@ -595,26 +754,29 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s
|
|||||||
Log::verbose("BHVR api res @ {}", url);
|
Log::verbose("BHVR api res @ {}", url);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (url.find("api/v1/extensions/store/getCatalogItems") != std::string::npos) return onGetCatalogItems(body);
|
if (url.ends_with("api/v1/dbd-inventories/all")) return onInventoryAll(body);
|
||||||
if (url.find("api/v1/dbd-character-data/get-all") != std::string::npos) return onGetAll(body);
|
|
||||||
if (url.find("api/v1/dbd-character-data/get-all") != std::string::npos) return onGetAll(body);
|
if (url.find("api/v1/messages/listV2") != std::string::npos) return onMessageList(body);
|
||||||
if (url.find("api/v1/dbd-inventories/all") != std::string::npos) return onInventoryAll(body);
|
|
||||||
if (url.find("/api/v1/messages/listV2") != std::string::npos) return onMessageList(body);
|
if (url.ends_with("api/v1/dbd-character-data/get-all")) return onGetAll(body);
|
||||||
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)
|
if (url.ends_with("api/v1/dbd-character-data/bloodweb") ||
|
||||||
|
url.ends_with("api/v1/dbd-character-data/bulk-spending-bloodweb"))
|
||||||
return onBloodweb(body, respHeaders);
|
return onBloodweb(body, respHeaders);
|
||||||
|
|
||||||
|
if (url.ends_with("api/v1/owned-products/get-update-entitlements")) return onUpdateEntitlements(url, body);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spoofer::clientRequestHandler(std::string& url, const std::string& body, std::string& /*reqHeaders*/)
|
void Spoofer::clientRequestHandler(const std::string& url, std::string& body, std::string& /*reqHeaders*/)
|
||||||
{
|
{
|
||||||
if (url.find("bhvrdbd.com") == std::string::npos) return;
|
if (url.find("bhvrdbd.com") == std::string::npos) return;
|
||||||
std::lock_guard<std::mutex> lock(_mtx);
|
std::lock_guard<std::mutex> lock(_mtx);
|
||||||
|
|
||||||
if (url.find("api/v1/dbd-character-data/bloodweb") != std::string::npos ||
|
if (url.ends_with("api/v1/dbd-character-data/get-all")) return onGetAllClient(body);
|
||||||
url.find("api/v1/dbd-character-data/bulk-spending-bloodweb") != std::string::npos)
|
|
||||||
{
|
if (url.ends_with("api/v1/dbd-character-data/bloodweb") ||
|
||||||
json req = json::parse(body, nullptr, false);
|
url.ends_with("api/v1/dbd-character-data/bulk-spending-bloodweb"))
|
||||||
if (req.is_discarded()) return Log::error("JSON parse error for bloodweb request handler");
|
return onBloodwebClient(body);
|
||||||
if (req.contains("characterName")) this->_lastBloodWebChar = req["characterName"];
|
|
||||||
}
|
if (url.ends_with("api/v1/owned-products/get-update-entitlements")) return onUpdateEntitlementsClient(url, body);
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-9
@@ -9,11 +9,15 @@
|
|||||||
|
|
||||||
#include <nlohmann/json_fwd.hpp>
|
#include <nlohmann/json_fwd.hpp>
|
||||||
|
|
||||||
|
#include "dbdcrypt.h"
|
||||||
|
|
||||||
struct SpooferConfig
|
struct SpooferConfig
|
||||||
{
|
{
|
||||||
bool spoofCharacterOwnership = false;
|
bool spoofCharacterOwnership = true;
|
||||||
bool spoofInventory = false;
|
bool spoofInventory = true;
|
||||||
bool spoofCustomization = false;
|
bool spoofCustomization = true;
|
||||||
|
std::string accessKey = ACCESS_KEY;
|
||||||
|
std::string keyId = KEY_ID;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Spoofer
|
class Spoofer
|
||||||
@@ -26,9 +30,9 @@ class Spoofer
|
|||||||
void loadData();
|
void loadData();
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
|
|
||||||
bool parseCatalog(std::string data);
|
bool parseStackable(std::string data, std::unordered_set<std::string>* camperSet,
|
||||||
bool parseStackable(std::string data, std::unordered_set<std::string>& camperSet,
|
std::unordered_set<std::string>* slasherSet, std::unordered_set<std::string>* globalSet);
|
||||||
std::unordered_set<std::string>& slasherSet);
|
bool parseCustomizations(std::string data);
|
||||||
|
|
||||||
std::string getRandomItem();
|
std::string getRandomItem();
|
||||||
int getRandomQuantity();
|
int getRandomQuantity();
|
||||||
@@ -36,22 +40,27 @@ class Spoofer
|
|||||||
void generateBloodweb(nlohmann::json& data);
|
void generateBloodweb(nlohmann::json& data);
|
||||||
void modifyCharacterData(nlohmann::json& js);
|
void modifyCharacterData(nlohmann::json& js);
|
||||||
|
|
||||||
void onGetCatalogItems(std::string& body);
|
|
||||||
void onGetAll(std::string& body);
|
void onGetAll(std::string& body);
|
||||||
void onInventoryAll(std::string& body);
|
void onInventoryAll(std::string& body);
|
||||||
void onMessageList(std::string& body);
|
void onMessageList(std::string& body);
|
||||||
void onBloodweb(std::string& body, std::string& respHeaders);
|
void onBloodweb(std::string& body, std::string& respHeaders);
|
||||||
|
void onGameConfigs(std::string& body);
|
||||||
|
void onUpdateEntitlements(const std::string& url, std::string& body);
|
||||||
|
|
||||||
|
void onGetAllClient(std::string& body);
|
||||||
|
void onBloodwebClient(std::string& body);
|
||||||
|
void onUpdateEntitlementsClient(const std::string& url, std::string& body);
|
||||||
|
|
||||||
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);
|
void clientRequestHandler(const std::string& url, std::string& body, std::string& reqHeaders);
|
||||||
|
|
||||||
SpooferConfig _config;
|
SpooferConfig _config;
|
||||||
|
|
||||||
std::unordered_set<std::string> _camperItemIds;
|
std::unordered_set<std::string> _camperItemIds;
|
||||||
std::unordered_set<std::string> _slasherPowerIds;
|
|
||||||
|
|
||||||
std::unordered_set<std::string> _camperOfferingIds;
|
std::unordered_set<std::string> _camperOfferingIds;
|
||||||
std::unordered_set<std::string> _slasherOfferingIds;
|
std::unordered_set<std::string> _slasherOfferingIds;
|
||||||
|
std::unordered_set<std::string> _globalOfferingIds;
|
||||||
|
|
||||||
std::unordered_set<std::string> _camperAddonIds;
|
std::unordered_set<std::string> _camperAddonIds;
|
||||||
std::unordered_set<std::string> _slasherAddonIds;
|
std::unordered_set<std::string> _slasherAddonIds;
|
||||||
@@ -63,6 +72,10 @@ class Spoofer
|
|||||||
std::unordered_set<std::string> _catalogItemIds;
|
std::unordered_set<std::string> _catalogItemIds;
|
||||||
|
|
||||||
std::unordered_set<std::string> _unownedCharacters;
|
std::unordered_set<std::string> _unownedCharacters;
|
||||||
|
std::unordered_set<std::string> _characterList;
|
||||||
|
|
||||||
|
std::unordered_set<std::string> _dlcListGRDK;
|
||||||
|
std::unordered_set<std::string> _dlcListEGS;
|
||||||
|
|
||||||
std::string _lastBloodWebChar = "";
|
std::string _lastBloodWebChar = "";
|
||||||
std::mutex _mtx;
|
std::mutex _mtx;
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ bool CertManager::generateCA()
|
|||||||
X509_gmtime_adj(X509_get_notBefore(cert.get()), 0);
|
X509_gmtime_adj(X509_get_notBefore(cert.get()), 0);
|
||||||
X509_gmtime_adj(X509_get_notAfter(cert.get()), 31536000L); // 1 year
|
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);
|
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_NAME_add_entry_by_txt(subjName, "CN", MBSTRING_ASC, (unsigned char*)randomCN.c_str(), -1, -1, 0);
|
||||||
X509_set_issuer_name(cert.get(), subjName);
|
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_notBefore(cert.get()), 0);
|
||||||
X509_gmtime_adj(X509_get_notAfter(cert.get()), 31536000L);
|
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_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_issuer_name(cert.get(), X509_get_subject_name(_caCert));
|
||||||
X509_set_pubkey(cert.get(), _sessionPkey);
|
X509_set_pubkey(cert.get(), _sessionPkey);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
struct x509_st;
|
struct x509_st;
|
||||||
|
struct X509_name_st;
|
||||||
struct ssl_st;
|
struct ssl_st;
|
||||||
struct ssl_ctx_st;
|
struct ssl_ctx_st;
|
||||||
struct evp_pkey_st;
|
struct evp_pkey_st;
|
||||||
|
|||||||
Vendored
+6
@@ -1,2 +1,8 @@
|
|||||||
add_subdirectory(nerutils)
|
add_subdirectory(nerutils)
|
||||||
add_subdirectory(json)
|
add_subdirectory(json)
|
||||||
|
|
||||||
|
set(ZLIB_BUILD_TESTING OFF)
|
||||||
|
set(ZLIB_BUILD_STATIC ON)
|
||||||
|
set(ZLIB_BUILD_SHARED OFF)
|
||||||
|
set(ZLIB_INSTALL OFF)
|
||||||
|
add_subdirectory(zlib)
|
||||||
|
|||||||
+1
Submodule vendor/zlib added at f9dd6009be
Reference in New Issue
Block a user