# thirteenag/ultimate-asi-loader architecture

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

- Interactive diagram: https://gitdiagram.com/thirteenag/ultimate-asi-loader
- Repository: https://github.com/thirteenag/ultimate-asi-loader

## Overview

Ultimate ASI Loader is a Windows DLL that presents as a game’s expected library, forwards its exports, and loads ASI plugins. The principal flow is game process → DLL initialization → startup setup, which loads the original library, configures virtual files, and loads plugins. Other substantial capabilities include compatibility shims, crash reporting, and runtime C++ snippets. The README and sampled excerpts establish the main flow; several subsystem implementations were not sampled, so their internal connections are omitted.

Main entry points: [`source/loader/main.cpp`](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/main.cpp) (Loader DLL), [`source/loader/startup/startup.cpp`](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/startup/startup.cpp) (Startup hooks), [`source/loader/cxx/snippets.cpp`](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/cxx/snippets.cpp) (C++ snippets), [`source/loader/vfs/resolve.cpp`](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/vfs/resolve.cpp) (Virtual file resolution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Loader entry"]
  node_dll["Loader DLL<br/>[main.cpp]"]
  node_identity["Loader identity and settings<br/>[loader.cpp]"]
  node_proxy["Library proxy<br/>[proxy.cpp]"]
  node_bink["Bink proxy<br/>[bink.cpp]"]
end

subgraph group_runtime["Startup runtime"]
  node_startup["Startup hooks<br/>[startup.cpp]"]
  node_pluginloading["Plugin loading<br/>[plugins.cpp]"]
  node_pluginexamples["ASI plugins"]
end

subgraph group_files["Virtual files"]
  node_vfssetup["VFS setup and hooks<br/>[setup.cpp]"]
  node_vfsresolve["Virtual file resolution<br/>[resolve.cpp]"]
  node_vfsarchive["Archive packages<br/>[zip.cpp]"]
  node_vfslayers["File layers<br/>[layers.cpp]"]
  node_vfsserver["Virtual file server client<br/>[server.cpp]"]
end

subgraph group_compat["Compatibility"]
  node_wndmode["Window and display modes"]
  node_xlive["XLive compatibility<br/>[xliveless.cpp]"]
  node_vorbis["Vorbis compatibility<br/>[vorbisfile.cpp]"]
  node_d3dshim["D3D8 window shim<br/>[maximized_shim.cpp]"]
end

subgraph group_support["Diagnostics and snippets"]
  node_crashdump["Crash dumps<br/>[crashdump.cpp]"]
  node_crashreport["Crash reports<br/>[report.cpp]"]
  node_snippets["C++ snippets<br/>[snippets.cpp]"]
  node_snippetparser["Snippet parser<br/>[parser.cpp]"]
  node_ui["Loader dialogs<br/>[dialogs.cpp]"]
  node_logging["Logging<br/>[log.cpp]"]
end

node_game(("Game process"))
node_serverexe["Virtual file server"]

node_game -->|"loads proxy"| node_dll
node_dll -->|"initializes hooks"| node_startup
node_dll -->|"installs handler"| node_crashdump
node_dll -->|"initializes identity"| node_identity
node_dll -->|"falls back to"| node_proxy
node_startup -->|"loads original"| node_proxy
node_startup -->|"sets up"| node_vfssetup
node_startup -->|"loads plugins"| node_pluginloading
node_startup -->|"may disable"| node_d3dshim
node_pluginloading -.->|"loads ASIs"| node_pluginexamples
node_vfssetup -.->|"configures"| node_vfsresolve
node_vfsresolve -.->|"selects files"| node_vfslayers
node_vfsresolve -.->|"reads packages"| node_vfsarchive
node_vfsserver -->|"starts and communicates"| node_serverexe
node_dll -->|"shuts down"| node_wndmode
node_snippets -->|"checks source"| node_snippetparser
node_snippets -->|"registers description"| node_crashdump
node_snippets -->|"reports errors"| node_ui

click node_dll "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/main.cpp"
click node_identity "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/core/loader.cpp"
click node_proxy "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/proxy/proxy.cpp"
click node_bink "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/proxy/bink.cpp"
click node_startup "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/startup/startup.cpp"
click node_pluginloading "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/plugins/plugins.cpp"
click node_pluginexamples "https://github.com/thirteenag/ultimate-asi-loader/tree/master/source/plugins"
click node_vfssetup "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/vfs/setup.cpp"
click node_vfsresolve "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/vfs/resolve.cpp"
click node_vfsarchive "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/vfs/zip.cpp"
click node_vfslayers "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/vfs/layers.cpp"
click node_vfsserver "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/vfs/server.cpp"
click node_serverexe "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/VirtualFileServer/VirtualFileServer.cpp"
click node_wndmode "https://github.com/thirteenag/ultimate-asi-loader/tree/master/source/compat/wndmode"
click node_xlive "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/compat/xlive/xliveless.cpp"
click node_vorbis "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/compat/vorbisfile/vorbisfile.cpp"
click node_d3dshim "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/compat/d3d8/maximized_shim.cpp"
click node_crashdump "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/crash/crashdump.cpp"
click node_crashreport "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/crash/report.cpp"
click node_snippets "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/cxx/snippets.cpp"
click node_snippetparser "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/cxx/cxxsnippets/parser.cpp"
click node_ui "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/ui/dialogs.cpp"
click node_logging "https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/core/log.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_dll,node_identity,node_proxy,node_bink toneBlue
class node_startup,node_pluginloading,node_pluginexamples toneAmber
class node_vfssetup,node_vfsresolve,node_vfsarchive,node_vfslayers,node_vfsserver,node_serverexe toneMint
class node_wndmode,node_xlive,node_vorbis,node_d3dshim toneRose
class node_crashdump,node_crashreport,node_snippets,node_snippetparser,node_ui,node_logging,node_game toneIndigo
```

## Components

### Loader entry

- [Loader DLL](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/main.cpp): `source/loader/main.cpp`
- [Loader identity and settings](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/core/loader.cpp): `source/loader/core/loader.cpp`
- [Library proxy](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/proxy/proxy.cpp): `source/loader/proxy/proxy.cpp`
- [Bink proxy](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/proxy/bink.cpp): `source/loader/proxy/bink.cpp`

### Startup runtime

- [Startup hooks](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/startup/startup.cpp): `source/loader/startup/startup.cpp`
- [Plugin loading](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/plugins/plugins.cpp): `source/loader/plugins/plugins.cpp`
- [ASI plugins](https://github.com/thirteenag/ultimate-asi-loader/tree/master/source/plugins): `source/plugins`

### Virtual files

- [VFS setup and hooks](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/vfs/setup.cpp): `source/loader/vfs/setup.cpp`
- [Virtual file resolution](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/vfs/resolve.cpp): `source/loader/vfs/resolve.cpp`
- [Archive packages](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/vfs/zip.cpp): `source/loader/vfs/zip.cpp`
- [File layers](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/vfs/layers.cpp): `source/loader/vfs/layers.cpp`
- [Virtual file server client](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/vfs/server.cpp): `source/loader/vfs/server.cpp`

### Compatibility

- [Window and display modes](https://github.com/thirteenag/ultimate-asi-loader/tree/master/source/compat/wndmode): `source/compat/wndmode`
- [XLive compatibility](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/compat/xlive/xliveless.cpp): `source/compat/xlive/xliveless.cpp`
- [Vorbis compatibility](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/compat/vorbisfile/vorbisfile.cpp): `source/compat/vorbisfile/vorbisfile.cpp`
- [D3D8 window shim](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/compat/d3d8/maximized_shim.cpp): `source/compat/d3d8/maximized_shim.cpp`

### Diagnostics and snippets

- [Crash dumps](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/crash/crashdump.cpp): `source/loader/crash/crashdump.cpp`
- [Crash reports](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/crash/report.cpp): `source/loader/crash/report.cpp`
- [C++ snippets](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/cxx/snippets.cpp): `source/loader/cxx/snippets.cpp`
- [Snippet parser](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/cxx/cxxsnippets/parser.cpp): `source/loader/cxx/cxxsnippets/parser.cpp`
- [Loader dialogs](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/ui/dialogs.cpp): `source/loader/ui/dialogs.cpp`
- [Logging](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/loader/core/log.cpp): `source/loader/core/log.cpp`

### Other components

- **Game process**
- [Virtual file server](https://github.com/thirteenag/ultimate-asi-loader/blob/master/source/VirtualFileServer/VirtualFileServer.cpp): `source/VirtualFileServer/VirtualFileServer.cpp`

## Connections

- Game process → Loader DLL: loads proxy
- Loader DLL → Startup hooks: initializes hooks (evidence: `source/loader/main.cpp`)
- Loader DLL → Crash dumps: installs handler (evidence: `source/loader/main.cpp`)
- Loader DLL → Loader identity and settings: initializes identity (evidence: `source/loader/main.cpp`)
- Loader DLL → Library proxy: falls back to (evidence: `source/loader/main.cpp`)
- Startup hooks → Library proxy: loads original (evidence: `source/loader/startup/startup.cpp`)
- Startup hooks → VFS setup and hooks: sets up (evidence: `source/loader/startup/startup.cpp`)
- Startup hooks → Plugin loading: loads plugins (evidence: `source/loader/startup/startup.cpp`)
- Startup hooks → D3D8 window shim: may disable (evidence: `source/loader/startup/startup.cpp`)
- Plugin loading → ASI plugins: loads ASIs
- VFS setup and hooks → Virtual file resolution: configures
- Virtual file resolution → File layers: selects files
- Virtual file resolution → Archive packages: reads packages
- Virtual file server client → Virtual file server: starts and communicates (evidence: `source/loader/vfs/server.cpp`)
- Loader DLL → Window and display modes: shuts down (evidence: `source/loader/main.cpp`)
- C++ snippets → Snippet parser: checks source (evidence: `source/loader/cxx/snippets.cpp`)
- C++ snippets → Crash dumps: registers description (evidence: `source/loader/cxx/snippets.cpp`)
- C++ snippets → Loader dialogs: reports errors (evidence: `source/loader/cxx/snippets.cpp`)
