# excanear/dll-hijacking-system architecture

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

- Interactive diagram: https://gitdiagram.com/excanear/dll-hijacking-system
- Repository: https://github.com/excanear/dll-hijacking-system

## Overview

This is a Windows DLL-hijacking defense product with a WPF management GUI over a C++/CLI bridge to a native C++ engine. The principal workflow is configuring the service, then validating DLLs or starting runtime monitoring and viewing findings; offline dependency auditing and log review are separate user-facing workflows. The README documents the five protection capabilities and the GUI/bridge/engine layers. Some native implementations and page wiring were not sampled, so internal links are limited to documented or indexed relationships.

Main entry points: [`DhdGui/Services/DhdService.cs`](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Services/DhdService.cs) (Defense service), [`DhdBridge/DhdBridge.cpp`](https://github.com/excanear/dll-hijacking-system/blob/main/DhdBridge/DhdBridge.cpp) (Native bridge), [`dll-hijack-defense/monitor/runtime_monitor.cpp`](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/monitor/runtime_monitor.cpp) (Runtime monitor), [`dll-hijack-defense/core/dll_validator.cpp`](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/core/dll_validator.cpp) (DLL validator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Management GUI"]
  node_app["WPF application<br/>[App.xaml.cs]"]
  node_dashboard["Dashboard"]
  node_validateui["DLL validation UI"]
  node_monitorui["Monitor UI"]
  node_auditui["Audit UI"]
  node_logsui["Log viewer"]
  node_settings["Settings UI"]
  node_validationmodel["Validation result"]
  node_monitorfinding["Monitor finding"]
  node_auditfinding["Audit finding"]
  node_logevent["Log event<br/>[LogEventModel.cs]"]
end

subgraph group_interop["Managed Interop"]
  node_service["Defense service<br/>[DhdService.cs]"]
  node_logreader["Log file reader<br/>[LogFileReader.cs]"]
  node_bridge["Native bridge<br/>[DhdBridge.cpp]"]
end

subgraph group_core["Protection Core"]
  node_defense["Defense lifecycle<br/>[defense_system.cpp]"]
  node_hardening["Search hardening<br/>[hardening.cpp]"]
  node_validator["DLL validator<br/>[dll_validator.cpp]"]
  node_loader["Secure loader<br/>[secure_loader.cpp]"]
  node_policy["Runtime policy<br/>[policy.cpp]"]
  node_contracts["Shared contracts<br/>[types.h]"]
end

subgraph group_intel["Intelligence"]
  node_risk["Risk analysis<br/>[risk_analyzer.cpp]"]
  node_logger["Event logging<br/>[logging_engine.cpp]"]
end

subgraph group_operations["Detection Operations"]
  node_monitor["Runtime monitor"]
  node_audit["Offline auditor<br/>[audit_scanner.cpp]"]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_app
node_app -->|"resolves"| node_dashboard
node_app -->|"registers"| node_service
node_dashboard -->|"calls"| node_service
node_dashboard -->|"reads logs"| node_logreader
node_validateui -->|"calls"| node_service
node_monitorui -->|"calls"| node_service
node_auditui -->|"calls"| node_service
node_logsui -->|"reads logs"| node_logreader
node_settings -->|"calls"| node_service
node_logsui -->|"calls"| node_service
node_logreader -->|"creates"| node_logevent
node_service -->|"invokes"| node_bridge
node_bridge -->|"initializes"| node_defense
node_bridge -->|"dispatches"| node_validator
node_bridge -->|"dispatches"| node_hardening
node_bridge -->|"dispatches"| node_monitor
node_bridge -->|"dispatches"| node_audit
node_bridge -->|"dispatches"| node_logger
node_validator -->|"queries"| node_policy
node_loader -->|"validates"| node_validator
node_loader -->|"emits events"| node_logger
node_monitor -->|"emits alerts"| node_logger
node_monitor -->|"checks loader"| node_loader
node_risk -.->|"uses thresholds"| node_policy
node_audit -->|"uses policy"| node_policy
node_service -->|"maps results"| node_validationmodel
node_service -->|"maps findings"| node_monitorfinding
node_service -->|"maps findings"| node_auditfinding
node_monitor -->|"uses types"| node_contracts
node_validator -->|"uses types"| node_contracts
node_logger -->|"uses events"| node_contracts
node_audit -->|"uses types"| node_contracts

click node_app "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/App.xaml.cs"
click node_dashboard "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/DashboardViewModel.cs"
click node_validateui "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/ValidateDllViewModel.cs"
click node_monitorui "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/RealtimeMonitorViewModel.cs"
click node_auditui "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/AuditScannerViewModel.cs"
click node_logsui "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/LogViewerViewModel.cs"
click node_settings "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/SettingsViewModel.cs"
click node_service "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Services/DhdService.cs"
click node_logreader "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Services/LogFileReader.cs"
click node_bridge "https://github.com/excanear/dll-hijacking-system/blob/main/DhdBridge/DhdBridge.cpp"
click node_defense "https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/core/defense_system.cpp"
click node_hardening "https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/core/hardening.cpp"
click node_validator "https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/core/dll_validator.cpp"
click node_loader "https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/core/secure_loader.cpp"
click node_policy "https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/shared/policy.cpp"
click node_risk "https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/intelligence/risk_analyzer.cpp"
click node_logger "https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/intelligence/logging_engine.cpp"
click node_monitor "https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/monitor/runtime_monitor.cpp"
click node_audit "https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/audit/audit_scanner.cpp"
click node_contracts "https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/shared/types.h"
click node_validationmodel "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Models/ValidationResultModel.cs"
click node_monitorfinding "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Models/MonitorFindingModel.cs"
click node_auditfinding "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Models/AuditFindingModel.cs"
click node_logevent "https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Models/LogEventModel.cs"

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_app,node_dashboard,node_validateui,node_monitorui,node_auditui,node_logsui,node_settings,node_validationmodel,node_monitorfinding,node_auditfinding,node_logevent toneBlue
class node_service,node_logreader,node_bridge toneAmber
class node_defense,node_hardening,node_validator,node_loader,node_policy,node_contracts toneMint
class node_risk,node_logger toneRose
class node_monitor,node_audit,node_operator toneIndigo
```

## Components

### Management GUI

- [WPF application](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/App.xaml.cs): `DhdGui/App.xaml.cs`
- [Dashboard](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/DashboardViewModel.cs): `DhdGui/ViewModels/DashboardViewModel.cs`
- [DLL validation UI](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/ValidateDllViewModel.cs): `DhdGui/ViewModels/ValidateDllViewModel.cs`
- [Monitor UI](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/RealtimeMonitorViewModel.cs): `DhdGui/ViewModels/RealtimeMonitorViewModel.cs`
- [Audit UI](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/AuditScannerViewModel.cs): `DhdGui/ViewModels/AuditScannerViewModel.cs`
- [Log viewer](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/LogViewerViewModel.cs): `DhdGui/ViewModels/LogViewerViewModel.cs`
- [Settings UI](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/ViewModels/SettingsViewModel.cs): `DhdGui/ViewModels/SettingsViewModel.cs`
- [Validation result](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Models/ValidationResultModel.cs): `DhdGui/Models/ValidationResultModel.cs`
- [Monitor finding](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Models/MonitorFindingModel.cs): `DhdGui/Models/MonitorFindingModel.cs`
- [Audit finding](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Models/AuditFindingModel.cs): `DhdGui/Models/AuditFindingModel.cs`
- [Log event](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Models/LogEventModel.cs): `DhdGui/Models/LogEventModel.cs`

### Managed Interop

- [Defense service](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Services/DhdService.cs): `DhdGui/Services/DhdService.cs`
- [Log file reader](https://github.com/excanear/dll-hijacking-system/blob/main/DhdGui/Services/LogFileReader.cs): `DhdGui/Services/LogFileReader.cs`
- [Native bridge](https://github.com/excanear/dll-hijacking-system/blob/main/DhdBridge/DhdBridge.cpp): `DhdBridge/DhdBridge.cpp`

### Protection Core

- [Defense lifecycle](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/core/defense_system.cpp): `dll-hijack-defense/core/defense_system.cpp`
- [Search hardening](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/core/hardening.cpp): `dll-hijack-defense/core/hardening.cpp`
- [DLL validator](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/core/dll_validator.cpp): `dll-hijack-defense/core/dll_validator.cpp`
- [Secure loader](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/core/secure_loader.cpp): `dll-hijack-defense/core/secure_loader.cpp`
- [Runtime policy](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/shared/policy.cpp): `dll-hijack-defense/shared/policy.cpp`
- [Shared contracts](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/shared/types.h): `dll-hijack-defense/shared/types.h`

### Intelligence

- [Risk analysis](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/intelligence/risk_analyzer.cpp): `dll-hijack-defense/intelligence/risk_analyzer.cpp`
- [Event logging](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/intelligence/logging_engine.cpp): `dll-hijack-defense/intelligence/logging_engine.cpp`

### Detection Operations

- [Runtime monitor](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/monitor/runtime_monitor.cpp): `dll-hijack-defense/monitor/runtime_monitor.cpp`
- [Offline auditor](https://github.com/excanear/dll-hijacking-system/blob/main/dll-hijack-defense/audit/audit_scanner.cpp): `dll-hijack-defense/audit/audit_scanner.cpp`

### Other components

- **Operator**

## Connections

- Operator → WPF application: uses (evidence: `README.md`)
- WPF application → Dashboard: resolves (evidence: `DhdGui/App.xaml.cs`)
- WPF application → Defense service: registers (evidence: `DhdGui/App.xaml.cs`)
- Dashboard → Defense service: calls (evidence: `DhdGui/ViewModels/DashboardViewModel.cs`)
- Dashboard → Log file reader: reads logs (evidence: `DhdGui/ViewModels/DashboardViewModel.cs`)
- DLL validation UI → Defense service: calls (evidence: `DhdGui/ViewModels/ValidateDllViewModel.cs`)
- Monitor UI → Defense service: calls (evidence: `DhdGui/ViewModels/RealtimeMonitorViewModel.cs`)
- Audit UI → Defense service: calls (evidence: `DhdGui/ViewModels/AuditScannerViewModel.cs`)
- Log viewer → Log file reader: reads logs (evidence: `DhdGui/ViewModels/LogViewerViewModel.cs`)
- Settings UI → Defense service: calls (evidence: `DhdGui/ViewModels/SettingsViewModel.cs`)
- Log viewer → Defense service: calls (evidence: `DhdGui/ViewModels/LogViewerViewModel.cs`)
- Log file reader → Log event: creates (evidence: `DhdGui/Services/LogFileReader.cs`)
- Defense service → Native bridge: invokes (evidence: `DhdGui/Services/DhdService.cs`)
- Native bridge → Defense lifecycle: initializes (evidence: `DhdBridge/DhdBridge.cpp`)
- Native bridge → DLL validator: dispatches (evidence: `README.md`)
- Native bridge → Search hardening: dispatches (evidence: `README.md`)
- Native bridge → Runtime monitor: dispatches (evidence: `README.md`)
- Native bridge → Offline auditor: dispatches (evidence: `README.md`)
- Native bridge → Event logging: dispatches (evidence: `DhdBridge/DhdBridge.cpp`)
- DLL validator → Runtime policy: queries (evidence: `dll-hijack-defense/core/dll_validator.cpp`)
- Secure loader → DLL validator: validates (evidence: `dll-hijack-defense/core/secure_loader.cpp`)
- Secure loader → Event logging: emits events (evidence: `dll-hijack-defense/core/secure_loader.cpp`)
- Runtime monitor → Event logging: emits alerts (evidence: `README.md`)
- Runtime monitor → Secure loader: checks loader (evidence: `dll-hijack-defense/monitor/runtime_monitor.cpp`)
- Risk analysis → Runtime policy: uses thresholds
- Offline auditor → Runtime policy: uses policy
- Defense service → Validation result: maps results (evidence: `DhdGui/Services/DhdService.cs`)
- Defense service → Monitor finding: maps findings (evidence: `DhdGui/Services/DhdService.cs`)
- Defense service → Audit finding: maps findings (evidence: `DhdGui/Services/DhdService.cs`)
- Runtime monitor → Shared contracts: uses types (evidence: `dll-hijack-defense/monitor/runtime_monitor.cpp`)
- DLL validator → Shared contracts: uses types (evidence: `dll-hijack-defense/core/dll_validator.cpp`)
- Event logging → Shared contracts: uses events (evidence: `dll-hijack-defense/intelligence/logging_engine.cpp`)
- Offline auditor → Shared contracts: uses types (evidence: `dll-hijack-defense/audit/audit_scanner.cpp`)
