# softsoundd/mirrorsedgetweaks architecture

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

- Interactive diagram: https://gitdiagram.com/softsoundd/mirrorsedgetweaks
- Repository: https://github.com/softsoundd/mirrorsedgetweaks

## Overview

#### Purpose and runtime
Mirror’s Edge Tweaks is a Windows desktop utility that modifies a local Mirror’s Edge installation: settings, Unreal Engine packages, executable patches, launch behavior, mods, and game fixes. It targets .NET 10 WPF and uses MVVM; it is not a server or web application. External game-distribution variants are represented by embedded version metadata.
- `MirrorsEdgeTweaks/App.xaml`
- `MirrorsEdgeTweaks/App.xaml.cs`
- `MirrorsEdgeTweaks/Versions/steam.json`

#### UI composition and application entry
`App` starts the WPF application and `MainWindow` hosts the tabbed/settings UI. `MainViewModel` coordinates the game session, initialization, status, and feature-specific view models. Views are primarily XAML-driven with Material Design styling and custom controls/behaviors.
- `MirrorsEdgeTweaks/MainWindow.xaml`
- `MirrorsEdgeTweaks/ViewModels/MainViewModel.cs`
- `MirrorsEdgeTweaks/Themes/Generic.xaml`

#### Game discovery, session, and platform boundary
The app establishes a selected game directory, detects executable/version characteristics, and maintains session/status state before enabling changes. Steam-specific discovery/install-script handling is isolated from generic game-path and version logic.
- `MirrorsEdgeTweaks/ViewModels/GameSession.cs`
- `MirrorsEdgeTweaks/Helpers/UserTdGamePathHelper.cs`
- `MirrorsEdgeTweaks/Services/SteamService.cs`

#### Persistent configuration and filesystem safety
User application preferences are stored separately from game configuration. Game reads/writes pass through file and configuration services, while backup scopes and retention protect modified game files and limit accumulated backups. This is the critical boundary between the tool’s state and the installed game.
- `MirrorsEdgeTweaks/Services/SettingsStore.cs`
- `MirrorsEdgeTweaks/Services/GameDataService.cs`
- `MirrorsEdgeTweaks/Helpers/BackupOperationScope.cs`

#### Patch orchestration and binary compatibility
`TdGamePatcher`, executable/engine patchers, and feature patch helpers apply version-aware changes to game binaries and assets. Version catalogs, address tables, PE layout inspection, bytecode/machine-code construction, and pattern matching support patches across retail, DLC, Steam, GOG, EA, and Retold variants.
- `MirrorsEdgeTweaks/Services/TdGamePatcher.cs`
- `MirrorsEdgeTweaks/Services/ExePatcher.cs`
- `MirrorsEdgeTweaks/Helpers/TdGameVersionCatalog.cs`

#### Unreal package and graphics pipeline
Graphics/UI/FOV and script-related features operate on UE3 package data: locate packages, decompress/read them through UELib/LZO-backed services, splice or generate package/bytecode content, then write patched assets. Dynamic high-resolution UI and subtitle/graphics settings are separate feature layers over this package pipeline.
- `MirrorsEdgeTweaks/Services/UePackageLocator.cs`
- `MirrorsEdgeTweaks/Services/PackageSplicer.cs`
- `MirrorsEdgeTweaks/Services/GraphicsSettingsService.cs`

#### Downloads, optional assets, and launch integration
Optional components such as tweaks scripts and audio/mod assets are resolved from an asset manifest and remote URLs, downloaded with progress, extracted/decompressed, and installed into the game. Launching and process monitoring provide the operational boundary after modifications are applied.
- `assets-manifest.json`
- `MirrorsEdgeTweaks/Services/DownloadService.cs`
- `MirrorsEdgeTweaks/Services/GameLauncherService.cs`

Main entry points: [`MirrorsEdgeTweaks/ViewModels/MainViewModel.cs`](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/ViewModels/MainViewModel.cs) (Main ViewModel), [`MirrorsEdgeTweaks/Services/TdGamePatcher.cs`](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/TdGamePatcher.cs) (TdGame Patcher), [`MirrorsEdgeTweaks/ViewModels/GameSession.cs`](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/ViewModels/GameSession.cs) (Game Session), [`MirrorsEdgeTweaks/Services/GameDataService.cs`](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/GameDataService.cs) (Game data service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop app"]
  node_app["WPF App<br/>application entry<br/>[App.xaml.cs]"]
  node_main_window["Main Window<br/>WPF shell<br/>[MainWindow.xaml]"]
  node_main_vm["Main ViewModel<br/>MVVM coordinator<br/>[MainViewModel.cs]"]
  node_theme["Material theme<br/>XAML theme<br/>[Generic.xaml]"]
end

subgraph group_session["Game session"]
  node_game_session["Game Session<br/>session state<br/>[GameSession.cs]"]
  node_path_discovery["Game path discovery<br/>installation discovery"]
  node_steam["Steam integration<br/>platform adapter<br/>[SteamService.cs]"]
end

subgraph group_storage["Storage safety"]
  node_settings[("User settings<br/>preferences store<br/>[SettingsStore.cs]")]
  node_game_data["Game data service<br/>game file I/O<br/>[GameDataService.cs]"]
  node_backup["Backup scope<br/>filesystem protection"]
end

subgraph group_patching["Patch pipeline"]
  node_patch_orchestrator["TdGame Patcher<br/>patch orchestrator<br/>[TdGamePatcher.cs]"]
  node_exe_patcher["Executable patcher<br/>binary patcher<br/>[ExePatcher.cs]"]
  node_version_catalog["Version catalog<br/>compatibility metadata"]
  node_steam_version["Steam version metadata<br/>embedded version data<br/>[steam.json]"]
  node_package_locator["UE package locator<br/>package discovery"]
  node_package_splicer["Package splicer<br/>UE package writer<br/>[PackageSplicer.cs]"]
  node_graphics["Graphics settings<br/>feature service"]
end

subgraph group_assets["Optional assets"]
  node_asset_manifest["Asset manifest<br/>remote asset metadata"]
  node_downloads["Download service<br/>asset installer<br/>[DownloadService.cs]"]
  node_launcher["Game launcher<br/>process integration"]
end

node_app -->|"opens"| node_main_window
node_main_window -->|"binds to"| node_main_vm
node_theme -.->|"styles"| node_main_window
node_main_vm -->|"coordinates"| node_game_session
node_main_vm -->|"loads preferences"| node_settings
node_main_vm -->|"applies changes"| node_patch_orchestrator
node_main_vm -->|"configures"| node_graphics
node_main_vm -->|"installs optional assets"| node_downloads
node_main_vm -->|"launches"| node_launcher
node_path_discovery -->|"selects installation"| node_game_session
node_steam -->|"discovers Steam install"| node_game_session
node_version_catalog -->|"drives compatibility"| node_patch_orchestrator
node_steam_version -->|"defines Steam variant"| node_version_catalog
node_patch_orchestrator -->|"patches binaries"| node_exe_patcher
node_patch_orchestrator -->|"modifies game files"| node_game_data
node_graphics -->|"locates packages"| node_package_locator
node_package_locator -->|"supplies packages"| node_package_splicer
node_package_splicer -->|"writes patched assets"| node_game_data
node_game_data -->|"backs up before writes"| node_backup
node_asset_manifest -->|"resolves components"| node_downloads
node_downloads -->|"installs into game"| node_game_data
node_game_session -->|"provides game path"| node_launcher

click node_app "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/App.xaml.cs"
click node_main_window "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/MainWindow.xaml"
click node_main_vm "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/ViewModels/MainViewModel.cs"
click node_theme "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Themes/Generic.xaml"
click node_game_session "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/ViewModels/GameSession.cs"
click node_path_discovery "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Helpers/UserTdGamePathHelper.cs"
click node_steam "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/SteamService.cs"
click node_settings "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/SettingsStore.cs"
click node_game_data "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/GameDataService.cs"
click node_backup "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Helpers/BackupOperationScope.cs"
click node_patch_orchestrator "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/TdGamePatcher.cs"
click node_exe_patcher "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/ExePatcher.cs"
click node_version_catalog "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Helpers/TdGameVersionCatalog.cs"
click node_steam_version "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Versions/steam.json"
click node_package_locator "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/UePackageLocator.cs"
click node_package_splicer "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/PackageSplicer.cs"
click node_graphics "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/GraphicsSettingsService.cs"
click node_asset_manifest "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/assets-manifest.json"
click node_downloads "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/DownloadService.cs"
click node_launcher "https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/GameLauncherService.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_main_window,node_main_vm,node_theme toneBlue
class node_game_session,node_path_discovery,node_steam toneAmber
class node_settings,node_game_data,node_backup toneMint
class node_patch_orchestrator,node_exe_patcher,node_version_catalog,node_steam_version,node_package_locator,node_package_splicer,node_graphics toneRose
class node_asset_manifest,node_downloads,node_launcher toneIndigo
```

## Components

### Desktop app

- [WPF App](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/App.xaml.cs): application entry · Starts the desktop utility. · `MirrorsEdgeTweaks/App.xaml.cs`
- [Main Window](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/MainWindow.xaml): WPF shell · Hosts the tabbed settings UI. · `MirrorsEdgeTweaks/MainWindow.xaml`
- [Main ViewModel](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/ViewModels/MainViewModel.cs): MVVM coordinator · Coordinates initialization, status, session, and feature view models. · `MirrorsEdgeTweaks/ViewModels/MainViewModel.cs`
- [Material theme](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Themes/Generic.xaml): XAML theme · `MirrorsEdgeTweaks/Themes/Generic.xaml`

### Game session

- [Game Session](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/ViewModels/GameSession.cs): session state · Maintains selected installation and detected game status. · `MirrorsEdgeTweaks/ViewModels/GameSession.cs`
- [Game path discovery](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Helpers/UserTdGamePathHelper.cs): installation discovery · `MirrorsEdgeTweaks/Helpers/UserTdGamePathHelper.cs`
- [Steam integration](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/SteamService.cs): platform adapter · Handles Steam discovery and install-script behavior. · `MirrorsEdgeTweaks/Services/SteamService.cs`

### Storage safety

- [User settings](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/SettingsStore.cs): preferences store · Stores tool preferences separately from game files. · `MirrorsEdgeTweaks/Services/SettingsStore.cs`
- [Game data service](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/GameDataService.cs): game file I/O · Provides game configuration and file reads/writes. · `MirrorsEdgeTweaks/Services/GameDataService.cs`
- [Backup scope](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Helpers/BackupOperationScope.cs): filesystem protection · Protects modified files and manages backup retention. · `MirrorsEdgeTweaks/Helpers/BackupOperationScope.cs`

### Patch pipeline

- [TdGame Patcher](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/TdGamePatcher.cs): patch orchestrator · Applies version-aware game changes. · `MirrorsEdgeTweaks/Services/TdGamePatcher.cs`
- [Executable patcher](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/ExePatcher.cs): binary patcher · Patches executable and engine binary content. · `MirrorsEdgeTweaks/Services/ExePatcher.cs`
- [Version catalog](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Helpers/TdGameVersionCatalog.cs): compatibility metadata · Identifies supported game distribution variants. · `MirrorsEdgeTweaks/Helpers/TdGameVersionCatalog.cs`
- [Steam version metadata](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Versions/steam.json): embedded version data · `MirrorsEdgeTweaks/Versions/steam.json`
- [UE package locator](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/UePackageLocator.cs): package discovery · Finds UE3 assets targeted by graphics and script features. · `MirrorsEdgeTweaks/Services/UePackageLocator.cs`
- [Package splicer](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/PackageSplicer.cs): UE package writer · Generates or splices package and bytecode content. · `MirrorsEdgeTweaks/Services/PackageSplicer.cs`
- [Graphics settings](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/GraphicsSettingsService.cs): feature service · Applies graphics, UI, subtitle, and FOV package changes. · `MirrorsEdgeTweaks/Services/GraphicsSettingsService.cs`

### Optional assets

- [Asset manifest](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/assets-manifest.json): remote asset metadata · `assets-manifest.json`
- [Download service](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/DownloadService.cs): asset installer · Downloads, extracts, and installs optional components. · `MirrorsEdgeTweaks/Services/DownloadService.cs`
- [Game launcher](https://github.com/softsoundd/mirrorsedgetweaks/blob/main/MirrorsEdgeTweaks/Services/GameLauncherService.cs): process integration · Launches and monitors the modified game. · `MirrorsEdgeTweaks/Services/GameLauncherService.cs`

## Connections

- WPF App → Main Window: opens
- Main Window → Main ViewModel: binds to
- Material theme → Main Window: styles
- Main ViewModel → Game Session: coordinates
- Main ViewModel → User settings: loads preferences
- Main ViewModel → TdGame Patcher: applies changes
- Main ViewModel → Graphics settings: configures
- Main ViewModel → Download service: installs optional assets
- Main ViewModel → Game launcher: launches
- Game path discovery → Game Session: selects installation
- Steam integration → Game Session: discovers Steam install
- Version catalog → TdGame Patcher: drives compatibility
- Steam version metadata → Version catalog: defines Steam variant
- TdGame Patcher → Executable patcher: patches binaries
- TdGame Patcher → Game data service: modifies game files
- Graphics settings → UE package locator: locates packages
- UE package locator → Package splicer: supplies packages
- Package splicer → Game data service: writes patched assets
- Game data service → Backup scope: backs up before writes
- Asset manifest → Download service: resolves components
- Download service → Game data service: installs into game
- Game Session → Game launcher: provides game path
