A Windows C++ crash reporting library — capture crashes, auto-generate minidumps & detailed reports, and visualize with a built-in ImGui viewer.
HCrashReport is a lightweight C++ library that provides:
- Automatic unhandled exception capture (SEH-based)
- Generates MiniDump (.dmp) and JSON crash reports
- Provides a GUI Crash Viewer (built on ImGui + SDL2)
- Easy integration — single API call to enable
- Works on Windows (x64) Visual Studio projects
HCrashReport/
├─ CrashReport/ # GUI Viewer (Dear ImGui + SDL2)
├─ api/ # Third-party dependencies (ImGui, SDL2, stb_image, nlohmann/json)
├─ HERROR_TEST/ # Sample app demonstrating crash capture
├─ RuningTime/ # (Optional) runtime utilities
├─ x64/Release/ # Pre-built binaries (CrashReport.exe)
├─ HERROR_TEST.sln # Visual Studio solution
└─ LICENSE # MIT License
- Installs Vectored Exception Handler + SEH filter
- Uses
MiniDumpWriteDump(DbgHelp) to save.dmp - Collects:
- Crash address + code
- Call stack (backtrace)
- Loaded module info (DLLs, EXEs)
- Uses nlohmann/json to serialize crash metadata
- Generates file:
CrashReport/Crash/CrashMessage.HCrash - JSON contains:
- Exception type + message
- Stack frames (function, file, line)
- System info (OS version, CPU)
- Loaded modules (address, size, path)
CrashReport.exe- Built using Dear ImGui + SDL2 + stb_image
- Features:
- Load
.HCrashJSON +.dmpfile - Display stack trace, module list
- Image previews (e.g., application icon)
- Load
- Single header API:
HCrashReport.h - Only one call needed:
HCrashReport::RegisterCrashReporter(); - Safe to call at any point in
main()or initialization code
Installs crash handlers. Call once at app start.
- Sets vectored exception handler
- Prepares dump & report folder paths (
CrashReport/Crash) - Safe to call multiple times (idempotent)
Removes installed handlers (cleanup)
- Clone repository:
git clone https://github.com/Half-People/HCrashReport.git
- Open
HERROR_TEST.slnin Visual Studio (2019/2022) - Build (Debug/Release) — dependencies are bundled under
api/
#include "HCrashReport.h"
int main() {
HCrashReport::RegisterCrashReporter();
// your app code ...
}int* p = nullptr;
*p = 42; // CrashCrashReport/Crash/CrashMessage.HCrash(JSON)CrashReport/Crash/*.dmp(MiniDump)
CrashReport/CrashReport.exe
Load .HCrash to inspect details visually
HERROR_TEST demonstrates how crashes are captured.
HERROR_TEST.exe
Causes a deliberate crash on launch.
MIT License — see LICENSE for details.