# vitoplantamura/bugchecker architecture

> Architecture diagram of the GitHub repository vitoplantamura/bugchecker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vitoplantamura/bugchecker
- Repository: https://github.com/vitoplantamura/bugchecker

## Overview

BugChecker is an in-place Windows kernel/user debugger: the user enters commands or scripts, the debugger controls execution and inspects machine state through the kernel-debugger interface, then presents results in its UI. The README also documents symbol-file loading and KDCOM installation as setup capabilities. Source excerpts are limited, so edges for major documented behavior cite the README; implementation-level links are included only where the source index or excerpt supports them.

Main entry points: [`SymLoader/SymLoader.cpp`](https://github.com/vitoplantamura/bugchecker/blob/master/SymLoader/SymLoader.cpp) (Symbol Loader), [`BugChecker/Main.cpp`](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Main.cpp) (Debugger entry), [`BugChecker/QuickJS/quickjs.c`](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/QuickJS/quickjs.c) (JavaScript runtime), [`BugChecker/InputLine.cpp`](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/InputLine.cpp) (Command input)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Debugger interaction"]
  node_main["Debugger entry<br/>[Main.cpp]"]
  node_root["Debugger state<br/>[Root.cpp]"]
  node_input["Command input<br/>[InputLine.cpp]"]
  node_commands["Debugger commands<br/>[Cmd.cpp]"]
  node_code["Script window<br/>[CodeWnd.cpp]"]
  node_quickjs["JavaScript runtime<br/>[quickjs.c]"]
  node_jsbridge["JavaScript bridge"]
end

subgraph group_debug["Execution control"]
  node_breakpoints["Breakpoints and stepping<br/>[Main.cpp]"]
  node_coroutines["Async debugger operations<br/>[BcCoroutine.h]"]
  node_kdapi["KD packet interface<br/>[KdCom.h]"]
  node_platform["Kernel/platform access<br/>[Platform.cpp]"]
end

subgraph group_inspection["Inspection and symbols"]
  node_disasm["Disassembly<br/>[DisasmWnd.cpp]"]
  node_registers["Registers view<br/>[RegsWnd.cpp]"]
  node_logs["Debugger log<br/>[LogWnd.cpp]"]
  node_symbols["PDB symbols<br/>[Symbols.cpp]"]
  node_symfiles["Symbol-file handling<br/>[SymbolFile.cpp]"]
end

subgraph group_setup["Installation and support"]
  node_symloader["Symbol Loader<br/>[SymLoader.cpp]"]
  node_kdinstall["KDCOM installation<br/>[KdcomInstall.cpp]"]
  node_keyboard["PS/2 keyboard<br/>[Ps2Keyb.cpp]"]
  node_framebuffer["Framebuffer output<br/>[Platform.cpp]"]
end

node_user(("Debugger user"))
node_symbolserver(("Symbol server"))
node_windows(("Windows kernel"))

node_user -->|"enters commands"| node_input
node_user -->|"writes scripts"| node_code
node_main -->|"uses debugger state"| node_root
node_main -->|"uses platform"| node_platform
node_input -.->|"dispatches commands"| node_commands
node_commands -.->|"evaluates expressions"| node_jsbridge
node_code -->|"runs JavaScript"| node_quickjs
node_jsbridge -.->|"interfaces with"| node_quickjs
node_quickjs -->|"requests async operations"| node_coroutines
node_coroutines -->|"issues KD operations"| node_kdapi
node_kdapi -->|"controls debug state"| node_windows
node_breakpoints -->|"records breakpoint hits"| node_logs
node_breakpoints -->|"steps instructions"| node_disasm
node_user -->|"views registers"| node_registers
node_user -->|"views messages"| node_logs
node_user -.->|"inspects code"| node_disasm
node_symbols -.->|"uses symbol files"| node_symfiles
node_symloader -->|"downloads symbols"| node_symbolserver
node_symloader -->|"provides PDB files"| node_symfiles
node_symloader -->|"installs KDCOM"| node_kdinstall
node_kdinstall -->|"replaces KDCOM"| node_windows
node_keyboard -->|"supplies input"| node_main
node_platform -.->|"draws interface"| node_framebuffer

click node_main "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Main.cpp"
click node_root "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Root.cpp"
click node_input "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/InputLine.cpp"
click node_commands "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Cmd.cpp"
click node_code "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/CodeWnd.cpp"
click node_quickjs "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/QuickJS/quickjs.c"
click node_jsbridge "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/QuickJSCppInterface.cpp"
click node_breakpoints "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Main.cpp"
click node_coroutines "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/BcCoroutine.h"
click node_kdapi "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/KdCom.h"
click node_platform "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Platform.cpp"
click node_disasm "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/DisasmWnd.cpp"
click node_registers "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/RegsWnd.cpp"
click node_logs "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/LogWnd.cpp"
click node_symbols "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Symbols.cpp"
click node_symfiles "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/SymbolFile.cpp"
click node_symloader "https://github.com/vitoplantamura/bugchecker/blob/master/SymLoader/SymLoader.cpp"
click node_kdinstall "https://github.com/vitoplantamura/bugchecker/blob/master/SymLoader/KdcomInstall.cpp"
click node_keyboard "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Ps2Keyb.cpp"
click node_framebuffer "https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Platform.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_root,node_input,node_commands,node_code,node_quickjs,node_jsbridge,node_user toneBlue
class node_breakpoints,node_coroutines,node_kdapi,node_platform toneAmber
class node_disasm,node_registers,node_logs,node_symbols,node_symfiles,node_symbolserver toneMint
class node_symloader,node_kdinstall,node_keyboard,node_framebuffer toneRose
class node_windows toneIndigo
```

## Components

### Debugger interaction

- [Debugger entry](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Main.cpp): `BugChecker/Main.cpp`
- [Debugger state](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Root.cpp): `BugChecker/Root.cpp`
- [Command input](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/InputLine.cpp): `BugChecker/InputLine.cpp`
- [Debugger commands](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Cmd.cpp): `BugChecker/Cmd.cpp`
- [Script window](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/CodeWnd.cpp): `BugChecker/CodeWnd.cpp`
- [JavaScript runtime](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/QuickJS/quickjs.c): `BugChecker/QuickJS/quickjs.c`
- [JavaScript bridge](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/QuickJSCppInterface.cpp): `BugChecker/QuickJSCppInterface.cpp`

### Execution control

- [Breakpoints and stepping](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Main.cpp): `BugChecker/Main.cpp`
- [Async debugger operations](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/BcCoroutine.h): `BugChecker/BcCoroutine.h`
- [KD packet interface](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/KdCom.h): `BugChecker/KdCom.h`
- [Kernel/platform access](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Platform.cpp): `BugChecker/Platform.cpp`

### Inspection and symbols

- [Disassembly](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/DisasmWnd.cpp): `BugChecker/DisasmWnd.cpp`
- [Registers view](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/RegsWnd.cpp): `BugChecker/RegsWnd.cpp`
- [Debugger log](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/LogWnd.cpp): `BugChecker/LogWnd.cpp`
- [PDB symbols](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Symbols.cpp): `BugChecker/Symbols.cpp`
- [Symbol-file handling](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/SymbolFile.cpp): `BugChecker/SymbolFile.cpp`

### Installation and support

- [Symbol Loader](https://github.com/vitoplantamura/bugchecker/blob/master/SymLoader/SymLoader.cpp): `SymLoader/SymLoader.cpp`
- [KDCOM installation](https://github.com/vitoplantamura/bugchecker/blob/master/SymLoader/KdcomInstall.cpp): `SymLoader/KdcomInstall.cpp`
- [PS/2 keyboard](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Ps2Keyb.cpp): `BugChecker/Ps2Keyb.cpp`
- [Framebuffer output](https://github.com/vitoplantamura/bugchecker/blob/master/BugChecker/Platform.cpp): `BugChecker/Platform.cpp`

### Other components

- **Debugger user**
- **Symbol server**
- **Windows kernel**

## Connections

- Debugger user → Command input: enters commands
- Debugger user → Script window: writes scripts
- Debugger entry → Debugger state: uses debugger state (evidence: `BugChecker/Main.cpp`)
- Debugger entry → Kernel/platform access: uses platform (evidence: `BugChecker/Main.cpp`)
- Command input → Debugger commands: dispatches commands
- Debugger commands → JavaScript bridge: evaluates expressions
- Script window → JavaScript runtime: runs JavaScript
- JavaScript bridge → JavaScript runtime: interfaces with
- JavaScript runtime → Async debugger operations: requests async operations
- Async debugger operations → KD packet interface: issues KD operations (evidence: `BugChecker/BcCoroutine.h`)
- KD packet interface → Windows kernel: controls debug state
- Breakpoints and stepping → Debugger log: records breakpoint hits (evidence: `BugChecker/Main.cpp`)
- Breakpoints and stepping → Disassembly: steps instructions (evidence: `BugChecker/Main.cpp`)
- Debugger user → Registers view: views registers
- Debugger user → Debugger log: views messages
- Debugger user → Disassembly: inspects code
- PDB symbols → Symbol-file handling: uses symbol files
- Symbol Loader → Symbol server: downloads symbols
- Symbol Loader → Symbol-file handling: provides PDB files
- Symbol Loader → KDCOM installation: installs KDCOM
- KDCOM installation → Windows kernel: replaces KDCOM
- PS/2 keyboard → Debugger entry: supplies input (evidence: `BugChecker/Main.cpp`)
- Kernel/platform access → Framebuffer output: draws interface
