From 072840e3078a296401ac4ec278addc574eb1d518 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sat, 1 Sep 2018 14:57:25 -0400 Subject: [PATCH] add exception handler --- GUI/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/GUI/main.cpp b/GUI/main.cpp index a080bdd..d6e074d 100644 --- a/GUI/main.cpp +++ b/GUI/main.cpp @@ -1,8 +1,19 @@ #include "mainwindow.h" #include +LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS* exception) +{ + std::wstring errorMsg(L""); + errorMsg += L"Error code: " + std::to_wstring(exception->ExceptionRecord->ExceptionCode); + errorMsg += L"\r\nError address: " + std::to_wstring((DWORD)exception->ExceptionRecord->ExceptionAddress); + errorMsg += L"\r\nAdditional info: " + std::to_wstring(exception->ExceptionRecord->ExceptionInformation[1]); + MessageBoxW(NULL, errorMsg.c_str(), L"NextHooker ERROR", MB_ICONERROR); + return EXCEPTION_CONTINUE_SEARCH; +} + int main(int argc, char *argv[]) { + AddVectoredExceptionHandler(1, ExceptionHandler); QApplication a(argc, argv); MainWindow w; w.show();