Skip to content

Commit

Permalink
Fixes: Migrate LdrLock into kananlib's ThreadSuspender (freeze fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Apr 5, 2024
1 parent e79cb80 commit d4da1eb
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/REFramework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ try {
spdlog::error("ldr_notification_callback: Unknown exception occurred");
}

typedef NTSTATUS (WINAPI* PFN_LdrLockLoaderLock)(ULONG Flags, ULONG *State, ULONG_PTR *Cookie);
typedef NTSTATUS (WINAPI* PFN_LdrUnlockLoaderLock)(ULONG Flags, ULONG_PTR Cookie);

REFramework::REFramework(HMODULE reframework_module)
: m_game_module{GetModuleHandle(0)}
, m_logger{spdlog::basic_logger_mt("REFramework", (get_persistent_dir("re2_framework_log.txt")).string(), true)}
Expand Down Expand Up @@ -464,18 +461,7 @@ REFramework::REFramework(HMODULE reframework_module)
#endif

#if defined(REENGINE_AT)
ULONG_PTR loader_magic = 0;
auto lock_loader = (PFN_LdrLockLoaderLock)GetProcAddress(ntdll, "LdrLockLoaderLock");
auto unlock_loader = (PFN_LdrUnlockLoaderLock)GetProcAddress(ntdll, "LdrUnlockLoaderLock");

if (lock_loader != nullptr && unlock_loader != nullptr) {
lock_loader(0, NULL, &loader_magic);
}
utility::ThreadSuspender suspender{};
if (lock_loader != nullptr && unlock_loader != nullptr) {
unlock_loader(0, loader_magic);
}

IntegrityCheckBypass::ignore_application_entries();

#if defined(RE8) || defined(RE4) || defined(SF6)
Expand Down

0 comments on commit d4da1eb

Please sign in to comment.