# madoiscool/bettersteamtools architecture

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

- Interactive diagram: https://gitdiagram.com/madoiscool/bettersteamtools
- Repository: https://github.com/madoiscool/bettersteamtools

## Overview

BetterSteamTools is a Windows Steam-unlock DLL: Lua/TOML configuration supplies game and depot rules, then hooks alter Steam-client behavior so configured games can be accessed and launched. The graph includes the documented manifest, ticket, stats, hot-reload, injection, family-sharing, online-fix, and cloud-redirection capabilities. Hook ownership is grounded in HookManager and PipeManager; several feature details come from the README because their implementation was not sampled.

Main entry points: [`src/Hook/HookManager.cpp`](https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/HookManager.cpp) (Hook manager), [`src/Hook/Hooks_Misc.cpp`](https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_Misc.cpp) (Misc and online hooks), [`src/Utils/Config/LuaConfig.cpp`](https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/Config/LuaConfig.cpp) (Lua configuration), [`src/dllmain.cpp`](https://github.com/madoiscool/bettersteamtools/blob/main/src/dllmain.cpp) (DLL runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Runtime setup"]
  node_runtime["DLL runtime<br/>[dllmain.cpp]"]
  node_hooks["Hook manager<br/>[HookManager.cpp]"]
end

subgraph group_hooks["Steam interception"]
  node_clienthooks["Steam client hooks<br/>[Hooks_IPC.cpp]"]
  node_manifhooks["Manifest hooks<br/>[Hooks_Manifest.cpp]"]
  node_misc["Misc and online hooks<br/>[Hooks_Misc.cpp]"]
  node_netpacket["Network packet hooks"]
  node_package["Package hooks<br/>[Hooks_Package.cpp]"]
end

subgraph group_game["Game access"]
  node_decrypt["Depot decryption"]
  node_pipe["Pipe handshake routing<br/>[PipeManager.cpp]"]
  node_denuvo["Denuvo authorization<br/>[DenuvoAuth.cpp]"]
  node_injection["Optional DLL injection<br/>[Injection.cpp]"]
end

subgraph group_metadata["Metadata services"]
  node_manifest["Manifest code client<br/>[ManifestClient.cpp]"]
  node_eticket["On-demand tickets<br/>[EticketClient.cpp]"]
  node_stats["Stats lookup<br/>[StatsClient.cpp]"]
  node_cloud["Cloud save redirection"]
end

subgraph group_config["Configuration"]
  node_lua["Lua configuration<br/>[LuaConfig.cpp]"]
  node_watch["Config hot reload<br/>[LuaFileWatcher.cpp]"]
end

node_user(("Steam user"))
node_steam["Steam client"]
node_gameproc["Game process"]
node_configfile["TOML and Lua"]
node_manifestservice(("Manifest providers"))
node_ticketservice(("Ticket backend"))
node_statsservice(("Stats API"))
node_cloudmodule["Cloud redirect DLL"]

node_user -->|"launches"| node_steam
node_configfile -->|"loads rules"| node_lua
node_runtime -->|"loads configuration"| node_lua
node_runtime -->|"installs hooks"| node_hooks
node_runtime -->|"starts watcher"| node_watch
node_watch -->|"reloads scripts"| node_lua
node_hooks -->|"installs"| node_clienthooks
node_hooks -->|"installs"| node_manifhooks
node_hooks -->|"installs"| node_misc
node_hooks -->|"installs"| node_netpacket
node_hooks -->|"installs"| node_package
node_steam -->|"IPC calls"| node_clienthooks
node_steam -->|"manifest requests"| node_manifhooks
node_steam -->|"Steam calls"| node_misc
node_steam -->|"packet traffic"| node_netpacket
node_steam -->|"package requests"| node_package
node_clienthooks -->|"serves configured keys"| node_decrypt
node_clienthooks -->|"routes handshakes"| node_pipe
node_pipe -->|"checks app rules"| node_lua
node_pipe -->|"applies authorization"| node_denuvo
node_pipe -->|"applies injection rules"| node_injection
node_denuvo -.->|"fetches fresh tickets"| node_eticket
node_eticket -.->|"requests tickets"| node_ticketservice
node_manifhooks -->|"resolves request codes"| node_manifest
node_manifest -->|"tries Lua endpoints"| node_lua
node_manifest -.->|"fetches codes"| node_manifestservice
node_netpacket -->|"gets ownership ticket"| node_eticket
node_stats -.->|"queries SteamID"| node_statsservice
node_misc -->|"resolves stats identity"| node_stats
node_misc -->|"spoofs configured identity"| node_steam
node_misc -->|"supports online fix"| node_gameproc
node_injection -->|"injects DLL"| node_gameproc
node_runtime -.->|"initializes optionally"| node_cloud
node_cloud -.->|"loads if enabled"| node_cloudmodule
node_decrypt -->|"provides depot keys"| node_gameproc
node_package -->|"alters package results"| node_steam
node_manifhooks -->|"returns request code"| node_steam

click node_runtime "https://github.com/madoiscool/bettersteamtools/blob/main/src/dllmain.cpp"
click node_hooks "https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/HookManager.cpp"
click node_lua "https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/Config/LuaConfig.cpp"
click node_watch "https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/Config/LuaFileWatcher.cpp"
click node_clienthooks "https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_IPC.cpp"
click node_manifhooks "https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_Manifest.cpp"
click node_misc "https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_Misc.cpp"
click node_netpacket "https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_NetPacket.cpp"
click node_package "https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_Package.cpp"
click node_decrypt "https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_Decryption.cpp"
click node_pipe "https://github.com/madoiscool/bettersteamtools/blob/main/src/Pipe/PipeManager.cpp"
click node_denuvo "https://github.com/madoiscool/bettersteamtools/blob/main/src/Pipe/Features/DenuvoAuth/DenuvoAuth.cpp"
click node_injection "https://github.com/madoiscool/bettersteamtools/blob/main/src/Pipe/Features/Injection/Injection.cpp"
click node_manifest "https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/SteamMetadata/ManifestClient.cpp"
click node_eticket "https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/Tickets/EticketClient.cpp"
click node_stats "https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/SteamMetadata/StatsClient.cpp"
click node_cloud "https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/CloudRedirect/CloudRedirectHost.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_runtime,node_hooks,node_user,node_steam toneBlue
class node_clienthooks,node_manifhooks,node_misc,node_netpacket,node_package toneAmber
class node_decrypt,node_pipe,node_denuvo,node_injection,node_statsservice toneMint
class node_manifest,node_eticket,node_stats,node_cloud toneRose
class node_lua,node_watch,node_gameproc,node_configfile,node_manifestservice,node_ticketservice,node_cloudmodule toneIndigo
```

## Components

### Runtime setup

- [DLL runtime](https://github.com/madoiscool/bettersteamtools/blob/main/src/dllmain.cpp): `src/dllmain.cpp`
- [Hook manager](https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/HookManager.cpp): `src/Hook/HookManager.cpp`

### Steam interception

- [Steam client hooks](https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_IPC.cpp): `src/Hook/Hooks_IPC.cpp`
- [Manifest hooks](https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_Manifest.cpp): `src/Hook/Hooks_Manifest.cpp`
- [Misc and online hooks](https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_Misc.cpp): `src/Hook/Hooks_Misc.cpp`
- [Network packet hooks](https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_NetPacket.cpp): `src/Hook/Hooks_NetPacket.cpp`
- [Package hooks](https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_Package.cpp): `src/Hook/Hooks_Package.cpp`

### Game access

- [Depot decryption](https://github.com/madoiscool/bettersteamtools/blob/main/src/Hook/Hooks_Decryption.cpp): `src/Hook/Hooks_Decryption.cpp`
- [Pipe handshake routing](https://github.com/madoiscool/bettersteamtools/blob/main/src/Pipe/PipeManager.cpp): `src/Pipe/PipeManager.cpp`
- [Denuvo authorization](https://github.com/madoiscool/bettersteamtools/blob/main/src/Pipe/Features/DenuvoAuth/DenuvoAuth.cpp): `src/Pipe/Features/DenuvoAuth/DenuvoAuth.cpp`
- [Optional DLL injection](https://github.com/madoiscool/bettersteamtools/blob/main/src/Pipe/Features/Injection/Injection.cpp): `src/Pipe/Features/Injection/Injection.cpp`

### Metadata services

- [Manifest code client](https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/SteamMetadata/ManifestClient.cpp): `src/Utils/SteamMetadata/ManifestClient.cpp`
- [On-demand tickets](https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/Tickets/EticketClient.cpp): `src/Utils/Tickets/EticketClient.cpp`
- [Stats lookup](https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/SteamMetadata/StatsClient.cpp): `src/Utils/SteamMetadata/StatsClient.cpp`
- [Cloud save redirection](https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/CloudRedirect/CloudRedirectHost.cpp): `src/Utils/CloudRedirect/CloudRedirectHost.cpp`

### Configuration

- [Lua configuration](https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/Config/LuaConfig.cpp): `src/Utils/Config/LuaConfig.cpp`
- [Config hot reload](https://github.com/madoiscool/bettersteamtools/blob/main/src/Utils/Config/LuaFileWatcher.cpp): `src/Utils/Config/LuaFileWatcher.cpp`

### Other components

- **Steam user**
- **Steam client**
- **Game process**
- **TOML and Lua**
- **Manifest providers**
- **Ticket backend**
- **Stats API**
- **Cloud redirect DLL**

## Connections

- Steam user → Steam client: launches
- TOML and Lua → Lua configuration: loads rules
- DLL runtime → Lua configuration: loads configuration
- DLL runtime → Hook manager: installs hooks
- DLL runtime → Config hot reload: starts watcher
- Config hot reload → Lua configuration: reloads scripts
- Hook manager → Steam client hooks: installs
- Hook manager → Manifest hooks: installs
- Hook manager → Misc and online hooks: installs
- Hook manager → Network packet hooks: installs
- Hook manager → Package hooks: installs
- Steam client → Steam client hooks: IPC calls
- Steam client → Manifest hooks: manifest requests
- Steam client → Misc and online hooks: Steam calls
- Steam client → Network packet hooks: packet traffic
- Steam client → Package hooks: package requests
- Steam client hooks → Depot decryption: serves configured keys
- Steam client hooks → Pipe handshake routing: routes handshakes
- Pipe handshake routing → Lua configuration: checks app rules
- Pipe handshake routing → Denuvo authorization: applies authorization
- Pipe handshake routing → Optional DLL injection: applies injection rules
- Denuvo authorization → On-demand tickets: fetches fresh tickets
- On-demand tickets → Ticket backend: requests tickets
- Manifest hooks → Manifest code client: resolves request codes
- Manifest code client → Lua configuration: tries Lua endpoints
- Manifest code client → Manifest providers: fetches codes
- Network packet hooks → On-demand tickets: gets ownership ticket
- Stats lookup → Stats API: queries SteamID
- Misc and online hooks → Stats lookup: resolves stats identity
- Misc and online hooks → Steam client: spoofs configured identity
- Misc and online hooks → Game process: supports online fix
- Optional DLL injection → Game process: injects DLL
- DLL runtime → Cloud save redirection: initializes optionally
- Cloud save redirection → Cloud redirect DLL: loads if enabled
- Depot decryption → Game process: provides depot keys
- Package hooks → Steam client: alters package results
- Manifest hooks → Steam client: returns request code
