Skip to content

Commit

Permalink
DD2: Fix loose file patch
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Apr 2, 2024
1 parent dd2b7c4 commit ffccfa7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mods/IntegrityCheckBypass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,12 @@ void IntegrityCheckBypass::immediate_patch_dd2() {
if (natives_str_addr) {
spdlog::info("[IntegrityCheckBypass]: Found /natives/ string for DD2. Patching...");

wchar_t* natives_str = (wchar_t*)(*natives_str_addr + 1);
wchar_t* natives_str = (wchar_t*)(*natives_str_addr + 2);
DWORD old_protect{};
VirtualProtect(natives_str, 10 * sizeof(wchar_t), PAGE_EXECUTE_READWRITE, &old_protect);

spdlog::info("[IntegrityCheckBypass]: /natives/ string: {}", utility::narrow(natives_str));

// replace string with a completely invalid string that cannot be a valid path
natives_str[0] = L'?'; // /

Expand Down

0 comments on commit ffccfa7

Please sign in to comment.