Merge pull request #674 from diamante0018/develop

This commit is contained in:
Edo 2022-12-27 11:08:45 +01:00 committed by GitHub
commit 13a7622859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -116,7 +116,7 @@ namespace Components
PathRemoveExtensionA(exeFileName); PathRemoveExtensionA(exeFileName);
// Generate filename // Generate filename
char filenameFriendlyTime[MAX_PATH]; char filenameFriendlyTime[MAX_PATH]{};
__time64_t time; __time64_t time;
tm ltime; tm ltime;
_time64(&time); _time64(&time);
@ -166,11 +166,22 @@ namespace Components
} }
} }
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI Exception::SetUnhandledExceptionFilter_Stub(LPTOP_LEVEL_EXCEPTION_FILTER)
{
SetFilterHook.uninstall();
LPTOP_LEVEL_EXCEPTION_FILTER result = ::SetUnhandledExceptionFilter(&ExceptionFilter);
SetFilterHook.install();
return result;
}
Exception::Exception() Exception::Exception()
{ {
SetMiniDumpType(Flags::HasFlag("bigminidumps"), Flags::HasFlag("reallybigminidumps")); SetMiniDumpType(Flags::HasFlag("bigminidumps"), Flags::HasFlag("reallybigminidumps"));
SetUnhandledExceptionFilter(&ExceptionFilter); SetFilterHook.initialize(::SetUnhandledExceptionFilter, SetUnhandledExceptionFilter_Stub, HOOK_JUMP);
SetFilterHook.install();
::SetUnhandledExceptionFilter(&ExceptionFilter);
Utils::Hook(0x4B241F, LongJmp_Internal_Stub, HOOK_CALL).install()->quick(); Utils::Hook(0x4B241F, LongJmp_Internal_Stub, HOOK_CALL).install()->quick();
Utils::Hook(0x61DB44, LongJmp_Internal_Stub, HOOK_CALL).install()->quick(); Utils::Hook(0x61DB44, LongJmp_Internal_Stub, HOOK_CALL).install()->quick();

View File

@ -19,6 +19,8 @@ namespace Components
static void CopyMessageToClipboard(const std::string& error); static void CopyMessageToClipboard(const std::string& error);
static LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter_Stub(LPTOP_LEVEL_EXCEPTION_FILTER);
static int MiniDumpType; static int MiniDumpType;
static Utils::Hook SetFilterHook; static Utils::Hook SetFilterHook;
}; };