# specialko/specialk architecture

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

- Interactive diagram: https://gitdiagram.com/specialko/specialk
- Repository: https://github.com/specialko/specialk

## Overview

Special K is a Windows game-injection payload that enhances and diagnoses games at runtime. Its documented entry workflow is local proxy-DLL loading or global CBT/Shell-hook injection into a game process; injection timing matters because graphics overrides need to run before swapchain creation. The source tree also identifies configuration/UI, graphics and performance tools, input handling, storefront integrations, and diagnostics. The graph keeps these as distinct capabilities; source excerpts do not show their internal call wiring, so those relationships are omitted.

Main entry points: [`src/injection/injection.cpp`](https://github.com/specialko/specialk/blob/main/src/injection/injection.cpp) (Special K payload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_injection["Injection"]
  node_payload["Special K payload<br/>[injection.cpp]"]
end

subgraph group_graphics["Graphics and performance"]
  node_d3d11_config["D3D11 configuration<br/>[cfg_d3d11.cpp]"]
  node_d3d11_stats["D3D11 pipeline stats<br/>[pipeline_stats.cpp]"]
  node_d3d12_library["D3D12 pipeline library"]
  node_d3d12_stats["D3D12 pipeline stats"]
  node_gpu_monitor["GPU monitor<br/>[gpu_monitor.cpp]"]
  node_hdr_widget["HDR widget<br/>[hdr.cpp]"]
  node_pipeline_widget["Pipeline widget"]
end

subgraph group_interaction["UI and input"]
  node_control_panel["Control panel<br/>[control_panel.cpp]"]
  node_input_config["Input configuration<br/>[cfg_input.cpp]"]
  node_xinput["XInput handling<br/>[xinput_core.cpp]"]
  node_hid_playstation["PlayStation HID<br/>[playstation.cpp]"]
  node_imgui_widgets["UI widgets<br/>[imgui_widgets.cpp]"]
end

subgraph group_services["Integrations and diagnostics"]
  node_achievement_popup["Achievement popup<br/>[achievement.cpp]"]
  node_achievements["Storefront achievements<br/>[achievements.cpp]"]
  node_steam_client["Steam client<br/>[client.cpp]"]
  node_steam_api["Steam API<br/>[steam_api.cpp]"]
  node_gog["GOG integration<br/>[gog.cpp]"]
  node_crash_handler["Crash handler<br/>[crash_handler.cpp]"]
  node_library_loader["Library loading<br/>[load_library.cpp]"]
  node_updater["Network updater<br/>[network.cpp]"]
  node_game_plugins["Game plugins<br/>[unity.cpp]"]
end

node_game_user(("Game user"))
node_game_process["Game process"]

node_game_user -->|"loads locally or globally"| node_payload
node_payload -->|"injects into"| node_game_process

click node_payload "https://github.com/specialko/specialk/blob/main/src/injection/injection.cpp"
click node_control_panel "https://github.com/specialko/specialk/blob/main/src/control_panel.cpp"
click node_input_config "https://github.com/specialko/specialk/blob/main/src/control_panel/cfg_input.cpp"
click node_xinput "https://github.com/specialko/specialk/blob/main/src/input/xinput_core.cpp"
click node_hid_playstation "https://github.com/specialko/specialk/blob/main/src/input/hid_reports/playstation.cpp"
click node_imgui_widgets "https://github.com/specialko/specialk/blob/main/src/imgui/imgui_widgets.cpp"
click node_d3d11_config "https://github.com/specialko/specialk/blob/main/src/control_panel/cfg_d3d11.cpp"
click node_d3d11_stats "https://github.com/specialko/specialk/blob/main/src/render/d3d11/utility/pipeline_stats.cpp"
click node_d3d12_library "https://github.com/specialko/specialk/blob/main/src/render/d3d12/d3d12_pipeline_library.cpp"
click node_d3d12_stats "https://github.com/specialko/specialk/blob/main/src/render/d3d12/d3d12_pipeline_stats.cpp"
click node_gpu_monitor "https://github.com/specialko/specialk/blob/main/src/performance/gpu_monitor.cpp"
click node_hdr_widget "https://github.com/specialko/specialk/blob/main/src/widgets/hdr.cpp"
click node_pipeline_widget "https://github.com/specialko/specialk/blob/main/src/widgets/d3d11_pipeline_widget.cpp"
click node_achievement_popup "https://github.com/specialko/specialk/blob/main/src/popups/achievement.cpp"
click node_achievements "https://github.com/specialko/specialk/blob/main/src/storefront/achievements.cpp"
click node_steam_client "https://github.com/specialko/specialk/blob/main/src/steam/client.cpp"
click node_steam_api "https://github.com/specialko/specialk/blob/main/src/steam/steam_api.cpp"
click node_gog "https://github.com/specialko/specialk/blob/main/src/storefront/gog.cpp"
click node_crash_handler "https://github.com/specialko/specialk/blob/main/src/diagnostics/crash_handler.cpp"
click node_library_loader "https://github.com/specialko/specialk/blob/main/src/diagnostics/load_library.cpp"
click node_updater "https://github.com/specialko/specialk/blob/main/src/update/network.cpp"
click node_game_plugins "https://github.com/specialko/specialk/blob/main/src/plugins/unity.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_payload,node_game_user toneBlue
class node_d3d11_config,node_d3d11_stats,node_d3d12_library,node_d3d12_stats,node_gpu_monitor,node_hdr_widget,node_pipeline_widget toneAmber
class node_control_panel,node_input_config,node_xinput,node_hid_playstation,node_imgui_widgets toneMint
class node_achievement_popup,node_achievements,node_steam_client,node_steam_api,node_gog,node_crash_handler,node_library_loader,node_updater,node_game_plugins toneRose
class node_game_process toneIndigo
```

## Components

### Injection

- [Special K payload](https://github.com/specialko/specialk/blob/main/src/injection/injection.cpp): `src/injection/injection.cpp`

### Graphics and performance

- [D3D11 configuration](https://github.com/specialko/specialk/blob/main/src/control_panel/cfg_d3d11.cpp): `src/control_panel/cfg_d3d11.cpp`
- [D3D11 pipeline stats](https://github.com/specialko/specialk/blob/main/src/render/d3d11/utility/pipeline_stats.cpp): `src/render/d3d11/utility/pipeline_stats.cpp`
- [D3D12 pipeline library](https://github.com/specialko/specialk/blob/main/src/render/d3d12/d3d12_pipeline_library.cpp): `src/render/d3d12/d3d12_pipeline_library.cpp`
- [D3D12 pipeline stats](https://github.com/specialko/specialk/blob/main/src/render/d3d12/d3d12_pipeline_stats.cpp): `src/render/d3d12/d3d12_pipeline_stats.cpp`
- [GPU monitor](https://github.com/specialko/specialk/blob/main/src/performance/gpu_monitor.cpp): `src/performance/gpu_monitor.cpp`
- [HDR widget](https://github.com/specialko/specialk/blob/main/src/widgets/hdr.cpp): `src/widgets/hdr.cpp`
- [Pipeline widget](https://github.com/specialko/specialk/blob/main/src/widgets/d3d11_pipeline_widget.cpp): `src/widgets/d3d11_pipeline_widget.cpp`

### UI and input

- [Control panel](https://github.com/specialko/specialk/blob/main/src/control_panel.cpp): `src/control_panel.cpp`
- [Input configuration](https://github.com/specialko/specialk/blob/main/src/control_panel/cfg_input.cpp): `src/control_panel/cfg_input.cpp`
- [XInput handling](https://github.com/specialko/specialk/blob/main/src/input/xinput_core.cpp): `src/input/xinput_core.cpp`
- [PlayStation HID](https://github.com/specialko/specialk/blob/main/src/input/hid_reports/playstation.cpp): `src/input/hid_reports/playstation.cpp`
- [UI widgets](https://github.com/specialko/specialk/blob/main/src/imgui/imgui_widgets.cpp): `src/imgui/imgui_widgets.cpp`

### Integrations and diagnostics

- [Achievement popup](https://github.com/specialko/specialk/blob/main/src/popups/achievement.cpp): `src/popups/achievement.cpp`
- [Storefront achievements](https://github.com/specialko/specialk/blob/main/src/storefront/achievements.cpp): `src/storefront/achievements.cpp`
- [Steam client](https://github.com/specialko/specialk/blob/main/src/steam/client.cpp): `src/steam/client.cpp`
- [Steam API](https://github.com/specialko/specialk/blob/main/src/steam/steam_api.cpp): `src/steam/steam_api.cpp`
- [GOG integration](https://github.com/specialko/specialk/blob/main/src/storefront/gog.cpp): `src/storefront/gog.cpp`
- [Crash handler](https://github.com/specialko/specialk/blob/main/src/diagnostics/crash_handler.cpp): `src/diagnostics/crash_handler.cpp`
- [Library loading](https://github.com/specialko/specialk/blob/main/src/diagnostics/load_library.cpp): `src/diagnostics/load_library.cpp`
- [Network updater](https://github.com/specialko/specialk/blob/main/src/update/network.cpp): `src/update/network.cpp`
- [Game plugins](https://github.com/specialko/specialk/blob/main/src/plugins/unity.cpp): `src/plugins/unity.cpp`

### Other components

- **Game user**
- **Game process**

## Connections

- Game user → Special K payload: loads locally or globally
- Special K payload → Game process: injects into
