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();