diff --git a/Dalamud.Boot/dllmain.cpp b/Dalamud.Boot/dllmain.cpp index cc3d38018..b31ae0d23 100644 --- a/Dalamud.Boot/dllmain.cpp +++ b/Dalamud.Boot/dllmain.cpp @@ -30,7 +30,9 @@ DllExport DWORD WINAPI Initialize(LPVOID lpParam, HANDLE hMainThreadContinue) { if (bootconfig::is_wait_messagebox()) MessageBoxW(nullptr, L"Press OK to continue", L"Dalamud Boot", MB_OK); + logging::print("Applying fixes..."); xivfixes::apply_all(true); + logging::print("Fixes OK"); if (bootconfig::is_wait_debugger()) { logging::print("Waiting for debugger to attach..."); @@ -45,6 +47,8 @@ DllExport DWORD WINAPI Initialize(LPVOID lpParam, HANDLE hMainThreadContinue) { // ============================== CLR ========================================= // + logging::print("Calling InitializeClrAndGetEntryPoint"); + void* entrypoint_vfn; int result = InitializeClrAndGetEntryPoint( g_hModule, diff --git a/Dalamud.Boot/xivfixes.cpp b/Dalamud.Boot/xivfixes.cpp index cc5c8a0b4..0f537e27d 100644 --- a/Dalamud.Boot/xivfixes.cpp +++ b/Dalamud.Boot/xivfixes.cpp @@ -69,6 +69,7 @@ void xivfixes::prevent_devicechange_crashes(bool bApply) { return hWnd; }); + logging::print("{} Enable", LogTag); } else { logging::print("{} Disable", LogTag); @@ -86,9 +87,9 @@ void xivfixes::disable_game_openprocess_access_check(bool bApply) { if (bApply) { hook.emplace("kernel32.dll", "OpenProcess", 0); hook->set_detour([](DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)->HANDLE { - if (dwProcessId == GetCurrentProcessId()) { - logging::print("{} OpenProcess(0{:08X}, {}, {}) was invoked by thread {}.", LogTag, dwDesiredAccess, bInheritHandle, dwProcessId, GetCurrentThreadId()); + logging::print("{} OpenProcess(0{:08X}, {}, {}) was invoked by thread {}.", LogTag, dwDesiredAccess, bInheritHandle, dwProcessId, GetCurrentThreadId()); + if (dwProcessId == GetCurrentProcessId()) { // Prevent game from feeling unsafe that it restarts if (dwDesiredAccess & PROCESS_VM_WRITE) { logging::print("{} Returning failure with last error code set to ERROR_ACCESS_DENIED(5).", LogTag); @@ -100,6 +101,7 @@ void xivfixes::disable_game_openprocess_access_check(bool bApply) { return hook->call_original(dwDesiredAccess, bInheritHandle, dwProcessId); }); + logging::print("{} Enable", LogTag); } else { logging::print("{} Disable", LogTag); hook.reset(); @@ -111,7 +113,6 @@ void xivfixes::redirect_openprocess(bool bApply) { static std::optional> hook; if (bApply) { - logging::print("{} Enable", LogTag); hook.emplace(OpenProcess); hook->set_detour([](DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)->HANDLE { if (dwProcessId == GetCurrentProcessId()) { @@ -125,6 +126,8 @@ void xivfixes::redirect_openprocess(bool bApply) { return hook->call_original(dwDesiredAccess, bInheritHandle, dwProcessId); }); + logging::print("{} Enable", LogTag); + } else { logging::print("{} Disable", LogTag); hook.reset();