Skip to content

Commit

Permalink
Fix 8-years old bad hook
Browse files Browse the repository at this point in the history
  • Loading branch information
louve committed Sep 16, 2024
1 parent 8a2e569 commit c8474f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/Components/Modules/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ namespace Components
Utils::Hook(0x406D26, FS_FileOpenReadText_Hk, HOOK_CALL).install()->quick();

// Make the exe run from a folder other than the game folder
Utils::Hook::Nop(0x4290D8, 5); // FS_IsBasePathValid
Utils::Hook::Set<uint8_t>(0x4290DF, 0xEB);
Utils::Hook::Nop(0x4290D8, 5); // FS_IsBasePathValid
Utils::Hook::Set<uint8_t>(0x4290DF, 0xEB);
// ^^ This check by the game above is super redundant, IW4x has other checks in place to make sure we
// are running from a properly installed directory. This only breaks the containerized patch and we don't need it

Expand All @@ -431,6 +431,11 @@ namespace Components
Utils::Hook(0x643232, Sys_HomePath_Hk, HOOK_CALL).install()->quick();
Utils::Hook(0x6431B6, Sys_Cwd_Hk, HOOK_CALL).install()->quick();
Utils::Hook(0x51C29A, Sys_Cwd_Hk, HOOK_CALL).install()->quick();

#if DEBUG
// fs_debug 1
Utils::Hook::Set<bool>(0x64315B + 1, true);
#endif
}

FileSystem::~FileSystem()
Expand Down
3 changes: 0 additions & 3 deletions src/Components/Modules/QuickPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,6 @@ namespace Components
// ui_debugMode 1
//Utils::Hook::Set<bool>(0x6312E0, true);

// fs_debug 1
Utils::Hook::Set<bool>(0x643172, true);

// developer 2
Utils::Hook::Set<BYTE>(0x4FA425, 2);
Utils::Hook::Set<BYTE>(0x51B087, 2);
Expand Down

0 comments on commit c8474f5

Please sign in to comment.