# s1thk3nny/bf2gameext architecture

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

- Interactive diagram: https://gitdiagram.com/s1thk3nny/bf2gameext
- Repository: https://github.com/s1thk3nny/bf2gameext

## Overview

BF2GameExt is a runtime DLL extension for Star Wars Battlefront II (2005). The player launches the game; a proxy can chain-load alongside other dinput8 proxies, and the extension identifies the executable build before applying in-memory patches and installing game hooks. Those hooks expose modding capabilities and fixes across Lua, ODF, HUD, loading screens, controllers, and engine systems. The README documents these capabilities, while sampled entry-point and build-resolution sources support the initialization structure. Many individual feature implementations were not sampled, so subsystem detail and links are limited to documented or indexed evidence.

Main entry points: [`PatcherDLL/src/core/dllmain.cpp`](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/core/dllmain.cpp) (DLL entry), [`DInput8Proxy/src/dllmain.cpp`](https://github.com/s1thk3nny/bf2gameext/blob/main/DInput8Proxy/src/dllmain.cpp) (Proxy loader), [`PatcherDLL/src/core/game_build.hpp`](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/core/game_build.hpp) (Build dispatch), [`PatcherDLL/src/core/apply_patches.cpp`](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/core/apply_patches.cpp) (Executable patching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Runtime startup"]
  node_proxy["Proxy loader<br/>[dllmain.cpp]"]
  node_extension["DLL entry<br/>[dllmain.cpp]"]
  node_build["Build dispatch<br/>[game_build.hpp]"]
  node_addresses["Address resolution<br/>[resolve.hpp]"]
  node_patching["Executable patching<br/>[apply_patches.cpp]"]
  node_detours["Detours hooks<br/>[detours.cpp]"]
end

subgraph group_modding["Modding interfaces"]
  node_lua["Lua API and hooks"]
  node_odf["ODF extensions"]
  node_hud["HUD events and fixes"]
  node_loading["Loading screens"]
end

subgraph group_gameplay["Gameplay systems"]
  node_entity["Entity behavior"]
  node_weapons["Weapon systems"]
  node_controller["Controller support"]
  node_rumble["Controller rumble"]
end

subgraph group_engine["Engine extensions"]
  node_shell["Shell and maps"]
  node_render["Rendering fixes"]
  node_limits["Engine limits"]
  node_audio["Sound reliability"]
end

subgraph group_support["Player support"]
  node_debug["Debug commands"]
  node_config["INI configuration<br/>[ini_config.hpp]"]
end

node_player(("Player launch"))

node_player -.->|"launches"| node_proxy
node_proxy -.->|"chain-loads"| node_extension
node_extension -->|"selects build"| node_build
node_extension -->|"applies patches"| node_patching
node_extension -->|"initializes hooks"| node_lua
node_build -->|"selects addresses"| node_addresses
node_patching -.->|"resolves sites"| node_addresses
node_extension -->|"initializes"| node_controller
node_extension -->|"initializes"| node_rumble
node_controller -->|"uses hooks"| node_lua
node_rumble -->|"installs hooks"| node_detours
node_extension -->|"installs fix"| node_audio
node_extension -->|"installs fixes"| node_entity
node_extension -->|"installs fixes"| node_weapons
node_extension -->|"installs fixes"| node_render
node_extension -->|"installs fixes"| node_shell
node_extension -.->|"supports"| node_loading
node_extension -.->|"adds properties"| node_odf
node_extension -.->|"adds events"| node_hud
node_extension -.->|"adds commands"| node_debug
node_extension -.->|"extends limits"| node_limits
node_extension -.->|"reads settings"| node_config

click node_proxy "https://github.com/s1thk3nny/bf2gameext/blob/main/DInput8Proxy/src/dllmain.cpp"
click node_extension "https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/core/dllmain.cpp"
click node_build "https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/core/game_build.hpp"
click node_addresses "https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/core/resolve.hpp"
click node_patching "https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/core/apply_patches.cpp"
click node_lua "https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/lua"
click node_odf "https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/entity/odf_gameext_props.cpp"
click node_hud "https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/render"
click node_loading "https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/loading_screen"
click node_entity "https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/entity"
click node_weapons "https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/weapon"
click node_controller "https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/controller/controller_support.cpp"
click node_rumble "https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/controller/controller_rumble.cpp"
click node_shell "https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/shell"
click node_render "https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/render"
click node_limits "https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/util"
click node_audio "https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/util/snd_engine_open_fix.cpp"
click node_debug "https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/debug_commands"
click node_config "https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/util/ini_config.hpp"
click node_detours "https://github.com/s1thk3nny/bf2gameext/blob/main/Detours/src/detours.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_proxy,node_extension,node_build,node_addresses,node_patching,node_detours toneBlue
class node_lua,node_odf,node_hud,node_loading toneAmber
class node_entity,node_weapons,node_controller,node_rumble toneMint
class node_shell,node_render,node_limits,node_audio toneRose
class node_debug,node_config,node_player toneIndigo
```

## Components

### Runtime startup

- [Proxy loader](https://github.com/s1thk3nny/bf2gameext/blob/main/DInput8Proxy/src/dllmain.cpp): `DInput8Proxy/src/dllmain.cpp`
- [DLL entry](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/core/dllmain.cpp): `PatcherDLL/src/core/dllmain.cpp`
- [Build dispatch](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/core/game_build.hpp): `PatcherDLL/src/core/game_build.hpp`
- [Address resolution](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/core/resolve.hpp): `PatcherDLL/src/core/resolve.hpp`
- [Executable patching](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/core/apply_patches.cpp): `PatcherDLL/src/core/apply_patches.cpp`
- [Detours hooks](https://github.com/s1thk3nny/bf2gameext/blob/main/Detours/src/detours.cpp): `Detours/src/detours.cpp`

### Modding interfaces

- [Lua API and hooks](https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/lua): `PatcherDLL/src/lua`
- [ODF extensions](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/entity/odf_gameext_props.cpp): `PatcherDLL/src/entity/odf_gameext_props.cpp`
- [HUD events and fixes](https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/render): `PatcherDLL/src/render`
- [Loading screens](https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/loading_screen): `PatcherDLL/src/loading_screen`

### Gameplay systems

- [Entity behavior](https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/entity): `PatcherDLL/src/entity`
- [Weapon systems](https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/weapon): `PatcherDLL/src/weapon`
- [Controller support](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/controller/controller_support.cpp): `PatcherDLL/src/controller/controller_support.cpp`
- [Controller rumble](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/controller/controller_rumble.cpp): `PatcherDLL/src/controller/controller_rumble.cpp`

### Engine extensions

- [Shell and maps](https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/shell): `PatcherDLL/src/shell`
- [Rendering fixes](https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/render): `PatcherDLL/src/render`
- [Engine limits](https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/util): `PatcherDLL/src/util`
- [Sound reliability](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/util/snd_engine_open_fix.cpp): `PatcherDLL/src/util/snd_engine_open_fix.cpp`

### Player support

- [Debug commands](https://github.com/s1thk3nny/bf2gameext/tree/main/PatcherDLL/src/debug_commands): `PatcherDLL/src/debug_commands`
- [INI configuration](https://github.com/s1thk3nny/bf2gameext/blob/main/PatcherDLL/src/util/ini_config.hpp): `PatcherDLL/src/util/ini_config.hpp`

### Other components

- **Player launch**

## Connections

- Player launch → Proxy loader: launches
- Proxy loader → DLL entry: chain-loads
- DLL entry → Build dispatch: selects build (evidence: `PatcherDLL/src/core/dllmain.cpp`)
- DLL entry → Executable patching: applies patches (evidence: `PatcherDLL/src/core/dllmain.cpp`)
- DLL entry → Lua API and hooks: initializes hooks (evidence: `PatcherDLL/src/core/dllmain.cpp`)
- Build dispatch → Address resolution: selects addresses (evidence: `PatcherDLL/src/core/game_build.hpp`)
- Executable patching → Address resolution: resolves sites
- DLL entry → Controller support: initializes (evidence: `PatcherDLL/src/core/dllmain.cpp`)
- DLL entry → Controller rumble: initializes (evidence: `PatcherDLL/src/core/dllmain.cpp`)
- Controller support → Lua API and hooks: uses hooks (evidence: `PatcherDLL/src/controller/controller_support.cpp`)
- Controller rumble → Detours hooks: installs hooks (evidence: `PatcherDLL/src/controller/controller_rumble.cpp`)
- DLL entry → Sound reliability: installs fix (evidence: `PatcherDLL/src/core/dllmain.cpp`)
- DLL entry → Entity behavior: installs fixes (evidence: `PatcherDLL/src/core/dllmain.cpp`)
- DLL entry → Weapon systems: installs fixes (evidence: `PatcherDLL/src/core/dllmain.cpp`)
- DLL entry → Rendering fixes: installs fixes (evidence: `PatcherDLL/src/core/dllmain.cpp`)
- DLL entry → Shell and maps: installs fixes (evidence: `PatcherDLL/src/core/dllmain.cpp`)
- DLL entry → Loading screens: supports
- DLL entry → ODF extensions: adds properties
- DLL entry → HUD events and fixes: adds events
- DLL entry → Debug commands: adds commands
- DLL entry → Engine limits: extends limits (evidence: `PatcherDLL/src/core/dllmain.cpp`)
- DLL entry → INI configuration: reads settings
