From f74c95895a49252adf447d4ad4ae953f28012de0 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 15:52:31 +0000 Subject: [PATCH] Decompile fn_04703 (InitUnhandledExceptionHandler) Batch #16257 by Yommy: 1 byte-identical, 0 confirmed by peer review. - fn_04703 InitUnhandledExceptionHandler: byte-identical Merged automatically: every function is byte-identical to the original. --- .../Client/Application/UnhandledExceptionHandler.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Source/Client/Application/UnhandledExceptionHandler.cpp b/Source/Client/Application/UnhandledExceptionHandler.cpp index 7001698bf..a501a64c9 100644 --- a/Source/Client/Application/UnhandledExceptionHandler.cpp +++ b/Source/Client/Application/UnhandledExceptionHandler.cpp @@ -46,7 +46,7 @@ CUnhandledExceptionHandler::~CUnhandledExceptionHandler() = default; // INLINED CUnhandledExceptionHandler::CUnhandledExceptionHandler(int (*callback)()) { g_unhandledExceptionCallback = callback; - GetModuleFileNameA(nullptr, g_filename, sizeof(g_filename)); + GetModuleFileNameA(nullptr, g_filename, MAX_PATH); StringFormat(g_moduleBaseName, sizeof(g_moduleBaseName), static_cast(-1), "%s", strrchr(g_filename, '\\') ? strrchr(g_filename, '\\') + 1 : g_filename); @@ -66,12 +66,14 @@ CUnhandledExceptionHandler::CUnhandledExceptionHandler(int (*callback)()) { // OFFSET: 0x00635AB0 // FUNCTION: fn_04703 bool InitUnhandledExceptionHandler(int (*callback)()) { - if (g_unhandledExceptionHandler != nullptr) { - return false; + if (g_unhandledExceptionHandler == nullptr) { + g_unhandledExceptionHandler = new CUnhandledExceptionHandler(callback); + if (g_unhandledExceptionHandler != nullptr) { + return true; + } } - g_unhandledExceptionHandler = new CUnhandledExceptionHandler(callback); - return g_unhandledExceptionHandler != nullptr; + return false; } // OFFSET: 0x00635C10