Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0df4af980
|
||
|
|
249c02be56 | ||
|
|
042fdd631c | ||
|
|
6ba6a41cea |
No files matched your search
+2
-7
@@ -35,19 +35,14 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- **The second alpha's release would have stopped at its delta check** (for developers): Velopack names a non-default
|
||||
channel's packages with the channel (`FrameLedger.App-<version>-alpha-delta.nupkg`), and `release.yml` looked for the
|
||||
default channel's name. It now takes the delta the pack listed in `assets.<channel>.json`; the betas' packages are named
|
||||
as before (seen on the `0.1.0-alpha.1` rehearsal, which had no delta to make).
|
||||
|
||||
## Releases
|
||||
|
||||
Newest first. Each file holds that release's section exactly as it stood here.
|
||||
|
||||
| Version | Date | Notes |
|
||||
|---|---|---|
|
||||
| `0.1.0-alpha.2` | 2026-11-03 | [`docs/changelog/0.1.0-alpha.2.md`](docs/changelog/0.1.0-alpha.2.md) |
|
||||
| `0.1.0-beta.33` | 2026-11-03 | [`docs/changelog/0.1.0-beta.33.md`](docs/changelog/0.1.0-beta.33.md) |
|
||||
| `0.1.0-alpha.1` | 2026-10-31 | [`docs/changelog/0.1.0-alpha.1.md`](docs/changelog/0.1.0-alpha.1.md) |
|
||||
| `0.1.0-beta.32` | 2026-10-31 | [`docs/changelog/0.1.0-beta.32.md`](docs/changelog/0.1.0-beta.32.md) |
|
||||
| `0.1.0-beta.31` | 2026-10-26 | [`docs/changelog/0.1.0-beta.31.md`](docs/changelog/0.1.0-beta.31.md) |
|
||||
|
||||
+28
-6
@@ -5,7 +5,7 @@ hooking on for — and reading the graphics calls the game makes. That is why it
|
||||
resolution, the upscaler, frame generation and ray tracing apart. It is also where its limits come from. This
|
||||
page lists them in plain words; each item links to the document that has the details.
|
||||
|
||||
*Beta software: this page describes version 0.1.0-beta.32.*
|
||||
*Beta software: this page describes version 0.1.0-beta.33.*
|
||||
|
||||
## Games it will not measure
|
||||
|
||||
@@ -212,13 +212,35 @@ you accept the prompt. Turn it on only if you trust everything that runs under y
|
||||
its store (Settings ▸ Games ▸ *Play button*); the notice after Play says when a Steam game may hand itself to Steam.
|
||||
([details](docs/spike-notes/23-owner-runs-2026-10-20.md))
|
||||
|
||||
## Xbox app and Microsoft Store games
|
||||
|
||||
- **Only games built on Microsoft's GDK** (since 0.1.0-beta.33) — what the Xbox app and the Microsoft Store install into
|
||||
a games folder you chose, PC Game Pass games included — are found by **Import library**. An older Store app (UWP) is
|
||||
not listed, and a game Windows has not installed for you, such as one left behind on a drive, is not offered.
|
||||
([details](docs/spike-notes/25-xbox-gdk.md))
|
||||
- **Their executables cannot be read by other programs** — Windows refuses it to anything outside the game's own
|
||||
package — so FrameLedger shows no Unreal Engine version and no *Runs as* for them, and says what it could not read
|
||||
rather than guessing. A Unity game's version still reads, from its player library.
|
||||
- **The anti-cheat list's per-game entries know Steam ids only.** An Xbox copy of a game listed there by its Steam id is
|
||||
checked like any other game — its files, its executables, the anti-cheat drivers and services on your PC — but not
|
||||
by that entry. ([Safety](docs/19_SAFETY_AND_ANTICHEAT.md), [open question](docs/20_OPEN_QUESTIONS.md))
|
||||
- **Play starts them through Windows, in either Play mode** — as their Start-menu tile does — because Windows starts
|
||||
such a game only through its package: *Start directly* cannot start one, so it is recorded once it appears, a few
|
||||
seconds after its start, and the first frames before then are not measured. ([Play](docs/08_UI.md),
|
||||
[capture](docs/04_CAPTURE.md))
|
||||
- **An older Store app (UWP), and a game Windows runs under code protection the hook cannot live under** — only
|
||||
Microsoft-signed code, no generated code, strict stack or control-flow protection — **is never hooked**: its session
|
||||
keeps its duration, your PC's sensors and the reason. Measuring a game from the Xbox app with the Vulkan graphics API
|
||||
has not been tried. ([Safety](docs/19_SAFETY_AND_ANTICHEAT.md), [open question](docs/20_OPEN_QUESTIONS.md))
|
||||
|
||||
## Game artwork
|
||||
|
||||
- **Only the Steam and GOG GALAXY apps keep pictures FrameLedger can show** (since 0.1.0-beta.23). A game's page shows
|
||||
the cover and banner those apps keep on your PC for a game they installed, read where they keep them — nothing is
|
||||
downloaded or copied. A game from itch, the Epic Games Launcher or another store, or one whose `.exe` is outside a
|
||||
store's own folder, shows a picture only once you choose one (**Edit… ▸ Choose image…**). A GOG picture needs Windows'
|
||||
WebP support, which Windows 11 and most Windows 10 installs have. ([Game page](docs/08_UI.md))
|
||||
- **Only the Steam and GOG GALAXY apps keep pictures FrameLedger can show** (since 0.1.0-beta.23) — **and, since
|
||||
0.1.0-beta.33, an Xbox game ships its own**: its square logo and its splash image, shown from its own folder. A game's
|
||||
page shows the cover and banner those apps keep on your PC for a game they installed, read where they keep them —
|
||||
nothing is downloaded or copied. A game from itch, the Epic Games Launcher or another store, or one whose `.exe` is
|
||||
outside a store's own folder, shows a picture only once you choose one (**Edit… ▸ Choose image…**). A GOG picture needs
|
||||
Windows' WebP support, which Windows 11 and most Windows 10 installs have. ([Game page](docs/08_UI.md))
|
||||
- The pictures belong to the games' owners; FrameLedger ships none ([names and trademarks](legal/TRADEMARKS.md)).
|
||||
|
||||
## Your data
|
||||
|
||||
@@ -12,7 +12,7 @@ pages.
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-19.** The software is a beta; its latest
|
||||
> **beta is `0.1.0-beta.32`** (2026-10-31), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.33`** (2026-11-03), an unsigned installer built from that tag with its
|
||||
> checksums published beside it (alphas — experimental builds on a prerelease .NET — are published apart). The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
@@ -133,7 +133,7 @@ Most tools tell you your frame rate. FrameLedger tells you **what produced that
|
||||
- **Shader-compilation stutter attribution** — which frame spikes were pipeline compiles.
|
||||
- **PC latency** when the game uses Reflex.
|
||||
|
||||
Plus the usual: Avg / Min / Max / Median FPS, 1% Low, 0.1% Low, frametime distributions, stutter metrics, CPU/GPU temperatures, session history, cross-session comparison, and Steam/GOG/Epic/itch.io library import. UI in **English / Tiếng Việt / 日本語**.
|
||||
Plus the usual: Avg / Min / Max / Median FPS, 1% Low, 0.1% Low, frametime distributions, stutter metrics, CPU/GPU temperatures, session history, cross-session comparison, and Steam/GOG/Epic/itch.io/Xbox library import. UI in **English / Tiếng Việt / 日本語**.
|
||||
|
||||
## How it works — and the trade-off, stated plainly
|
||||
|
||||
@@ -174,7 +174,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
|
||||
|
||||
## Install
|
||||
|
||||
> **The latest beta is `v0.1.0-beta.32` (2026-10-31); before it `v0.1.0-beta.31` (2026-10-26), `v0.1.0-beta.30` (2026-10-26), `v0.1.0-beta.29` (2026-10-25), `v0.1.0-beta.28` (2026-10-20), `v0.1.0-beta.27` (2026-10-20), `v0.1.0-beta.26` (2026-10-19), `v0.1.0-beta.25` (2026-10-19), `v0.1.0-beta.24` (2026-10-19), `v0.1.0-beta.23` (2026-10-14), `v0.1.0-beta.22` (2026-10-13), `v0.1.0-beta.21` (2026-10-13), `v0.1.0-beta.20` (2026-10-12), `v0.1.0-beta.19` (2026-10-12), `v0.1.0-beta.18` (2026-10-07), `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read the notes of the one you install — `CHANGELOG.md` links each release's own file under `docs/changelog/` — for what it measures, what it does not yet, and how to update, before installing. A source build is `docs/12_BUILD.md`.
|
||||
> **The latest beta is `v0.1.0-beta.33` (2026-11-03); before it `v0.1.0-beta.32` (2026-10-31), `v0.1.0-beta.31` (2026-10-26), `v0.1.0-beta.30` (2026-10-26), `v0.1.0-beta.29` (2026-10-25), `v0.1.0-beta.28` (2026-10-20), `v0.1.0-beta.27` (2026-10-20), `v0.1.0-beta.26` (2026-10-19), `v0.1.0-beta.25` (2026-10-19), `v0.1.0-beta.24` (2026-10-19), `v0.1.0-beta.23` (2026-10-14), `v0.1.0-beta.22` (2026-10-13), `v0.1.0-beta.21` (2026-10-13), `v0.1.0-beta.20` (2026-10-12), `v0.1.0-beta.19` (2026-10-12), `v0.1.0-beta.18` (2026-10-07), `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read the notes of the one you install — `CHANGELOG.md` links each release's own file under `docs/changelog/` — for what it measures, what it does not yet, and how to update, before installing. A source build is `docs/12_BUILD.md`.
|
||||
|
||||
1. Download the latest `FrameLedger.App-win-Setup.exe` from [Releases](https://github.com/poli0981/frameledger/releases). It installs into `%LOCALAPPDATA%\FrameLedger.App`; your data stays in `%LOCALAPPDATA%\FrameLedger`, and uninstalling asks before touching it.
|
||||
2. SmartScreen may warn — releases are not code-signed (free, open-source project). Verify the SHA-256 checksum published with each release, then **More info → Run anyway**.
|
||||
|
||||
+4
-4
@@ -6,13 +6,13 @@ Requirement IDs (`FR-x`, `NFR-x`) are referenced by other docs, commits, and tes
|
||||
|
||||
### FR-1 Game library
|
||||
- FR-1.1 Add game by picking an `.exe`, or drag-dropping an exe/shortcut.
|
||||
- FR-1.2 Auto-import from Steam, GOG Galaxy, Epic, itch.io with a review checklist. **Import never enables hooking for anything.**
|
||||
- FR-1.3 Editable metadata (name, cover, publisher, version, notes); auto-detected fields badged and overridable. *(The cover is built since beta.23, D60: the user's own image, else the Steam or GOG GALAXY app's artwork on this PC — `08_UI` §Games.)*
|
||||
- FR-1.2 Auto-import from Steam, GOG Galaxy, Epic, itch.io with a review checklist — and, since beta.33 (D79), the Xbox app and the Microsoft Store (GDK titles: each drive's `.GamingRoot` folders and each game's package files, `05_DETECTION` §Platform signatures & metadata). **Import never enables hooking for anything.**
|
||||
- FR-1.3 Editable metadata (name, cover, publisher, version, notes); auto-detected fields badged and overridable. *(The cover is built since beta.23, D60: the user's own image, else the Steam or GOG GALAXY app's artwork on this PC — `08_UI` §Games; since beta.33 also the square logo and splash image an Xbox game ships in its own package folder.)*
|
||||
- FR-1.4 Remove game (asks whether to keep or delete its sessions).
|
||||
- FR-1.5 "Supports" row shows shipped-capability hints (DLSS/FSR/XeSS/FG) — visually distinct from measured per-session values (`05_DETECTION` §Capability hints).
|
||||
- FR-1.7 Delete all sessions (beta.11, owner decision D40): of one game from its page, or of every game from Settings ▸ Data, after a confirmation that says how many — with their frame and sensor series and notes; the library, the settings and every consent stay. The Agent deletes them (the rows are its, `06_DATA_MODEL` §Writer ownership) and refuses while a session it would delete under is being recorded.
|
||||
- FR-1.8 Uninstalled games leave the library by themselves (beta.19, owner decision D55, amending D41): an entry whose executable has been gone for ten minutes — its drive connected and the folder it was installed in still there, so an unplugged or re-lettered drive never counts, and neither does a folder Windows will not list (`ExecutablePresenceProbeTests`) — and that has no session (stored, being recorded or waiting to be recovered) is removed by the Agent, behind Settings ▸ Data ▸ *Remove uninstalled games* (on by default). Never an entry carrying an anti-cheat block, an exception or a failed-trial mark (FR-2.2, rule 2). The App is told (`GameRemoved`).
|
||||
- FR-1.9 Play (beta.21, owner decision D59): a game's page and each library entry start the game — through the app of the store whose own records name its folder (Steam, the Epic Games Launcher, GOG GALAXY, itch), or by the agent's launch mode (FR-3.2), as Settings ▸ Games says; never as administrator, and never in a viewer (`08_UI` §Games).
|
||||
- FR-1.9 Play (beta.21, owner decision D59): a game's page and each library entry start the game — through the app of the store whose own records name its folder (Steam, the Epic Games Launcher, GOG GALAXY, itch), or by the agent's launch mode (FR-3.2), as Settings ▸ Games says; never as administrator, and never in a viewer (`08_UI` §Games). *(beta.33, D80: a game the Xbox app or the Microsoft Store installed starts through Windows in either mode — its package activated as its Start-menu tile does — and never by the agent's launch mode, which cannot start it in its package.)*
|
||||
- FR-1.6 Recording switch per entry (2026-09-23, HANDOFF D29): off, the program is not watched at all — no session, no measurement, no injection — and a session of it that is running stops. On by default; entries an old import made for Steam's own tools start with it off. The library card says "Not recorded".
|
||||
|
||||
### FR-2 Hooking consent & control (new, safety-critical — see `19_SAFETY`)
|
||||
@@ -121,4 +121,4 @@ Draw live FPS/frametime/upscaler info inside the game. Only for games already ho
|
||||
|
||||
**Permanently:** any evasion technique (`19_SAFETY`); reading/writing game memory; kernel drivers; hardware control (overclocking, fan curves, power limits — `18_GPU_VENDOR_APIS` is read-only); online/competitive titles.
|
||||
|
||||
**v1:** Microsoft Store/UWP/Game Pass titles (packaged-app injection constraints); macOS/Linux; cloud sync; benchmark automation; ARM64. **Tier-1 capture of 32-bit games, including most Direct3D 9 titles** — the Overlay is x64-only and an x64 DLL cannot be loaded into a 32-bit process; those titles are Tier 2, which since 2026-08-28 means **not measured at all** — duration, sensors and the reason (`17_HOOK_ENGINE` §Build profile, `20_OPEN_QUESTIONS` §Scope).
|
||||
**v1:** ~~Microsoft Store/UWP/Game Pass titles (packaged-app injection constraints)~~ *(narrowed 2026-11-03, beta.33, owner decisions D78–D80: Microsoft Store, Xbox app and PC Game Pass titles built on the GDK — full-trust packages — are in scope; what "the constraints" are was measured in `spike-notes` §25. UWP apps, which run in an app container, stay out: refused with a reason of their own)*; macOS/Linux; cloud sync; benchmark automation; ARM64. **Tier-1 capture of 32-bit games, including most Direct3D 9 titles** — the Overlay is x64-only and an x64 DLL cannot be loaded into a 32-bit process; those titles are Tier 2, which since 2026-08-28 means **not measured at all** — duration, sensors and the reason (`17_HOOK_ENGINE` §Build profile, `20_OPEN_QUESTIONS` §Scope).
|
||||
@@ -132,6 +132,7 @@ which makes the notification more important than it was, not less.
|
||||
## Process watcher
|
||||
|
||||
- 1 Hz snapshot via `CreateToolhelp32Snapshot` (CsWin32): pid, ppid, exe path (`QueryFullProcessImageName`).
|
||||
- **One spelling of the exe path for the whole capture path (beta.33).** The watcher keys a game on the kernel's image name (`QueryFullProcessImageName`), and `TargetResolver`, which re-finds the game just before the guard, read the loader's (`Process.MainModule`) until beta.33: for a game started through a junction — a package Windows activates from `C:\Program Files\WindowsApps\<package>`, a junction to the game's own folder — the two could differ, and the session would end `TargetNotRunning` about a game the watcher had just matched. Both read `Infrastructure.Io.ProcessImagePath` now; the resolver still opens a candidate with the guard's own rights (`PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_VM_READ`), so a process an anti-cheat driver closes stays `TargetUnreadable` (D21). `spike-notes` §25 measured the two spellings equal on the owner's eleven Xbox titles; one reader keeps them equal by construction (`TargetResolverTests`).
|
||||
- Watchlist match on normalized full path (~~`GetFinalPathNameByHandle`~~ `File.ResolveLinkTarget` *(corrected 2026-10-04 — `ExecutableIdentity` says why)* — junctions/symlinks), ~~filename fallback with a stale-path warning badge~~ **and a file name alone never starts a session (2026-09-23, HANDOFF D25): it can only be the entry's own executable on a drive that changed its letter (the relocator's rule), or it is not in the library.**
|
||||
- Process tree assembled from ppid chains; the **capture target** is the descendant that actually presents. In launch mode we know it; in attach mode we wait for the first ring handshake. ~~or (Tier 2) elect the PID with the most presents in the first 10 s~~ — there is no Tier-2 present stream to elect from. Re-elect if the presenting PID dies while the tree lives (level-transition relaunches).
|
||||
|
||||
@@ -242,6 +243,8 @@ which makes the notification more important than it was, not less.
|
||||
|
||||
**Attach mode.** Game launched from Steam/GOG/Epic normally; watcher sees it, guard runs, inject. Feature hooks install late, so early-init facts may be missed; the Overlay compensates by re-reading state on the first `EvaluateFeature` call it does observe, and the session is flagged `late_attach = true` so the UI can note that startup-time settings may be incomplete.
|
||||
|
||||
> **A game the Xbox app or the Microsoft Store installed is always attach mode (beta.33, D80).** Windows starts it through its package — **Play** runs `explorer.exe shell:AppsFolder\<AUMID>` in either mode — and started by its path it is never the game in its package (`spike-notes` §25: `CreateProcess` of the launch executable makes Windows activate the package itself, so the game is not the launcher's descendant; of an Unreal shipping executable, the game runs outside its package). So `LaunchGame` for an executable whose install root is a GDK package root answers `PackagedGame` and starts nothing (`OrchestratorOptions.IsPackaged` = `GdkPackageFiles.IsInPackage`), the watcher records the game when it appears, and the session is `late_attach`: §25 measured an Unreal title's D3D device 2.4–3.7 s after its process, a Unity title's 0.1–1.2 s, so what ran before the hook is in `dxgiPresentsBeforeHook`. The Vulkan layer's switch (`FRAMELEDGER_ENABLE_VK_LAYER=1`) is set only by `ProcessLauncher`, so a Vulkan GDK title cannot get it (`20_OPEN_QUESTIONS` §G).
|
||||
|
||||
~~Steam users can also set FrameLedger as a launch option wrapper; documented in the UI rather than automated (never modify a user's Steam config for them).~~ *(Corrected 2026-10-04: not built — there is no wrapper entry point and no UI text; a game started from Steam is recorded in attach mode. The parenthesis still holds: never modify a user's Steam config for them.)*
|
||||
|
||||
## The guard
|
||||
|
||||
+23
-3
@@ -70,7 +70,7 @@ Rules are **data, not code**: `rules/detection-rules.json`, bundled ~~and updata
|
||||
|
||||
The `anticheat` block is the same file that feeds the hard guard in `19_SAFETY` — shipping it as updatable data is what lets a newly-protected game be blocked without waiting for an app release. ~~**Rules updates that touch the `anticheat` block are treated as security updates:** applied on next check regardless of the user's auto-update preference for other rules.~~ *(Corrected 2026-10-04: there is no feed and no auto-update preference, so today a newly-protected game waits for a release; the sentence is what a feed must do once built, §S20.)*
|
||||
|
||||
Signal types evaluated by `RuleEvaluator` (Domain): `file_exists`, `dir_exists`, `sibling_glob`, **`path_contains`**, `pe_company_contains`, `pe_product_contains`, `strings_contains` (bounded 8 MB scan), `manifest_field`. Combine with `all` / `any` — **not nested**, which schemaVersion 2 forbids. Version extractors: `pe_file_version` (of the sibling its `from` names, not of the executable), `pe_product_version_regex`, **`strings_regex`**, `manifest_field`, and since 2026-09-27 **`unreal_build`** (no parameter; decided in code, §Engine version). A regex extractor must capture exactly **one** group — the evaluator returns the first — and `rules-validate.ps1` refuses any other count and any pattern that does not compile (both promised by the rules file's `$comment` and enforced by nothing until beta.10).
|
||||
Signal types evaluated by `RuleEvaluator` (Domain): `file_exists`, `dir_exists`, `sibling_glob`, **`path_contains`**, `pe_company_contains`, `pe_product_contains`, `strings_contains` (bounded 8 MB scan), `manifest_field`, and since beta.33 **`root_file`** — an exact file name directly in the install root, answered from that one folder's own listing (`GameFileSnapshot.RootFiles`), so a deep walk that ran short makes its miss no less certain; a root that could not be listed makes it `Unknown`. Combine with `all` / `any` — **not nested**, which schemaVersion 2 forbids. Version extractors: `pe_file_version` (of the sibling its `from` names, not of the executable), `pe_product_version_regex`, **`strings_regex`**, `manifest_field`, and since 2026-09-27 **`unreal_build`** (no parameter; decided in code, §Engine version). A regex extractor must capture exactly **one** group — the evaluator returns the first — and `rules-validate.ps1` refuses any other count and any pattern that does not compile (both promised by the rules file's `$comment` and enforced by nothing until beta.10).
|
||||
|
||||
> `path_contains` and `strings_regex` were in the shipped data and the schema
|
||||
> and missing from this list; the schema's own `$comment` said so and nobody had
|
||||
@@ -312,6 +312,7 @@ engine compiled only, reads as not found. One Ren'Py install was measured.
|
||||
|
||||
| Platform | Signals | Metadata |
|
||||
|---|---|---|
|
||||
| Xbox *(beta.33, D79; first in the array)* | **both** `MicrosoftGame.config` and `appxmanifest.xml` directly in the install root (`root_file`, `all`): a GDK package root. First because a GDK build can ship Steam's DLL — every FINAL FANTASY Pixel Remaster from the Xbox app carries `Plugins\x86_64\steam_api64.dll` (`spike-notes` §25) — and a `root_file` miss is never `Unknown` for want of a deep walk, so a large Steam install behind it still reads *steam* | each drive's `.GamingRoot` → `<games folder>\<Game>\Content\`: `MicrosoftGame.config` (Identity, ShellVisuals, ExecutableList, StoreId) and `appxmanifest.xml` (the Application id); the package family name and its registration from Windows (`PackageFamilyNameFromId`, `GetPackagesByPackageFamily`) |
|
||||
| Steam | `steam_api64.dll`/`steam_api.dll` sibling, or path contains `steamapps\common` | nearest `steamapps/appmanifest_<id>.acf` (walk up): `appid`, `name`, `buildid` → version |
|
||||
| GOG | `goggame-<id>.info` sibling, or `Galaxy64.dll` | `.info` JSON: `gameId`, `name`, `version` |
|
||||
| Epic | `EOSSDK-Win64-Shipping.dll`~~, or path under an Epic install~~ *(corrected 2026-10-04: the rule has no path signal)* | `%ProgramData%\Epic\EpicGamesLauncher\Data\Manifests\*.item` matched by `InstallLocation` |
|
||||
@@ -324,9 +325,12 @@ engine compiled only, reads as not found. One Ren'Py install was measured.
|
||||
> (`StoreRecords.Owning`, as Play finds it). `Infrastructure.Art.SteamArtCache` and `GogArtCache` read them; nothing is
|
||||
> downloaded, so the *(opt-in)* online lookup in the publisher/version order below still does not exist. Epic, itch and
|
||||
> other stores keep no image files: their games show the image the user chooses, or none. The detail: `08_UI` §Games ›
|
||||
> Game detail, *The header's cover*.
|
||||
> Game detail, *The header's cover*. *(beta.33: an Xbox game ships its own — `Infrastructure.Art.XboxArtCache` reads the
|
||||
> `Square480x480Logo` (else `Square150x150Logo`) and the `SplashScreenImage` its `MicrosoftGame.config` names, inside
|
||||
> the package root only, as a square cover and the banner; `IStoreArtCache.Find` takes the owning record rather than the
|
||||
> id, because those pictures live in the install folder.)*
|
||||
|
||||
**Auto-import (FR-1.2):** Steam via `libraryfolders.vdf` → all `appmanifest_*.acf` except `SteamLibrarySource.KnownTools` (2026-09-22: Steamworks Common Redistributables, Borderless Gaming, Wallpaper Engine, SteamVR, the Proton and Steam Linux Runtime entries, Blender — tools Steam's manifests do not distinguish from games, and which became library rows the watcher recorded); GOG via `HKLM\SOFTWARE\WOW6432Node\GOG.com\Games\*`; Epic via `Manifests\*.item`; itch by receipt scan. Import presents a review checklist; nothing is launched, nothing is hooked on import.
|
||||
**Auto-import (FR-1.2):** Steam via `libraryfolders.vdf` → all `appmanifest_*.acf` except `SteamLibrarySource.KnownTools` (2026-09-22: Steamworks Common Redistributables, Borderless Gaming, Wallpaper Engine, SteamVR, the Proton and Steam Linux Runtime entries, Blender — tools Steam's manifests do not distinguish from games, and which became library rows the watcher recorded); GOG via `HKLM\SOFTWARE\WOW6432Node\GOG.com\Games\*`; Epic via `Manifests\*.item`; itch by receipt scan; *(beta.33)* Xbox by each drive's `.GamingRoot` and each game's package files. Import presents a review checklist; nothing is launched, nothing is hooked on import.
|
||||
|
||||
> **Built 2026-09-14 (P4 PR-4).** `Application.Import.LibraryImporter` over four `IStoreLibrarySource` adapters in
|
||||
> `Infrastructure.Import` — `SteamLibrarySource` (`libraryfolders.vdf` + `appmanifest_*.acf` through
|
||||
@@ -363,6 +367,22 @@ engine compiled only, reads as not found. One Ren'Py install was measured.
|
||||
> is fetched (CLAUDE.md rule 8's "opt-in store metadata" is the online lookup, which does not exist). First-run
|
||||
> step 4 now points at File ▸ Import library… rather than saying "later build".
|
||||
|
||||
> **beta.33 (owner decisions D78/D79, `spike-notes` §25): the Xbox app's and the Microsoft Store's games.**
|
||||
> `XboxLibrarySource` reads each ready fixed or removable drive's `.GamingRoot` (`GamingRoots`: `RGBX`, a count, UTF-16
|
||||
> folder names relative to the drive), lists the `<games folder>\<Game>\Content\` folders that are GDK package roots
|
||||
> (`GdkPackageFiles`: `MicrosoftGame.config` beside `appxmanifest.xml`, read with DTDs prohibited and a 1 MB cap), and
|
||||
> keeps those whose package Windows says is installed for this user (`PackageFamilyNameFromId`, then
|
||||
> `GetPackagesByPackageFamily`). The record: the store id is the package family name, the install directory is `Content`
|
||||
> (the spelling the game's own process reports — never the `C:\Program Files\WindowsApps` junction, whose name carries
|
||||
> the version), the launch key is the AUMID `<family name>!<Application Id>` that Play activates, the version is the
|
||||
> package's. It names no executable, so `ExecutableLocator` ranks: the WinGDK or Win64 shipping binary over the stub the
|
||||
> package launches, the Unity player over its crash handler, never `gamelaunchhelper.exe` (a runtime helper since
|
||||
> beta.33), with the folder above `Content` as the install's name. **What cannot be read:** every game `.exe` under
|
||||
> `Content` refuses `FILE_READ_DATA` to a process outside its package, so its PE header, version resource, imports and
|
||||
> strings are not read — the architecture reads `unknown` (never "not x64", so nothing is turned off for it), no Unreal
|
||||
> version is shown, and the Unity version still reads, from `UnityPlayer.dll`. A UWP app has no `MicrosoftGame.config`
|
||||
> and is not listed (D78).
|
||||
|
||||
> **beta.19 (owner report 2026-10-12): a store's own pick can be a helper, and a launcher is not the game.** The owner's
|
||||
> A Doll's Locket - Remake (itch 5085165, RPG Maker MZ) was imported as `Dolls Locket\notification_helper.exe` — NW.js's
|
||||
> toast helper. The pick was **butler's verdict**, taken as is: butler stores a *filtered* verdict (the shallowest
|
||||
|
||||
@@ -43,7 +43,7 @@ CREATE TABLE games (
|
||||
exe_path TEXT NOT NULL UNIQUE, -- where the executable lives; rewritten by ExecutableRelocator when the
|
||||
-- SAME bytes (exe_size_bytes, exe_mtime_ms) turn up under another drive
|
||||
-- letter (2026-09-22), and by Change executable for a DIFFERENT binary
|
||||
platform TEXT NOT NULL DEFAULT 'none', -- steam|gog|epic|itch|none
|
||||
platform TEXT NOT NULL DEFAULT 'none', -- steam|gog|epic|itch|xbox|none (xbox since beta.33, D79; no CHECK constraint, so no migration)
|
||||
store_id TEXT,
|
||||
engine TEXT, engine_version TEXT,
|
||||
-- (schema 0015, ALTERed last) engine_version_source TEXT: where engine_version came from — a
|
||||
|
||||
+1
-1
@@ -393,7 +393,7 @@ Unchanged in spirit from v1, bumped to `v2` for the new message set.
|
||||
| `Hello` | UI→A | `{ appVersion, protocol: 2 }` → `HelloAck { agentVersion, protocol, pid, elevated, overlayBuildId, vulkanLayerRegistered, telemetrySource /* composite, e.g. l1+lhm+nvapi */, cpuTempAvailable, disclosureVersion /* P3 PR-4, D14: the FR-2.1 text this Agent stamps against */, exceptionDisclosureVersion /* D33, 2026-09-26: the user-mode exception's disclosure this Agent grants against */, elevationOutcome /* beta.10, D34: the admin mode's answer at this start — granted, declined, other-account, failed — or null when nobody asked */, ~~etwAvailable~~ }` — `etwAvailable` struck 2026-09-13 with the tier it described (2026-08-28); `pid` added. ~~`vulkanLayerRegistered` is **false by construction** today (the layer is per-launch, never registered)~~ `vulkanLayerRegistered` is the HKCU implicit-layer registration as the Agent found it at start *(corrected 2026-10-04: since P3 PR-8b; true while `VkLayerReconciler` keeps the layer registered for a hook-enabled Vulkan game, P4 PR-2)* and `cpuTempAvailable` false unelevated; `telemetrySource` is the composite stood up once on the first `Hello` |
|
||||
| `GetStatus` | UI→A | → `StatusAck { state, activeSession?, tier? }` — and `activeSessions[]`, one `{ sessionGuid, gameId, gameName?, pid, tier, startedAt, hold? }` per running session. **`hold` added 2026-09-23, optional:** present on a session held unhooked (Tier 2), with the same words `SessionStarted.hold` carries; a session listed at tier 2 WITHOUT a `hold` has not attached yet — it is starting, not held. The App reads this list on every (re)connect (§Client behavior) |
|
||||
| `SetWatchlist` | UI→A | `{ entries: [{ gameId?, exePath }] }` — ~~full replace~~ **ensure, never remove** (built 2026-09-13, PR-1b): each entry's path is normalised by the Agent, its row ensured with hooking OFF when new, and the ack is `WatchlistAck { games: [{ gameId, exePath, name }], unreadable: [exePath] }`; `gameId` in a request is a hint and never trusted over the path. UI re-sends on connect. **Carries no hooking state** (see §The pipe is not a trust boundary). *Since the App writes `games` rows itself under `06_DATA_MODEL` §Writer ownership (HANDOFF §P3 D15), this is the pipe's way of adding a row, not the only one; the watcher reads the table at 1 Hz either way.* |
|
||||
| `LaunchGame` | UI→A *(the App sends it since beta.21: Play in its Start directly mode, and in the store mode where no store installed the game — `App.Services.GamePlayer`, D59)* | `{ gameId, arguments? }` → ~~suspended-launch~~ launch mode as built ("inject late", `04_CAPTURE` §Launch mode) → `LaunchAck { gameId, accepted, outcome, sessionGuid? }` — `outcome` is `Accepted` · `UnknownGame` · `SessionRunning` (one per game at a time) · `Unavailable` · `RecordingOff` (2026-09-23: the entry's recording switch is off, FR-1.6 — FrameLedger does not start what it will not record). *(Built 2026-09-13, PR-1b: `CaptureOrchestrator.LaunchAsync` over an `ILaunchRecorderFactory` the Agent composes with the Vulkan layer's environment — or none when FR-2.4's switch is on — and the launcher election runs after, as the console's `launch` does; the elected session is not addressable by the launch's guid.)* |
|
||||
| `LaunchGame` | UI→A *(the App sends it since beta.21: Play in its Start directly mode, and in the store mode where no store installed the game — `App.Services.GamePlayer`, D59)* | `{ gameId, arguments? }` → ~~suspended-launch~~ launch mode as built ("inject late", `04_CAPTURE` §Launch mode) → `LaunchAck { gameId, accepted, outcome, sessionGuid? }` — `outcome` is `Accepted` · `UnknownGame` · `SessionRunning` (one per game at a time) · `Unavailable` · `RecordingOff` (2026-09-23: the entry's recording switch is off, FR-1.6 — FrameLedger does not start what it will not record) · `PackagedGame` (beta.33, D80: the executable's install root is a GDK package root — a game the Xbox app or the Microsoft Store installed, which Windows starts through its package and never by its path, `spike-notes` §25; nothing is started, and the App says to start it from the Xbox app or the Start menu. The App hands such a game to Windows itself and sends this only when it found no package record for it. Additive: an older App says the unknown outcome as a failure). *(Built 2026-09-13, PR-1b: `CaptureOrchestrator.LaunchAsync` over an `ILaunchRecorderFactory` the Agent composes with the Vulkan layer's environment — or none when FR-2.4's switch is on — and the launcher election runs after, as the console's `launch` does; the elected session is not addressable by the launch's guid.)* |
|
||||
| `SetHookEnabled` | UI→A | `{ gameId, enabled, disclosureVersion? }` — Agent re-runs the static AC pre-scan and may reply `Refused`. **The Agent stamps the consent timestamp itself.** *(Built 2026-09-13, PR-1b, as far as it can be: `enabled: false` → `RevokeAsync` → `HookEnabledAck { gameId, enabled: false, outcome }`; `enabled: true` → the pre-scan of the executable's directory, a refusal or a "could not verify" recorded through `RecordGuardBlockAsync` and answered `Refused { gameId, reason, family?, signal? }`; a clean scan → ~~**`Error DisclosureUnavailable`, nothing stamped** — the reviewed FR-2.1 text does not exist, and a client's `disclosureVersion` is a claim, not a disclosure shown. PR-4 replaces that last branch with the stamp~~ **since PR-4 (2026-09-13): the client's `disclosureVersion` compared with the Agent's own `SafetyDisclosure.Version`; equal → the stamp from the Agent's clock with `ConsentProvenance.ConsentDialog`, answered `HookEnabledAck { enabled, outcome, prescan: "clean" }`; anything else → `Error DisclosureVersionMismatch`, nothing written (D14). `DisclosureUnavailable` remains for a composition that wired no version, which `--serve` never is.)* **Since beta.8 (2026-09-25):** the pre-scan is of the executable (the guard resolves the install root, PR-2 of that train), and BEFORE it an executable known not to run as x64 is answered `Refused { gameId, reason: "ExecutableNotX64", signal: "x86" | "anycpu32" | "arm64" | "arm" }` with nothing scanned and nothing written — not a guard reason and not a block (`05_DETECTION` §What the files say about themselves). **Since D33 (2026-09-26):** for a blocked game whose user-mode exception is in force for the executable on disk (the option on, a grant made on these bytes, the block naming that family) the pre-scan NAMES the family, and a pass under it is stamped as ever and answered `prescan: "exception"`; a finding about the game under it also ends the exception. |
|
||||
| `SetAntiCheatException` | UI→A | **Added 2026-09-26 (D33).** `{ gameId, enabled, disclosureVersion? }` — grant or withdraw a game's user-mode anti-cheat exception (`19_SAFETY` §The user-mode exception). `enabled: false` → the exception ends (`Withdrawn`), hooking goes off while the block stands → `AntiCheatExceptionAck { gameId, granted: false, outcome, family? }`. `enabled: true` → `Error DisclosureVersionMismatch` unless `disclosureVersion` is the Agent's `AntiCheatExceptionDisclosure.Version`; `Error ExceptionsOff` while `hooking.usermode_ac_exceptions` is off; `Refused { reason: "BlockNotExceptionable" }` for a title list or an unreadable block; then the Agent's OWN facts — ~~the successful Tier-1 sessions (`Refused { reason: "TooFewSessions", signal: <count> }` under two)~~ *(D38, 2026-10-03: no session is needed)*; a game an exception of which ended during its trial is refused before anything is scanned (`Refused { reason: "TrialFailed", family, signal: <unix ms> }`); a tolerant pre-scan of the executable on disk naming the block's family (`Refused { reason, family, signal }` unless the guard let exactly that family through) — and the store writes the grant only over facts that make the game eligible, and never over a failed trial → `AntiCheatExceptionAck { granted, outcome, family }`. **A grant turns nothing on**: hooking is FR-2.1's `SetHookEnabled`, afterwards. Not answered (`UnknownType`) by an Agent composed without the exception. |
|
||||
| `PauseCapture` / `ResumeCapture` | UI→A | global → `PauseAck { paused }`; `StatusAck.paused` reports it. *(Built 2026-09-13, PR-1b: one in-memory flag, `CapturePause`, read by every session loop at its tick and told to the ring once per transition; supervision — the guard scan, the kill switch, the safety stop — never pauses. Not persisted: an Agent that restarts resumes.)* |
|
||||
|
||||
+12
-2
@@ -38,7 +38,7 @@ WPF + **WPF UI (Wpf.Ui, Fluent)**. Shell = `ui:FluentWindow` with custom `ui:Tit
|
||||
**NavigationView items:** Dashboard · Games · Compare · Logs — `Settings` lives in `FooterMenuItems`. Icons from `SymbolIcon` (Fluent System Icons; pick from the `SymbolRegular` enum — see 16 §Icons).
|
||||
|
||||
**Menu bar**
|
||||
- **File:** Add game… · Import library (Steam / GOG / Epic / itch.io) · Export ▸ (Session CSV / Session JSON / Chart PNG) · Exit
|
||||
- **File:** Add game… · Import library (Steam / GOG / Epic / itch.io / Xbox *— since beta.33*) · Export ▸ (Session CSV / Session JSON / Chart PNG) · Exit
|
||||
- **Tools:** Agent status… · Update detection rules · Vulkan layer registration… · Open data folder · Database maintenance…
|
||||
- **Help:** User guide (beta.12) · Check for updates · Report a bug… · ~~Documentation~~ Online documentation · Limitations · About FrameLedger (~~App / Developer / Third-party licenses tabs~~ — built beta.12 as *This app* / *Third-party licences* / *Legal documents*, below)
|
||||
|
||||
@@ -356,6 +356,13 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
> surfaces' game page has artwork), `…TheArtworkBandFollowsAThemeSwitch` and `…TheGamePagesArtworkIsDrawn` with
|
||||
> `AccessibilityTests.NoStyleOfAWpfUiControlLeavesOutItsTemplate` (the cover once took its place and drew nothing, a
|
||||
> `ui:Image` style not based on WPF UI's; caught in a render before it shipped). The library's cards still have no image.
|
||||
>
|
||||
> **beta.33 (D79): an Xbox game's own pictures.** A game the Xbox app or the Microsoft Store installed ships its pictures
|
||||
> in its package folder, and `MicrosoftGame.config` names them: the `Square480x480Logo` (else `Square150x150Logo`) is the
|
||||
> cover, drawn **square** (150×150, `ArtCoverIsSquare`) so a logo is never cropped to a portrait, and the
|
||||
> `SplashScreenImage` (1920×1080 on the owner's titles) is the banner. The square logo comes before a landscape header.
|
||||
> Read from inside the package root only; the tooltip says *Artwork from the game's own files (Xbox app)*
|
||||
> (`Art_Source_Xbox`). `GameArtTests.AnXboxGamesSquareLogoIsItsCoverDrawnSquareAndItsSplashTheBanner`.
|
||||
|
||||
> **Built 2026-09-14 (P3 PR-5): the grid, the detail page's header, the two rows, the hooking control and
|
||||
> the Sessions tab.** Grid: `ui:CardAction` cards with platform / engine / hooking badges, sessions, playtime,
|
||||
@@ -441,7 +448,8 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
> what the game's files and its store say (`05_DETECTION` §What the files say about themselves): *Runs as* (64-bit
|
||||
> (x64) · 32-bit (x86) · ARM64 · .NET, any CPU (runs as 64-bit) · …), *File version* and *Product version* (the
|
||||
> executable's PE resource — for an Unreal title often the engine's), *Store* ("Steam build 20374416", "GOG version
|
||||
> 1.2.3" — or *Version* when the user typed it), *Engine*, and *Ships with*, one line per capability file: "DLSS:
|
||||
> 1.2.3", since beta.33 "Xbox version 1.3.5124.0" — or *Version* when the user typed it), *Engine*, and *Ships with*,
|
||||
> one line per capability file: "DLSS:
|
||||
> nvngx_dlss.dll 3.7.10.0", "XeSS: libxess.dll (no version)". A row the Agent has not read yet says so. The subtitle
|
||||
> labels the store's version the same way and then drops the bare store name it would repeat. **An executable that
|
||||
> cannot run as x64** (x86, 32-bit-preferring .NET, ARM) disables the hooking switch with `Hooking_NotX64_Format` under
|
||||
@@ -606,6 +614,8 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
> in the UI, or a fixed rule that Steam's games always go through Steam) and left the choice open; the note was taken
|
||||
> because the rule would cost too much: three of the five Steam games started directly on 2026-10-20 ran and were
|
||||
> measured from their first frame, and a Vulkan game is measured only when FrameLedger starts it (Everhex Demo).
|
||||
>
|
||||
> **beta.33 (D80): a game the Xbox app or the Microsoft Store installed always starts through Windows.** In either mode, and from an App running as administrator too, **Play** runs `explorer.exe shell:AppsFolder\<AUMID>` — the user's shell activates the game's package, unelevated, as its Start-menu tile does (`StoreLaunches`: the AUMID is the record's `<family name>!<application id>`, checked against the shape Windows gives one). Started by its path a GDK game is never the game in its package (`spike-notes` §25), so no mode sends `LaunchGame` for it, and the agent answers `PackagedGame` to one that reaches it anyway (an entry the App found no package record for). The notices: `Play_Xbox_Format` (started), `Play_Xbox_NotStarted_Format` and `Play_PackagedGame_Format` (start it from the Xbox app or the Start menu), all warnings but the first; the *Through the store* and *Start directly* tooltips and Settings ▸ Games ▸ Play button say it. The session is attach mode, `late_attach` (`04_CAPTURE` §Launch mode vs attach mode). Tests: `StoreLaunchesTests`, `GamePlayerTests`, `CaptureOrchestratorTests`.
|
||||
|
||||
### Session summary (secondary `FluentWindow`, also the post-session toast target)
|
||||
Stat cards (Avg uses `FpsReadout`, Median, 1% Low, 0.1% Low, Min/Max, σ, stutter %, duration, **Display** — beta.10: the mode shown longest with its share and the window's size, both tiers; **VRAM (this game)** and **RAM (this game)** — beta.12: the median with the peak beneath, both tiers), **Statistics per series** (beta.12: every stored series' mean / median / minimum / peak), TriState chips, API/PresentMode/upscaler line, **the display line** (beta.10: every mode's share, the changes, the window on its monitor at its refresh rate, the back buffer and swap effect, and what the facts rested on — "the swap chain said whether it was exclusive" or "from the window alone: exclusive fullscreen cannot be told from borderless"; absent for a session recorded before), crash `InfoBar` (Severity=Error) when `crashed`, frametime chart, sensor strip, tags/notes editor, Export buttons.
|
||||
|
||||
+1
-1
@@ -344,7 +344,7 @@ CI/CD with the native build (`release.yml` exists since P4 PR-5, 2026-09-14 —
|
||||
- ~~PresentMon Service + API2 for a richer Tier 2~~ — **struck 2026-08-27**, and the shape hardened 2026-08-28: v1's ladder has two rungs and Tier 2 is not a measurement. What v2 may want is **a no-injection measurement at all** — which would restore two things at once: the FG oracle §S31 spent four attempts looking for, and `14_TESTING`'s Tier-1 accuracy cross-check, which is struck for the same reason (§G)
|
||||
- **YouTube overlay export**: frametime/FPS graph as transparent PNG sequence for DaVinci Resolve benchmark videos (SkullMute workflow)
|
||||
- CapFrameX-compatible CSV import/export
|
||||
- Microsoft Store / Game Pass titles (packaged-app injection constraints)
|
||||
- ~~Microsoft Store / Game Pass titles (packaged-app injection constraints)~~ *(struck 2026-11-03: GDK titles from the Xbox app and the Microsoft Store are imported, played and measured since beta.33, D77–D82, `spike-notes` §25; UWP apps stay out, refused with a reason of their own)*
|
||||
- AFK segmentation via `GetLastInputInfo`
|
||||
- GPU frame time via timestamp queries (needs care: injecting queries into the game's command lists is more invasive than anything in v1 — needs its own risk review)
|
||||
- ~~Beta update channel;~~ ARM64 *(struck 2026-10-04: the beta channel shipped with P4 PR-5 — `update.channel`, Settings ▸ Updates; `13_CI_CD` §Branch & release policy)*
|
||||
|
||||
@@ -387,6 +387,20 @@ Implemented in `FrameLedger.Injector` and reached from managed code through a th
|
||||
> appeal. A nested executable outside a recognised store layout is therefore
|
||||
> still scanned narrowly; that residual is stated, not closed.
|
||||
>
|
||||
> **Amended 2026-11-03 (beta.33, `spike-notes` §25): a GDK package root is a boundary too, and `GamesInstalled`
|
||||
> is one natively.** The Xbox app and the Microsoft Store install to `<games folder>\<Game>\Content\` under a
|
||||
> folder the user names, which no string can bound — so for the executable the import picks there (an Unreal
|
||||
> title's `Content\<Project>\Binaries\WinGDK\…-Shipping.exe`), check 4 walked `Binaries\WinGDK` alone, and an
|
||||
> `EasyAntiCheat\` at `Content`'s root would have read clean: the residual above, on a whole store. The package
|
||||
> marks its own root — `MicrosoftGame.config` beside `appxmanifest.xml`, both files — so **only when no string
|
||||
> boundary matched**, the nearest folder at or above the executable's that holds both is the root (at most eight
|
||||
> levels up, never a drive's root; `ResolveInstallRoot` and the managed `InstallRoot`). Not a blind walk up: a
|
||||
> marker the package writes, measured as exactly one per package at `Content`'s root on the owner's 11 titles; and
|
||||
> only ever a widening relative to the executable's folder — a Steam build carrying GDK files keeps its Steam root.
|
||||
> The native list also gains `GamesInstalled\<X>`, which the managed one had since #17 and the native one never
|
||||
> did; one case list (`tests/fixtures/install-roots/cases.txt`), read by both suites, holds the two resolvers
|
||||
> together from now on.
|
||||
>
|
||||
> **Amended 2026-10-13: the root AND the executable's folder.** The root replaced the executable's folder, and
|
||||
> that was half the answer. The walk reaches three levels below where it starts, and an Unreal executable is
|
||||
> already three below its root, so a folder **beside** the executable is four: MEASURED on Wuthering Waves, whose
|
||||
@@ -461,6 +475,41 @@ the injection primitive, not a fifth question about the title.
|
||||
|
||||
> **There is no override.** ~~There is one, since 2026-09-21, and it is none of the things this paragraph named~~ *(one day; withdrawn 2026-09-22)*: still no hidden setting, no config-file flag, no CLI switch, no "advanced users" escape hatch, no global form. If a user disagrees with a specific entry, the path is still a GitHub issue against the rules file, reviewed in public. What exists is below — and since 2026-09-26 (D33), one narrow, evidence-bound exception for anti-cheat that is user-mode throughout, which lets a named family through while every check still runs (§The user-mode exception).
|
||||
|
||||
### The target must be able to take the Overlay — beta.33 (D78)
|
||||
|
||||
The last question before the primitive, after checks 1–4 and the payload's identity passed: **can this process take the
|
||||
Overlay at all?** The guard reads it from the target itself (`Sources::TargetIsolationFacts`, one
|
||||
`PROCESS_QUERY_LIMITED_INFORMATION` handle — measured 2026-11-03 to answer both questions, `GetProcessMitigationPolicy`
|
||||
needing no more):
|
||||
|
||||
| Read | Refusal | Why it cannot work |
|
||||
|---|---|---|
|
||||
| `TokenIsAppContainer` | `kTargetAppContainer` | a Microsoft Store app of the UWP kind: the Overlay's shared memory, its `Local\` names and the rules file live in the user's session namespace and profile, which an AppContainer cannot open. D78: GDK games are in, UWP apps are out |
|
||||
| `ProcessSignaturePolicy`: `MicrosoftSignedOnly` or `StoreSignedOnly` | `kTargetMitigation` | the Overlay is neither (CLAUDE.md rule 9: unsigned): the remote `LoadLibraryW` fails |
|
||||
| `ProcessDynamicCodePolicy`: `ProhibitDynamicCode` | `kTargetMitigation` | MinHook's trampolines are dynamic code: the Overlay would load and hook nothing |
|
||||
| `ProcessUserShadowStackPolicy`: strict mode, or `BlockNonCetBinaries` / `BlockNonCetBinariesNonEhcont` | `kTargetMitigation` | the Overlay is not marked CET-compatible: refused at load, or a violation ends the game |
|
||||
| `ProcessControlFlowGuardPolicy`: `StrictMode` | `kTargetMitigation` | `native/CMakeLists.txt` H1: measured safe with strict mode off only; a host in strict mode could still `__fastfail` on the trampolines, which no fault policy can catch (rule 5) |
|
||||
|
||||
**The policy is the signal**, and only the enforcing flags count: an `Audit*` flag refuses nothing, and
|
||||
`SetContextIpValidation` without strict mode is what every CET-compatible process carries (measured: `pwsh.exe`
|
||||
`0x105`). A policy the running Windows does not know answers `ERROR_INVALID_PARAMETER` (measured) and cannot be in
|
||||
effect. **"Could not tell" refuses** — a seam that fails, or none wired — as `kProcessUnreadable`, the module check's word
|
||||
for a process it could not read. ctest `fl_guard` `[isolation]` holds each refusal through fakes, and two of them against
|
||||
Windows itself: a child started under "no dynamic code" and "Microsoft-signed images only".
|
||||
|
||||
**Neither is a finding.** Nothing is written to the game's row and no family is named; the session is Tier 2 with the
|
||||
reason, as for a 32-bit game. **No game that measured before is refused now**: each of these ended as a failed injection,
|
||||
an Overlay that installed no hooks, or a risk of ending the game. It is asked once, before the injection — never by the 30 s
|
||||
re-scan, which runs inside a process the Overlay is already in — and, like the payload check, it is not numbered as a
|
||||
check: it is a precondition of the primitive, not a question about the title.
|
||||
|
||||
**A GDK game's tree, measured (`spike-notes` §25, six titles activated through their packages):** the chain is
|
||||
`GameLaunchHelper.exe` → `gamingservicesui.exe` → `XboxPcTray.exe` → the launch executable (→ an Unreal title's shipping
|
||||
executable), `GameLaunchHelper` exits first, and its parent is the activator — the user's shell when **Play** starts it,
|
||||
which is where the scan set already stops. Every member opened with the guard's rights as a standard user, none is an
|
||||
AppContainer, none runs under any of the policies above, and no member's module matched a fuzzy fragment or a blocklist
|
||||
name. So the scan set needs nothing new for these titles; an Xbox title that ships anti-cheat is unmeasured
|
||||
(`20_OPEN_QUESTIONS` §G).
|
||||
### What a finding does to the game — owner decision 2026-09-22
|
||||
|
||||
**The per-game override of 2026-09-21 is withdrawn.** It shipped in `0.1.0-beta.3` and `beta.4`. Its first real use
|
||||
|
||||
@@ -1917,6 +1917,7 @@ Each of these is referenced by an existing doc but specified nowhere.
|
||||
| **Uninstall / data deletion** | One Velopack clause. No in-app "delete all my data", despite the privacy position | `12_BUILD`, `legal/PRIVACY_POLICY.md` |
|
||||
| ~~**Cover art**~~ | ~~Appears in the schema, the data directory and the UI; nothing says where it comes from or the licence position on downloaded store art~~ **Answered 2026-10-14 (beta.23, owner decisions D60/D61):** from the user's own image (a copy in `covers\`) or what the Steam and GOG GALAXY apps already keep on this PC — nothing is downloaded, so no store art is redistributed or fetched; the art stays its owners' (`legal/TRADEMARKS.md`), the Privacy Policy 2.11 names the files read. `08_UI` §Games › Game detail. **Row closed** | `06_DATA_MODEL`, `05_DETECTION` |
|
||||
| **The main line's .NET** *(added 2026-10-31, D73–D76)* | **When does the main line — the betas and the first release — leave .NET 10 LTS, and for what?** The alpha line (`12_BUILD` §The alpha line) builds the same source on .NET 11 to gather the evidence; it decides nothing by existing. What is known: .NET 11 is STS, supported 24 months to about 2028-11, no later than .NET 10 LTS (2028-11-14), so moving buys no support time; Microsoft's supported-OS list for .NET 11 has Windows 10 only in its LTSC and IoT editions, against NFR-8's Windows 10 22H2 floor; C# 15's unions and closed hierarchies would suit the tri-states and refusal reasons, but only once the main line compiles C# 15. **Decision table, written before the evidence:** move to .NET 11 only if (a) at least two alphas on the GA runtime pass the gate and an owner's run of a hooked title with no runtime-specific defect, (b) the owner accepts dropping NFR-8's floor to Windows 11 or ships knowingly unsupported on Windows 10, and (c) something .NET 11 brings is wanted — a measured gain or a language feature; otherwise stay on .NET 10 and take .NET 12 LTS (expected 2027-11) the same way, through the alpha line first | `12_BUILD`, `13_CI_CD`, `02_SPEC` NFR-8, CLAUDE.md pinned stack |
|
||||
| **Xbox app / Microsoft Store titles** *(added 2026-11-03, beta.33, D77–D82)* | GDK titles are imported, played and measured since beta.33 (`spike-notes` §25: full trust, the user's token, the session's object namespace, the image path the `Content` folder's); what is NOT answered: **(1) title lists know Steam ids only (D81).** `blockedStoreIds` has no `store` value for a Microsoft Store product id or a package family name, and the guard has no reader for one, so an Xbox copy of a game listed there by its Steam id is matched by its executables, modules, files, drivers and services but not by that entry. Keying one would take a schema value (`additionalProperties: false` there is a safety control) and a reader under D31's rule — listed refuses, none is not applicable, unreadable refuses — fed by `MicrosoftGame.config`'s `StoreId`, which the import already reads. The owner chose not to, for now. **(2) A Vulkan GDK title is not measured:** the layer is enabled by `FRAMELEDGER_ENABLE_VK_LAYER=1`, which only a launch FrameLedger makes can set, and a package is started by Windows. **(3) A package that keeps write virtualization on** (all 11 measured turn it off) would put the Overlay's log in its `LocalCache`, out of the bug report's reach; capture itself never reads the log. **(4) Unmeasured:** a start from inside the Xbox app (GameLaunchHelper's parent there — the scan set's next process), any GDK title with anti-cheat, the ring from a packaged process (the owner's first hooked session) | `02_SPEC` §Out of scope, `05_DETECTION`, `19_SAFETY` check 3, `LIMITATIONS.md` |
|
||||
| **Tier-2 mechanism** *(was: PresentMon distribution)* | **By what mechanism does a shipped build reach a no-injection MEASUREMENT?** Nothing names one. Since 2026-08-28 the ladder is two rungs and Tier 2 is explicitly not a measurement — duration, sensors and the reason — so this row is no longer about degraded fidelity but about whether that capability returns at all. **It now owns TWO casualties, not one:** the frame-generation oracle §S31 spent four attempts looking for, and `14_TESTING`'s Tier-1 accuracy cross-check, struck the same day because it required a second instrument measuring the same frames. **One mechanism would restore both**, which is the strongest argument for costing it. Constraints on any answer: `README`'s capture-tier table and its **safety** row *"always a way out"*, `legal/DISCLAIMER.md` §73 and `legal/EULA.md` §33; ETW needs elevation whatever the tool; and `15_ROADMAP` has no v2 fallback either | `README`, `legal/DISCLAIMER.md`, `legal/EULA.md`, `04_CAPTURE`, `14_TESTING`, `15_ROADMAP` |
|
||||
|
||||
---
|
||||
|
||||
+89
-57
@@ -71,6 +71,7 @@ owner-only items stay below; the history of every train, the passed owner-only i
|
||||
| `§beta.29` | [`handoff/history/0.1.0-beta.29.md`](handoff/history/0.1.0-beta.29.md) |
|
||||
| `§beta.30` | [`handoff/history/0.1.0-beta.30.md`](handoff/history/0.1.0-beta.30.md) |
|
||||
| `§beta.31` | [`handoff/history/0.1.0-beta.31.md`](handoff/history/0.1.0-beta.31.md) |
|
||||
| `§beta.32` | [`handoff/history/0.1.0-beta.32.md`](handoff/history/0.1.0-beta.32.md) |
|
||||
| `§Owner-only`, an open item | [§Owner-only](#owner-only--no-pr-can-close-these) below |
|
||||
| `§Owner-only`, a passed item (3, 12, 14–19) | [`handoff/owner-only-passed.md`](handoff/owner-only-passed.md) |
|
||||
| `§Traps`, `§Two corrections carried forward` | [`handoff/traps.md`](handoff/traps.md) |
|
||||
@@ -78,80 +79,87 @@ owner-only items stay below; the history of every train, the passed owner-only i
|
||||
|
||||
---
|
||||
|
||||
## **START HERE** — 2026-10-31, 0.1.0-beta.32: the alpha line — .NET 11 RC3 / C# 15 beside the betas
|
||||
## **START HERE** — 2026-11-03, 0.1.0-beta.33: games from the Xbox app and the Microsoft Store
|
||||
|
||||
*Status is `docs/changelog/0.1.0-beta.32.md` (and, for the first alpha, `docs/changelog/0.1.0-alpha.1.md`); this is what
|
||||
no other file carries.* The owner: "Bạn có thể phân tích, tìm kiếm sự khác biệt so với .NET 10, đánh giá, lên plan và tạo
|
||||
thêm bản alpha, nơi thử nghiệm các dotnet mới, cập nhật code (nếu cần) cho .NET 11 RC3/c# 15 để chuẩn bị cho .NET 11 ra
|
||||
mắt, thêm cảnh báo đây là bản thử nghiệm, yêu cầu tự chịu trách nhiệm nếu cần nhé." — an analysis of .NET 11 against
|
||||
.NET 10, an evaluation, a plan, and an alpha build where new .NET versions are tried, code updated where needed, with an
|
||||
experimental-build, own-risk warning. #344 (the line's plumbing), #346 (the warning, the backup, the legal text), #345
|
||||
(what .NET 11's SDK asks of the source) and this release; the `alpha` branch and `0.1.0-alpha.1` follow.
|
||||
*Status is `docs/changelog/0.1.0-beta.33.md`; this is what no other file carries.* The owner: "Trong phiên này, ta sẽ tập
|
||||
trung xử lý, đánh giá, phân tích cho các game thuộc MS Store/ Xbox App/Game Pass cho (các) phiên bản tiếp theo nhé. Quy
|
||||
trình vẫn như mọi lần." — handle, evaluate and analyse the games of the Microsoft Store, the Xbox app and Game Pass for the
|
||||
next versions, the usual train; the owner's games are in `C:\XboxGames` and `D:\xbox`. #351 (the library, the install
|
||||
root, detection, the art, Privacy 2.13), #352 (Play, the guard's two refusals, one exe-path reader) and this release;
|
||||
`0.1.0-alpha.2` follows (D82).
|
||||
|
||||
**Decisions (asked while planning, do not re-ask):**
|
||||
|
||||
- **D73 — the alpha line** (`12_BUILD` §The alpha line, `13_CI_CD` §The alpha line, `11_UPDATER` §Channels): the source of a
|
||||
released beta built on a prerelease .NET from the long-lived `alpha` branch, tagged `vX.Y.Z-alpha.N`, packed on
|
||||
Velopack's `alpha` channel. An alpha **replaces** the beta on the PC (same packId, install folder and data folder — the
|
||||
native layer reads that folder by fixed path) and **copies the ledger before it first opens it**, once per alpha
|
||||
version, newest three kept (`06_DATA_MODEL` §Migrations).
|
||||
- **D74 — the warning** (`08_UI` §First-run flow and §Settings, `01_ARCHITECTURE` §Lifecycle): `legal/ALPHA_NOTICE.md`
|
||||
in an alpha's Legal Gate with a tick box of its own that Accept waits for; the alpha's Agent does not serve until it is
|
||||
accepted (exit 8); an ALPHA badge, a banner at every start, the update channel locked.
|
||||
- **D75 — the legal text made true**: EULA 1.6 §2B and Disclaimer 2.12 §0 name alphas beside betas; the owner approved
|
||||
the Alpha notice 1.0 and both sentences with the plan.
|
||||
- **D76 — alpha.1 is a retarget only**: `net11.0`, C# 15 by `LangVersion latest`, the three runtime-serviced packages
|
||||
`11.0.0-rc.3.26522.148`; no preview feature (no runtime-async), no C# 15 syntax — main must keep building as C# 14 on
|
||||
.NET 10.
|
||||
- **D77 — measure first, on the owner's titles**: the launch chain was measured by activating six of the eleven packages
|
||||
with no FrameLedger hook, read-only, each game closed by its window and never killed, with the decision table committed
|
||||
before the run (`spike-notes` §25, its two commits in #351).
|
||||
- **D78 — GDK only**: an app-container (UWP) process is refused with a reason of its own, `TargetAppContainer`, Tier 2
|
||||
(`19_SAFETY` §The target must be able to take the Overlay); `LIMITATIONS.md` says so.
|
||||
- **D79 — the platform is "Xbox"** (id `xbox`), full scope: import, art, Play, Tier-1 capture, detection, docs and legal.
|
||||
- **D80 — Play on an Xbox game always activates its package**, in both D59 modes (`08_UI` §Games): started by its path a
|
||||
GDK game is never the game in its package — the run corrected the plan's premise that `CreateProcess` fails with error 5
|
||||
(it hands the launch executable back to the package, so the game is not the launcher's descendant; an Unreal shipping
|
||||
executable runs outside it). The Agent records such a game in attach mode.
|
||||
- **D81 — title lists stay keyed by Steam id**: an Xbox copy is matched by everything but that entry; the gap is
|
||||
`20_OPEN_QUESTIONS` §G *Xbox app / Microsoft Store titles*.
|
||||
- **D82 — alpha.2 right after beta.33** (the owner runs `0.1.0-alpha.1`, and the alpha's channel is locked): on RC3; if
|
||||
the train reaches the alpha after .NET 11's release on 2026-11-10, the standing rule applies (SDK 11.0.100, packages
|
||||
11.0.0) — no new decision.
|
||||
|
||||
**The evaluation, as given to the owner:** .NET 11 is STS — supported to about 2028-11, no later than .NET 10 LTS
|
||||
(2028-11-14) — so moving the main line buys no support time; Microsoft's supported-OS list for .NET 11 has Windows 10
|
||||
only in its LTSC and IoT editions, against NFR-8's Windows 10 22H2 floor; C# 15's unions and closed hierarchies would suit
|
||||
the tri-states and refusal reasons once the main line compiles C# 15. Recommendation: the main line stays on .NET 10;
|
||||
the alpha line gathers the evidence; `20_OPEN_QUESTIONS` §G *The main line's .NET* holds the decision table.
|
||||
The Privacy Policy 2.13's wording was approved with the plan (D36).
|
||||
|
||||
**Choices made here:**
|
||||
|
||||
- **One alpha per beta, never several in a row**: Velopack's `GithubSource` asks GitHub for one page of ten releases, so
|
||||
ten of one line in a row would hide the other line's newest from its update check (read from Velopack's code).
|
||||
- **Every alpha-only behaviour lives on main, dormant**: `Shared.BuildLine` is composed and injected, so the alpha's
|
||||
gate, banner, hold, Agent wait and backup are tested on main; the branch differs only by `RELEASE_LINE`, `global.json`,
|
||||
the TFM, three package versions and `legal/licenses/nuget/`.
|
||||
- **The App holds the Agent while an alpha's gate is open** on a hold of its own: the connection's first round runs under
|
||||
the first-run window, and a held-back Agent started anyway would exit 8 and be started again every round — under the
|
||||
admin mode a Windows prompt each time.
|
||||
- **The backup has its own lock**, five minutes, not the migration lock: that one gives a waiter 30 s and throws.
|
||||
- **.NET 11's `IHost` rethrow is accepted on the alpha**: a failed background service ends an alpha's Agent through the
|
||||
crash path with a minidump, where .NET 10 exits 0 — said in `LIMITATIONS.md`.
|
||||
- **A GDK package root is an install-root boundary**, for the guard's check 4 and for detection alike, and only where no
|
||||
store boundary matched — so it can only widen what is walked (`19_SAFETY` §Pre-injection checks, amended 2026-11-03).
|
||||
The guard gained `GamesInstalled\<X>` with it, and one case list read by both test suites
|
||||
(`tests/fixtures/install-roots/cases.txt`) holds the two resolvers together.
|
||||
- **`root_file`, a new detection signal**, answered from the install root's own listing, so the `xbox` platform rule —
|
||||
first, because a GDK FINAL FANTASY ships Steam's DLL — is decidable even where a very large install's walk ran short.
|
||||
- **The two refusals read the target once, before the primitive**, never at the 30 s re-scan; "could not tell" refuses as
|
||||
`ProcessUnreadable`, and only enforcing flags count (`SetContextIpValidation` without strict mode is on every
|
||||
CET-compatible process: `pwsh.exe` reads `0x105`).
|
||||
- **`TargetResolver` reads the watcher's spelling** (`ProcessImagePath`) but keeps the guard's rights, so D21's
|
||||
`TargetUnreadable` is unchanged.
|
||||
|
||||
**Measured on the way:** the whole gate on .NET 11 RC3 in a throwaway worktree (`spike-notes` §24): native 32/32, every
|
||||
test suite green with no change of answer, coverage and format clean; 21 analyzer sites in 14 files (CA1307 ×13, MA0002
|
||||
×7, CA2026 ×1), all fixed on main in forms .NET 10 also compiles; license-check red only because `legal/licenses/nuget/`
|
||||
is the beta's package set.
|
||||
**Measured on the way** (`spike-notes` §25): eleven GDK packages, full trust, the user's token, medium integrity, none of
|
||||
the four mitigations; the image path and the loader's main module both in the `Content` spelling; every game `.exe`
|
||||
refuses `FILE_READ_DATA`/`FILE_EXECUTE` outside its package, so no Unreal version and no *Runs as* for these titles;
|
||||
`GetProcessMitigationPolicy` answers through `PROCESS_QUERY_LIMITED_INFORMATION`, and an unknown policy answers
|
||||
`ERROR_INVALID_PARAMETER`.
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **`sed -i` in Git Bash rewrites a CRLF file as LF** (seen on the probe's props files); edit CRLF files with the Edit tool
|
||||
or Python with `newline=''`, and `unix2dos` a file the Write tool created.
|
||||
- **The keyboxd I/O error at signing came back**: `gpgconf --kill keyboxd` (the Windows GnuPG's), then commit again.
|
||||
- **A CMake configure in a fresh worktree works when the gate is started from PowerShell**, whose `git` is
|
||||
`Git\cmd\git.exe`; from Git Bash, CMake caches `ucrt64\bin\git.exe` and the submodule step fails.
|
||||
- **Malwarebytes quarantines `fl_guard_test.exe`** (`Malware.Heuristic.108256`, records in
|
||||
`C:\ProgramData\Malwarebytes\MBAMService\RtpDetections`) on some builds and not others: ctest then reports `fl_guard` as
|
||||
passed in 0.5 s with no output and `fl_prescan` with an empty command. Read `LastTest.log` for the assertion count before
|
||||
believing a native pass; an exclusion for `E:\frameledger\build\` is the owner's to add (a security setting), and CI runs
|
||||
both suites.
|
||||
- **`build.ps1` finds the x64 clang-format; `Get-ChildItem … clang-format.exe` finds the ARM64 one first**, which will not
|
||||
start on this PC.
|
||||
- **SonarCloud's quality gate on #351 was 77.7 % new-code coverage** (≥ 80 % wanted) and one `cpp:S5813` (`wcslen`): both
|
||||
closed in #352 — its own gate 95.4 %, main's after the merge 86.5 % on the code since beta.32 with no open issue. The
|
||||
job is advisory, so a merge on green does not wait for it — read its verdict after each merge.
|
||||
- **FluentAssertions' `OnlyContain` fails an empty collection**: a test of what this PC holds (`GamingRoots.OnThisPc()`)
|
||||
passed here and failed on the hosted runner, which has no `.GamingRoot` (#352's first CI run) — assert that nothing
|
||||
is wrong rather than that everything is right.
|
||||
|
||||
**Owner-only:** item 26 — beta.32 on real hardware.
|
||||
**Owner-only:** item 28 — the Xbox titles on real hardware.
|
||||
|
||||
### 0.1.0-alpha.1 — the first alpha, the same day
|
||||
### 0.1.0-alpha.2 — the second alpha, the same day (D82)
|
||||
|
||||
The `alpha` branch was cut from main at this pull request — `v0.1.0-beta.32` and these notes, no other change — and carries the switch alone (`12_BUILD` §The alpha line): `RELEASE_LINE`,
|
||||
`global.json` (SDK `11.0.100-rc.3.26522.148`), the TFM, three packages at `11.0.0-rc.3.26522.148`, and the NuGet licence
|
||||
texts of that package set (69 packages). Its gate on the 11 SDK passed whole before the pull request into `alpha`; the
|
||||
release ran from the signed tag `v0.1.0-alpha.1` on `alpha`, on Velopack's `alpha` channel. Its notes are
|
||||
`docs/changelog/0.1.0-alpha.1.md`, which open with the experimental-build warning.
|
||||
`alpha` took main at this pull request — `v0.1.0-beta.33` and these notes, no other change — by a merge commit, as
|
||||
`13_CI_CD` §The alpha line says: no file the switch holds had moved on main, so nothing conflicted and the switch is the
|
||||
first alpha's (SDK `11.0.100-rc.3.26522.148`, the three packages at `11.0.0-rc.3.26522.148`, the same NuGet licence
|
||||
texts). Its gate on the 11 SDK must pass before the pull request into `alpha` is merged by hand (the branch has no
|
||||
auto-merge); the release runs from the signed tag `v0.1.0-alpha.2` on `alpha`, and its delta from alpha.1 is the first
|
||||
an alpha's release has to find — #350's lookup, by the name the pack lists. Its notes are
|
||||
`docs/changelog/0.1.0-alpha.2.md`, which open with the experimental-build warning.
|
||||
|
||||
- **The next alpha** follows the next beta: merge main into `alpha` (a merge commit), regenerate `legal/licenses/nuget/`
|
||||
there if it conflicts, then the same steps (`13_CI_CD` §The alpha line). **.NET 11 ships on 2026-11-10**: from then the
|
||||
switch is SDK `11.0.100` and the packages `11.0.0`, and RC3 is out of support — move the alpha even if no beta comes.
|
||||
- **The next alpha moves to .NET 11's release**: from 2026-11-10 the switch is SDK `11.0.100` and the packages `11.0.0`,
|
||||
and RC3 is out of support — move the alpha even if no beta comes.
|
||||
|
||||
**Owner-only:** item 27 — the first alpha on real hardware.
|
||||
**Owner-only:** item 29 — the second alpha on real hardware.
|
||||
|
||||
|
||||
## Owner-only — no PR can close these
|
||||
@@ -342,6 +350,24 @@ release ran from the signed tag `v0.1.0-alpha.1` on `alpha`, on Velopack's `alph
|
||||
.NET 11. (e) **Going back**: the beta's `FrameLedger.App-win-Setup.exe` over it — the beta shows the alpha's session.
|
||||
(f) The `ja` strings marked `review` that only an alpha shows (`Alpha_*`, `FirstRun_Alpha_*`, `FirstRun_Doc_Alpha`,
|
||||
`App_Title_Alpha`, `About_Runtime_Alpha_Format`, `Settings_UpdateChannel_AlphaBody`).
|
||||
28. **beta.33 on real hardware: the Xbox titles** (D77–D81). (a) **The update from beta.32** (or alpha.2's, item 29): the
|
||||
terms window shows the Privacy Policy 2.13 once. (b) **Import library** offers the eleven Xbox titles as *Xbox* — the
|
||||
Unreal titles with their shipping executables (`…-WinGDK-Shipping.exe`, `ValorMortisMSG-Win64-Shipping.exe`), the Unity
|
||||
titles with their players, never `gamelaunchhelper.exe` — each with its package version (*Xbox version 1.3.5124.0*).
|
||||
(c) Each game's page shows its square logo whole in a square slot and its splash image as the banner, captioned
|
||||
*Xbox*. (d) **Play** starts Valor Mortis and FINAL FANTASY through Windows in both Play modes, and from an App run as
|
||||
administrator — the notice says Windows is starting it. (e) With consent given, one hooked session of each: Tier 1,
|
||||
frames, *late attach*, the engine and platform on the game page. (f) The `ja` strings marked `review`: `Store_Xbox_Format`,
|
||||
`Art_Source_Xbox`, `Import_NothingFound`, `FirstRun_Import_Body`, `Settings_GameArt_Body`, `Play_Xbox_Format`,
|
||||
`Play_Xbox_NotStarted_Format`, `Play_PackagedGame_Format`, `Play_ToolTip_Store`, `Play_ToolTip_Direct`,
|
||||
`Settings_PlayMode_Body`, `Guard_TargetAppContainer`, `Guard_TargetMitigation`. Then
|
||||
`docs/LIST_GAME_TESTED.md` gains the Xbox titles from a ledger copy (D35), approved before the commit.
|
||||
29. **0.1.0-alpha.2 on real hardware** (D73, D82). (a) **The update from alpha.1**: Help ▸ Check for updates offers
|
||||
alpha.2 — the first update an alpha's updater has found — and *Restart to update* installs it; say whether it
|
||||
downloaded the delta or the whole package. (b) The terms window shows the Privacy Policy 2.13 and the Alpha notice
|
||||
with its box again, and Accept waits for the tick. (c)
|
||||
`%LOCALAPPDATA%\FrameLedger\backups\ledger-before-0.1.0-alpha.2.db` exists beside alpha.1's, and opens. (d) Item 28's
|
||||
Xbox checks, on the alpha.
|
||||
**Answered 2026-08-05, do not re-ask:** remove `gameguard` and keep `guard` (approved
|
||||
over a red `Rules` gate, with the reasoning recorded in the merge commit); vendor NVAPI
|
||||
headers **and** `amd64/nvapi64.lib`; Windows 11 is the **measurement scope** only —
|
||||
@@ -432,6 +458,12 @@ Where each owner decision is recorded — the file and its section, and a label
|
||||
| D74 | [`08_UI.md`](08_UI.md) §First-run flow | the alpha's warning: the Alpha notice with its own tick box in the Legal Gate, the alpha's Agent waiting for it, an ALPHA badge and a banner, the update channel locked |
|
||||
| D75 | [`../legal/EULA.md`](../legal/EULA.md) §2B | EULA 1.6 and Disclaimer 2.12 name alphas beside betas; the Alpha notice 1.0 approved with the plan |
|
||||
| D76 | [`12_BUILD.md`](12_BUILD.md) §The alpha line | alpha.1 is a retarget only: `net11.0`, C# 15 by `LangVersion latest`, three runtime-serviced packages; no preview feature, no C# 15 syntax |
|
||||
| D77 | [`spike-notes/25-xbox-gdk.md`](spike-notes/25-xbox-gdk.md) | the Xbox titles measured first, by package activation, read-only, each closed by its window; the decision table before the run |
|
||||
| D78 | [`19_SAFETY_AND_ANTICHEAT.md`](19_SAFETY_AND_ANTICHEAT.md) §The target must be able to take the Overlay | GDK games only; an app-container (UWP) process is refused as `TargetAppContainer`, Tier 2 |
|
||||
| D79 | [`05_DETECTION.md`](05_DETECTION.md) §Platform signatures & metadata | the platform is "Xbox" (`xbox`), in full: import, artwork, Play, capture, detection, docs and legal |
|
||||
| D80 | [`08_UI.md`](08_UI.md) §Games | Play on an Xbox game always activates its package, in both modes; the Agent answers `PackagedGame` and records it in attach mode |
|
||||
| D81 | [`20_OPEN_QUESTIONS.md`](20_OPEN_QUESTIONS.md) §G | title lists stay keyed by Steam id; an Xbox copy is matched by everything but that entry |
|
||||
| D82 | [`HANDOFF.md`](HANDOFF.md) §START HERE | alpha.2 right after beta.33; on RC3 unless the train reaches it after .NET 11 ships (then SDK 11.0.100, packages 11.0.0) |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<!-- The second alpha's notes (D73, D82), on main as every release's are; the alpha branch takes them with its sync. CHANGELOG.md lists every release. -->
|
||||
|
||||
## [0.1.0-alpha.2] - 2026-11-03
|
||||
|
||||
> ⚠ **EXPERIMENTAL BUILD — YOU USE IT AT YOUR OWN RISK.** This is an **alpha**: the source of `0.1.0-beta.33` built on
|
||||
> **.NET 11 Release Candidate 3** (SDK `11.0.100-rc.3.26522.148`, runtime `11.0.0-rc.3.26522.148`), a version of .NET
|
||||
> Microsoft has not finished, with the C# 15 compiler. It has not been tested the way a beta is, and it can crash, record
|
||||
> wrongly or fail to update in ways no beta has. **If you want results you can rely on, use the beta.** Before it runs it
|
||||
> shows the *Alpha notice* (`legal/ALPHA_NOTICE.md` 1.0), which you must accept, with its own box to tick.
|
||||
|
||||
**The second alpha: `0.1.0-beta.33` on .NET 11 RC3** — games from the Xbox app and the Microsoft Store (the beta's
|
||||
notes, `docs/changelog/0.1.0-beta.33.md`, say what that brings). What an alpha is and how to go back: the user guide's
|
||||
*Alpha builds* page (`guide/11-alpha-builds.md`), and the *Alpha builds* section of `LIMITATIONS.md`.
|
||||
|
||||
**Updating from `0.1.0-alpha.1`:** Help ▸ Check for updates, then *Restart to update* with no game running — an alpha
|
||||
updates only to newer alphas. Before it first opens your database it copies it to
|
||||
`%LOCALAPPDATA%\FrameLedger\backups\ledger-before-0.1.0-alpha.2.db` (the newest three copies are kept). The terms window
|
||||
shows the **Privacy Policy 2.13** once and, as every time an alpha's terms window opens, waits for the Alpha notice's box
|
||||
to be ticked again; the notice itself stays 1.0. The ledger stays at schema 21; the detection rules move to `2026.11.1`.
|
||||
|
||||
**Installing it over a beta:** download `FrameLedger.App-alpha-Setup.exe` below, verify its hash against
|
||||
`SHA256SUMS.txt`, and let it replace the FrameLedger already installed; the Alpha notice is shown first. **Going back:**
|
||||
install the newest beta's `FrameLedger.App-win-Setup.exe` over it; your database stays where it is.
|
||||
|
||||
**Windows and your PC:** as for the first alpha — Microsoft supports .NET 11 on Windows 11 24H2 and later, and on Windows
|
||||
10 only in its LTSC and IoT editions; it needs a processor with SSE4.2 and POPCNT. .NET 11 RC3 is supported until .NET 11
|
||||
ships (10 November 2026); the next alpha moves to the final release.
|
||||
|
||||
### What differs from 0.1.0-beta.33
|
||||
|
||||
The same as `0.1.0-alpha.1` differed from `0.1.0-beta.32` (`docs/changelog/0.1.0-alpha.1.md`): the runtime and the
|
||||
compiler, the three libraries serviced with the runtime, what .NET 11 itself changes — and the part of FrameLedger loaded
|
||||
into a game is the beta's.
|
||||
@@ -0,0 +1,71 @@
|
||||
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.33 was cut, 2026-11-03 (D66). CHANGELOG.md lists every release. -->
|
||||
|
||||
## [0.1.0-beta.33] - 2026-11-03
|
||||
|
||||
**The thirty-third pre-release: games from the Xbox app and the Microsoft Store.** PC Game Pass games included: Import
|
||||
library finds the games those apps installed, a game's page shows its own logo and splash image, **Play** starts one
|
||||
through Windows as its Start-menu tile does, and, with your consent, FrameLedger hooks it like any other game. How these
|
||||
games are laid out, how Windows starts them and what it lets another program read were measured first on the owner's
|
||||
eleven titles; a hooked session of one is still to be run. The same unsigned installer: verify its hash against
|
||||
`SHA256SUMS.txt`, then *More info → Run anyway*.
|
||||
|
||||
**Updating from `0.1.0-beta.32`:** Help ▸ Check for updates, then *Restart to update* with no game running. The terms
|
||||
window shows the **Privacy Policy 2.13** once — it names what the Xbox library reads, that Play asks Windows to start
|
||||
such a game, and the two facts read from a game before any injection; the EULA and the Disclaimer do not change. The
|
||||
ledger stays at schema 21; the detection rules move to `2026.11.1`, so every game in the library is read again once.
|
||||
|
||||
### Added
|
||||
|
||||
- **Games from the Xbox app and the Microsoft Store** (the owner's request of 2026-11-03, owner decisions D77–D81; PC Game
|
||||
Pass games included): **Import library** finds the games those apps installed into a games folder — each drive's
|
||||
`.GamingRoot` names the folders, each game's own `MicrosoftGame.config` and `appxmanifest.xml` say what it is, and
|
||||
Windows says whether its package is installed for you — and lists them as **Xbox**, with the process that actually
|
||||
draws (an Unreal title's shipping executable, not the stub its package launches; never the GDK's `gamelaunchhelper.exe`).
|
||||
A game's page shows its own square logo and splash image, read from its folder, and its package version (*Xbox version
|
||||
1.3.5124.0*). Only games built on Microsoft's GDK are listed; an older Store app (UWP) is not (`docs/05_DETECTION.md`
|
||||
§Platform signatures & metadata, `LIMITATIONS.md`, the user guide). Everything was measured first, on the owner's eleven
|
||||
titles: the layout, and what Windows lets another program read there — every game executable refuses to be read, so no
|
||||
Unreal Engine version is shown for these games (`docs/spike-notes/25-xbox-gdk.md`).
|
||||
- **The detection rules know Xbox games** (rules `2026.11.1`, so every game in the library is read again once): an `xbox`
|
||||
platform, first in the list — a GDK FINAL FANTASY ships Steam's DLL and read *Steam* — decided by a new signal,
|
||||
`root_file`, from the install folder's own listing, so a very large install whose deep walk ran short still reads as
|
||||
its store (`docs/05_DETECTION.md`).
|
||||
- **Play starts a game from the Xbox app or the Microsoft Store through Windows** (D80), in either Play mode and from an
|
||||
App running as administrator: the user's shell activates the game's package as its Start-menu tile does
|
||||
(`explorer.exe shell:AppsFolder\<AUMID>`), because started by its path such a game is never the game in its package —
|
||||
measured on the owner's titles (`docs/spike-notes/25-xbox-gdk.md`). The capture agent refuses to start one by its path
|
||||
(`LaunchGame` answers `PackagedGame`), and the game is recorded once it appears, a few seconds after its start
|
||||
(`docs/04_CAPTURE.md`, `docs/08_UI.md`, `LIMITATIONS.md`).
|
||||
- **The anti-cheat guard says when a game cannot take the hook at all** (D78), read from the game's own token and code-protection
|
||||
settings just before the injection: `TargetAppContainer` — an older Microsoft Store app (UWP) — and `TargetMitigation` —
|
||||
only Microsoft- or Store-signed code, no generated code, a strict or non-CET-blocking user shadow stack, or strict Control
|
||||
Flow Guard. Neither is a finding: nothing is written to the game, and the session keeps its duration, the sensors and the
|
||||
reason. Each ended before as a failed injection, a hook that installed nothing, or a risk of ending the game, so no game
|
||||
that measured before is refused now (`docs/19_SAFETY_AND_ANTICHEAT.md`).
|
||||
|
||||
### Changed
|
||||
|
||||
- **The Privacy Policy is 2.13**, shown once at the next start: it names what the Xbox library reads — the games folders
|
||||
`.GamingRoot` names, each game's package files, Windows' answer whether its package is installed for you, and the
|
||||
pictures a game ships in its own folder — that Play asks Windows to start such a game, and that before any injection
|
||||
FrameLedger reads whether a game runs in an app container and which of Windows' code protections it runs under. The
|
||||
EULA and the Disclaimer do not change.
|
||||
- **The capture path reads a game's executable path one way** (for developers): `TargetResolver`, which finds the game again
|
||||
just before the guard, read the loader's spelling (`Process.MainModule`) where the watcher had the kernel's, so a game
|
||||
started through a junction could end `TargetNotRunning` about a process the watcher had just matched. Both read
|
||||
`ProcessImagePath` now, and the resolver still opens a candidate with the guard's own rights, so a process an anti-cheat
|
||||
driver closes stays `TargetUnreadable` (`docs/04_CAPTURE.md` §Process watcher).
|
||||
|
||||
### Fixed
|
||||
|
||||
- **The anti-cheat check saw only part of an Xbox game's folder** (safety): no install-root boundary matched the
|
||||
`<games folder>\<Game>\Content\` layout, so for an Unreal title's executable, three levels down, check 4 walked only its
|
||||
`Binaries\WinGDK` folder, and anti-cheat at the root of `Content` would have read clean. A GDK package root — the folder
|
||||
holding `MicrosoftGame.config` beside `appxmanifest.xml` — is now a boundary for the guard and for detection alike, used
|
||||
only where no store boundary matched, so it can only widen what is walked. The guard also gained `GamesInstalled\<X>`,
|
||||
which detection had had alone since #17; one case list read by both test suites now holds the two resolvers together
|
||||
(`docs/19_SAFETY_AND_ANTICHEAT.md`, `tests/fixtures/install-roots/cases.txt`).
|
||||
- **The second alpha's release would have stopped at its delta check** (for developers): Velopack names a non-default
|
||||
channel's packages with the channel (`FrameLedger.App-<version>-alpha-delta.nupkg`), and `release.yml` looked for the
|
||||
default channel's name. It now takes the delta the pack listed in `assets.<channel>.json`; the betas' packages are named
|
||||
as before (seen on the `0.1.0-alpha.1` rehearsal, which had no delta to make).
|
||||
@@ -0,0 +1,78 @@
|
||||
# HANDOFF history — 0.1.0-beta.32
|
||||
|
||||
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.33 was cut, 2026-11-03 (owner decision D66); `docs/HANDOFF.md` §How this file is split lists every part. Nothing below was edited, so its "below" and "above" mean HANDOFF.md as it stood.*
|
||||
|
||||
## **START HERE** — 2026-10-31, 0.1.0-beta.32: the alpha line — .NET 11 RC3 / C# 15 beside the betas
|
||||
|
||||
*Status is `docs/changelog/0.1.0-beta.32.md` (and, for the first alpha, `docs/changelog/0.1.0-alpha.1.md`); this is what
|
||||
no other file carries.* The owner: "Bạn có thể phân tích, tìm kiếm sự khác biệt so với .NET 10, đánh giá, lên plan và tạo
|
||||
thêm bản alpha, nơi thử nghiệm các dotnet mới, cập nhật code (nếu cần) cho .NET 11 RC3/c# 15 để chuẩn bị cho .NET 11 ra
|
||||
mắt, thêm cảnh báo đây là bản thử nghiệm, yêu cầu tự chịu trách nhiệm nếu cần nhé." — an analysis of .NET 11 against
|
||||
.NET 10, an evaluation, a plan, and an alpha build where new .NET versions are tried, code updated where needed, with an
|
||||
experimental-build, own-risk warning. #344 (the line's plumbing), #346 (the warning, the backup, the legal text), #345
|
||||
(what .NET 11's SDK asks of the source) and this release; the `alpha` branch and `0.1.0-alpha.1` follow.
|
||||
|
||||
**Decisions (asked while planning, do not re-ask):**
|
||||
|
||||
- **D73 — the alpha line** (`12_BUILD` §The alpha line, `13_CI_CD` §The alpha line, `11_UPDATER` §Channels): the source of a
|
||||
released beta built on a prerelease .NET from the long-lived `alpha` branch, tagged `vX.Y.Z-alpha.N`, packed on
|
||||
Velopack's `alpha` channel. An alpha **replaces** the beta on the PC (same packId, install folder and data folder — the
|
||||
native layer reads that folder by fixed path) and **copies the ledger before it first opens it**, once per alpha
|
||||
version, newest three kept (`06_DATA_MODEL` §Migrations).
|
||||
- **D74 — the warning** (`08_UI` §First-run flow and §Settings, `01_ARCHITECTURE` §Lifecycle): `legal/ALPHA_NOTICE.md`
|
||||
in an alpha's Legal Gate with a tick box of its own that Accept waits for; the alpha's Agent does not serve until it is
|
||||
accepted (exit 8); an ALPHA badge, a banner at every start, the update channel locked.
|
||||
- **D75 — the legal text made true**: EULA 1.6 §2B and Disclaimer 2.12 §0 name alphas beside betas; the owner approved
|
||||
the Alpha notice 1.0 and both sentences with the plan.
|
||||
- **D76 — alpha.1 is a retarget only**: `net11.0`, C# 15 by `LangVersion latest`, the three runtime-serviced packages
|
||||
`11.0.0-rc.3.26522.148`; no preview feature (no runtime-async), no C# 15 syntax — main must keep building as C# 14 on
|
||||
.NET 10.
|
||||
|
||||
**The evaluation, as given to the owner:** .NET 11 is STS — supported to about 2028-11, no later than .NET 10 LTS
|
||||
(2028-11-14) — so moving the main line buys no support time; Microsoft's supported-OS list for .NET 11 has Windows 10
|
||||
only in its LTSC and IoT editions, against NFR-8's Windows 10 22H2 floor; C# 15's unions and closed hierarchies would suit
|
||||
the tri-states and refusal reasons once the main line compiles C# 15. Recommendation: the main line stays on .NET 10;
|
||||
the alpha line gathers the evidence; `20_OPEN_QUESTIONS` §G *The main line's .NET* holds the decision table.
|
||||
|
||||
**Choices made here:**
|
||||
|
||||
- **One alpha per beta, never several in a row**: Velopack's `GithubSource` asks GitHub for one page of ten releases, so
|
||||
ten of one line in a row would hide the other line's newest from its update check (read from Velopack's code).
|
||||
- **Every alpha-only behaviour lives on main, dormant**: `Shared.BuildLine` is composed and injected, so the alpha's
|
||||
gate, banner, hold, Agent wait and backup are tested on main; the branch differs only by `RELEASE_LINE`, `global.json`,
|
||||
the TFM, three package versions and `legal/licenses/nuget/`.
|
||||
- **The App holds the Agent while an alpha's gate is open** on a hold of its own: the connection's first round runs under
|
||||
the first-run window, and a held-back Agent started anyway would exit 8 and be started again every round — under the
|
||||
admin mode a Windows prompt each time.
|
||||
- **The backup has its own lock**, five minutes, not the migration lock: that one gives a waiter 30 s and throws.
|
||||
- **.NET 11's `IHost` rethrow is accepted on the alpha**: a failed background service ends an alpha's Agent through the
|
||||
crash path with a minidump, where .NET 10 exits 0 — said in `LIMITATIONS.md`.
|
||||
|
||||
**Measured on the way:** the whole gate on .NET 11 RC3 in a throwaway worktree (`spike-notes` §24): native 32/32, every
|
||||
test suite green with no change of answer, coverage and format clean; 21 analyzer sites in 14 files (CA1307 ×13, MA0002
|
||||
×7, CA2026 ×1), all fixed on main in forms .NET 10 also compiles; license-check red only because `legal/licenses/nuget/`
|
||||
is the beta's package set.
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **`sed -i` in Git Bash rewrites a CRLF file as LF** (seen on the probe's props files); edit CRLF files with the Edit tool
|
||||
or Python with `newline=''`, and `unix2dos` a file the Write tool created.
|
||||
- **The keyboxd I/O error at signing came back**: `gpgconf --kill keyboxd` (the Windows GnuPG's), then commit again.
|
||||
- **A CMake configure in a fresh worktree works when the gate is started from PowerShell**, whose `git` is
|
||||
`Git\cmd\git.exe`; from Git Bash, CMake caches `ucrt64\bin\git.exe` and the submodule step fails.
|
||||
|
||||
**Owner-only:** item 26 — beta.32 on real hardware.
|
||||
|
||||
### 0.1.0-alpha.1 — the first alpha, the same day
|
||||
|
||||
The `alpha` branch was cut from main at this pull request — `v0.1.0-beta.32` and these notes, no other change — and carries the switch alone (`12_BUILD` §The alpha line): `RELEASE_LINE`,
|
||||
`global.json` (SDK `11.0.100-rc.3.26522.148`), the TFM, three packages at `11.0.0-rc.3.26522.148`, and the NuGet licence
|
||||
texts of that package set (69 packages). Its gate on the 11 SDK passed whole before the pull request into `alpha`; the
|
||||
release ran from the signed tag `v0.1.0-alpha.1` on `alpha`, on Velopack's `alpha` channel. Its notes are
|
||||
`docs/changelog/0.1.0-alpha.1.md`, which open with the experimental-build warning.
|
||||
|
||||
- **The next alpha** follows the next beta: merge main into `alpha` (a merge commit), regenerate `legal/licenses/nuget/`
|
||||
there if it conflicts, then the same steps (`13_CI_CD` §The alpha line). **.NET 11 ships on 2026-11-10**: from then the
|
||||
switch is SDK `11.0.100` and the packages `11.0.0`, and RC3 is out of support — move the alpha even if no beta comes.
|
||||
|
||||
**Owner-only:** item 27 — the first alpha on real hardware.
|
||||
@@ -48,3 +48,4 @@ Each section below lives in its own file under `docs/spike-notes/`, moved verbat
|
||||
| §22 | The owner's runs of beta.24 and beta.25 on real hardware (2026-10-19) | [`spike-notes/22-owner-runs-2026-10-19.md`](spike-notes/22-owner-runs-2026-10-19.md) |
|
||||
| §23 | The owner's runs of beta.26 on real hardware (2026-10-20) | [`spike-notes/23-owner-runs-2026-10-20.md`](spike-notes/23-owner-runs-2026-10-20.md) |
|
||||
| §24 | The whole gate on .NET 11 RC3 — what the alpha line's SDK asks of the source (2026-10-31, beta.32, D73–D76) | [`spike-notes/24-dotnet11-probe.md`](spike-notes/24-dotnet11-probe.md) |
|
||||
| §25 | Xbox app / Microsoft Store (GDK) titles — the layout, the launch chain, the image paths (2026-11-03, beta.33, D77–D82) | [`spike-notes/25-xbox-gdk.md`](spike-notes/25-xbox-gdk.md) |
|
||||
@@ -0,0 +1,151 @@
|
||||
## 25 · Xbox app / Microsoft Store (GDK) titles — the layout, the launch chain, the image paths *(2026-11-03, beta.33, owner decisions D77–D82)*
|
||||
|
||||
**Why this was measured.** The owner asked for the games the Xbox app and the Microsoft Store install (PC Game Pass
|
||||
included) to be handled, evaluated and analysed. FrameLedger had no source for them — the import read Steam, GOG, Epic
|
||||
and itch, and the owner's log of 2026-11-01 lists exactly those four — and `02_SPEC` put "Microsoft Store/UWP/Game Pass
|
||||
titles (packaged-app injection constraints)" out of scope for v1 without any document saying what the constraints were.
|
||||
What follows is read from the owner's own installs: first read-only (the layout), then a launch probe the owner allowed
|
||||
(D77): each game started through its package with nothing of FrameLedger in it, its processes recorded, and closed by
|
||||
its window.
|
||||
|
||||
**Where.** The dev box of §Environment (Windows 11 Pro build 29648, i7-14700KF, RTX 5080), the Agent there running
|
||||
elevated (D34). Gaming Services and GamingServicesNet running; its drivers `gameflt.sys` and `xvdd.sys` running.
|
||||
|
||||
| Title | Package family name | Version | Engine | Executables in `Content` |
|
||||
|---|---|---|---|---|
|
||||
| A Game About Digging A Hole (on C:) | `rokapublish.AGameAboutDiggingAHole_6q4vfhsywtz4j` | 1.2.1.0 | Unreal, `Binaries\WinGDK` | `DiggingGame.exe` (233,984 bytes), `DiggingGame\Binaries\WinGDK\DiggingGame-WinGDK-Shipping.exe` (126.1 MB) |
|
||||
| Ascend to ZERO | `FlywayGames.AscendtoZERO_sey8peye7nc36` | 1.2.1.0 | Unreal, `Binaries\WinGDK` | `AscendtoZERO.exe` (339,968), `MementoMori\Binaries\WinGDK\AscendtoZERO-WinGDK-Shipping.exe` (160.7 MB) |
|
||||
| Valor Mortis | `LyricalGamesLLC.ValorMortis_72fag5ekhk96y` | 1.3.5124.0 | Unreal, `Binaries\Win64` | `ValorMortisMSG.exe` (297,984), `ValorMortis\Binaries\Win64\ValorMortisMSG-Win64-Shipping.exe` (184.1 MB) |
|
||||
| FINAL FANTASY I–VI (Pixel Remaster) | `39EA002F.FF1DF_n746a19ndrrjg` … `FF6DF` | 1.2.1.0–1.2.3.0 | Unity IL2CPP | `FINAL FANTASY*.exe` (664,336 each), `UnityCrashHandler64.exe` |
|
||||
| inKONBINI | `BeepJapan.inKONBINI_h2va14as5wpxj` | 1.0.209.0 | Unity, D3D12 Agility SDK | `inKONBINI.exe` (672,256), `UnityCrashHandler64.exe` |
|
||||
| Microsoft Jewel | `Microsoft.MicrosoftJewel_8wekyb3d8bbwe` | 1.1.8131.0 | Unity, D3D12 Agility SDK | `Microsoft Jewel.exe` (239,936) |
|
||||
|
||||
Every one also has `gamelaunchhelper.exe` (100,808–113,096 bytes) at the root of `Content`.
|
||||
|
||||
### Read-only, before any launch
|
||||
|
||||
- **The layout.** Each drive the Xbox app installs to holds `.GamingRoot` at its root: the bytes `RGBX`, a 32-bit count,
|
||||
then that many NUL-terminated UTF-16 folder names relative to the drive (C: `XboxGames`, 28 bytes; D: `xbox`, 18
|
||||
bytes). Under each folder, one folder per game: `Content\` (the game's files), a `Shaders\` folder and GUID-named
|
||||
package files beside it; `C:\XboxGames\GameSave` is not a game and has no `Content`.
|
||||
- **The package's own description**, in `Content`: `MicrosoftGame.config` (the FINAL FANTASY titles spell it
|
||||
`MicrosoftGame.Config`) — `Identity` Name/Publisher/Version, `ShellVisuals` (DefaultDisplayName,
|
||||
Square480x480Logo 480×480, Square150x150Logo, StoreLogo, SplashScreenImage 1920×1080, BackgroundColor),
|
||||
`ExecutableList` (the launch executable: the Unreal root stub, the Unity player), TitleId, StoreId,
|
||||
`DesktopRegistration/ProcessorArchitecture` x64 — and `appxmanifest.xml`: one `Application` whose Executable is
|
||||
`GameLaunchHelper.exe` with `EntryPoint="Windows.FullTrustApplication"`, `runFullTrust`, `appLicensing`,
|
||||
`unvirtualizedResources`, and on all 11 `desktop6:FileSystemWriteVirtualization` and
|
||||
`desktop6:RegistryWriteVirtualization` set to `disabled`. Exactly one `MicrosoftGame.config` per game, at the root of
|
||||
`Content`; no reparse point anywhere inside `Content`; no `.sys` file and no anti-cheat folder in any tree; no
|
||||
`Content` tree holds more than 2,633 entries in all (check 4's budget is 4,096 per walk). Each FINAL FANTASY title
|
||||
ships `FINAL FANTASY*_Data\Plugins\x86_64\steam_api64.dll`.
|
||||
- **Three spellings of one file.** Windows registers each package's InstallLocation as
|
||||
`C:\Program Files\WindowsApps\<PackageFullName>` — a junction to `D:\WindowsApps\<PackageFullName>` (the D: games),
|
||||
itself a junction to `D:\xbox\<Game>\Content\`; for the C: game, straight to `C:\XboxGames\<Game>\Content\`.
|
||||
`D:\WindowsApps` cannot be listed by the user; a path through it can still be opened. .NET's
|
||||
`Directory.ResolveLinkTarget` on the WindowsApps junction: access denied. A `FILE_READ_ATTRIBUTES` handle and
|
||||
`GetFinalPathNameByHandleW` resolve the whole chain, unelevated:
|
||||
`C:\Program Files\WindowsApps\LyricalGamesLLC.ValorMortis_1.3.5124.0_x64__72fag5ekhk96y\ValorMortis\Binaries\Win64\ValorMortisMSG-Win64-Shipping.exe`
|
||||
→ `\\?\D:\xbox\Valor Mortis\Content\ValorMortis\Binaries\Win64\ValorMortisMSG-Win64-Shipping.exe`.
|
||||
- **The executables refuse to be read or run by anything outside their package.** Every game `.exe` under `Content`
|
||||
(the stubs, the shipping executables, the Unity players, `UnityCrashHandler64.exe`) answers `CreateFileW` with error 5
|
||||
for `FILE_READ_DATA` and for `FILE_EXECUTE`, from a standard user's process, although its DACL grants Users read: its
|
||||
first ACE is `(XA;;0x1200a9;;;BU;(WIN://SYSAPPID Contains "<family name>"))`, then `(A;;FR;;;BU)`, and
|
||||
`READ_ATTRIBUTES` and `READ_CONTROL` work (size, times and security descriptor read). `gamelaunchhelper.exe` (which
|
||||
carries an extra explicit Users ACE), every `.dll`, the images and the XML files read. What refuses — most likely the
|
||||
Gaming Services file-system filter — is not established. Consequences: ~~no `CreateProcess` of a GDK game from outside
|
||||
its package~~ *(corrected the same day by the run below: `CreateProcess` of one does start a process — never the game
|
||||
in its package, so it is still not how FrameLedger starts one)*, and nothing of FrameLedger may need an executable's
|
||||
bytes (its PE header, version resource, imports or strings) — `PeImports` already answers `unknown` for a file it
|
||||
cannot open, without throwing.
|
||||
- **Windows' own names for them.** `PackageFamilyNameFromId(Name, Publisher)` computes the family name;
|
||||
`GetPackagesByPackageFamily` lists the installed full name; `GetPackagePathByFullName` answers the WindowsApps path —
|
||||
all unelevated, documented `appmodel.h` calls. `<family name>!<the appxmanifest Application Id>` is exactly the
|
||||
AppUserModelID Windows' Start menu lists for each of the 11 (`Get-StartApps`), e.g.
|
||||
`LyricalGamesLLC.ValorMortis_72fag5ekhk96y!AppValorMortisShipping` and `39EA002F.FF1DF_n746a19ndrrjg!Game`.
|
||||
|
||||
### The probe (D77)
|
||||
|
||||
PowerShell with inline C#, from the scratchpad, as the standard user, with no FrameLedger hook enabled for any of these
|
||||
titles (none is in the library). Six titles, one of each kind: A Game About Digging A Hole, Ascend to ZERO, Valor
|
||||
Mortis, FINAL FANTASY, inKONBINI, Microsoft Jewel. For each:
|
||||
|
||||
1. `IApplicationActivationManager::ActivateApplication(<AUMID>, null, AO_NONE)` — the pid it returns, its HRESULT.
|
||||
2. Every 100 ms for 30 s, each process that was not there before: pid, parent pid, image name, creation time,
|
||||
`QueryFullProcessImageNameW` (what the watcher and the guard's `ImageDirectory` read) **and**
|
||||
`GetModuleFileNameExW(handle, NULL)` (the loader's main-module path — what `TargetResolver` compares through
|
||||
`MainModule.FileName`), `GetPackageFullName`, `TokenIsAppContainer`, the integrity level, elevation,
|
||||
`GetProcessMitigationPolicy` (signature, dynamic code, user shadow stack, control flow guard, image load), whether
|
||||
`OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_VM_READ)` — the guard's module-scan rights — opens it, and
|
||||
the first poll at which `dxgi.dll`, `d3d11.dll`, `d3d12.dll`, `D3D12Core.dll` and `vulkan-1.dll` are in its module
|
||||
list.
|
||||
3. The ancestors of the game's process up to the first name on the guard's launcher list, each with the same
|
||||
openability test, and every chain member's module names checked against the rules' fuzzy name fragments.
|
||||
4. `CloseMainWindow` on the game's window, then up to 20 s for it to exit. A game that stays open is left open and
|
||||
named to the owner, never killed.
|
||||
|
||||
Plus, once each: `explorer.exe shell:AppsFolder\<AUMID>` for FINAL FANTASY (the command Play will use), and one
|
||||
`CreateProcess` of `FINAL FANTASY.exe` by its path (expected: error 5 — if it starts, it is closed the same way).
|
||||
|
||||
### The decision table, written before the run
|
||||
|
||||
| Measured | Outcome | Then |
|
||||
|---|---|---|
|
||||
| The game process's image path (`QueryFullProcessImageNameW`) | `<root>\<Game>\Content\…`, the final path | the library entry is that path, and the watcher matches it as today |
|
||||
| | `C:\Program Files\WindowsApps\<Full>\…` | a path under a `WindowsApps` segment is resolved with a read-attributes handle and `GetFinalPathNameByHandleW`, in the watcher's key and in the guard's `ImageDirectory` — only such paths, so no existing entry's key moves |
|
||||
| The loader's main-module path against the image path | the same | `TargetResolver` moves to `QueryFullProcessImageNameW` all the same: one source of the image path for the watcher, the resolver and the guard |
|
||||
| | different | that move is what makes a hooked session of a packaged game possible at all |
|
||||
| The chain | GameLaunchHelper → the game (→ the shipping executable), parents alive | nothing to add: the entry is the process that presents, and the watcher sees it |
|
||||
| | GameLaunchHelper exits first | the same — the watcher matches by path; no election is needed |
|
||||
| GameLaunchHelper's parent | `svchost.exe` or `explorer.exe` | the guard's scan set stops there; the launcher list is unchanged |
|
||||
| | `GamingServices.exe` or another SYSTEM process | it joins the hardcoded launcher list, with this row as the reason — else an unelevated Agent's scan cannot open it and refuses every session |
|
||||
| A chain member the guard's rights cannot open | none | nothing to add |
|
||||
| | one | named here; a platform process → the launcher list, anything else → the owner, mid-train |
|
||||
| A chain member's module with a fuzzy fragment in its name | none | nothing to add |
|
||||
| | one | recorded with its signature kind; the guard refuses (fail closed) and the owner decides — never relaxed here |
|
||||
| The token | full trust, the user, medium integrity | the Tier-1 path; a token that is not an AppContainer uses the session's object namespace, so the ring and `Local\FrameLedger.Tolerate.<pid>` work unchanged (the ring itself is first seen in the owner's hooked session) |
|
||||
| | an AppContainer | refused with a reason of its own (D78) |
|
||||
| Mitigations | none of: signed-only images, prohibited dynamic code, strict shadow stack, strict CFG | inject |
|
||||
| | any of them | refused before injecting, the policy named (the refusal is built either way: today each ends as a failed injection, no hooks, or a crash risk) |
|
||||
| The graphics runtime mapped before a 1 Hz watcher can see the process | yes | the session is `late_attach`, as for a game Steam starts; `dxgiPresentsBeforeHook` says how much |
|
||||
| `CreateProcess` of a game executable by path | error 5 | D80 stands: Play activates the package in both modes |
|
||||
|
||||
### What the run found *(2026-11-03, 03:57–04:09 UTC)*
|
||||
|
||||
Every activation answered `S_OK` with the pid of `gamelaunchhelper.exe`. The chain, each time: `gamelaunchhelper.exe`
|
||||
(in the package; its parent the activating process) → `gamingservicesui.exe` (Gaming Services' own UI, no package,
|
||||
appearing 0.1–0.8 s after the press and gone again) → `XboxPcTray.exe` (the Xbox app's tray, when not already running)
|
||||
→ the package's launch executable 6.2–14.4 s after the press → for Unreal, the shipping executable 0.25–0.37 s later as
|
||||
its child.
|
||||
`gamelaunchhelper.exe` had exited before the 30 s were up in every run, while the game ran on.
|
||||
|
||||
| Title | Launch executable at | Process that presents | Graphics runtime mapped |
|
||||
|---|---|---|---|
|
||||
| A Game About Digging A Hole | `DiggingGame.exe` +14.4 s | `DiggingGame-WinGDK-Shipping.exe` +14.7 s | `dxgi` + `opengl32` at its first poll, `d3d11` 2.4 s later |
|
||||
| Ascend to ZERO | `AscendtoZERO.exe` +8.7 s | `AscendtoZERO-WinGDK-Shipping.exe` +8.9 s | `dxgi` + `opengl32` at once, `d3d12` + `D3D12Core` 2.7 s later |
|
||||
| Valor Mortis | `ValorMortisMSG.exe` +6.8 s | `ValorMortisMSG-Win64-Shipping.exe` +7.2 s | `dxgi` + `opengl32` at once, `d3d12` + `D3D12Core` 3.1 s later, `d3d11` 3.7 s |
|
||||
| FINAL FANTASY | `FINAL FANTASY.exe` +8.8 s | the same (+ `UnityCrashHandler64.exe`) | `opengl32` 0.4 s, `d3d11` + `dxgi` 1.2 s |
|
||||
| inKONBINI | `inKONBINI.exe` +6.8 s | the same (+ `UnityCrashHandler64.exe`) | `dxgi` + `d3d11` + `opengl32` at its first poll |
|
||||
| Microsoft Jewel | `Microsoft Jewel.exe` +6.6 s | the same (+ six `msedgewebview2.exe` children in its package) | `dxgi` + `d3d11` at once, `d3d12` + `D3D12Core` 0.6 s later |
|
||||
|
||||
Against the table above:
|
||||
|
||||
| Measured | Outcome | So |
|
||||
|---|---|---|
|
||||
| The game process's image path | **`<root>\<Game>\Content\…`** for all six, the C: game included (`C:\XboxGames\…\Content\…`) | the entry is that path; the watcher matches as today |
|
||||
| The loader's main-module path | **the same string** as the image path, for every process of every chain | no mismatch on these titles; `TargetResolver` still moves to `QueryFullProcessImageNameW` (one source) |
|
||||
| The chain | GameLaunchHelper → the game (→ the shipping executable); GameLaunchHelper gone before the game is | nothing to add: the watcher matches the entry by path |
|
||||
| GameLaunchHelper's parent | the activating process: `pwsh.exe` (the probe's `ActivateApplication`), `explorer.exe` (`explorer.exe shell:AppsFolder\<AUMID>`), `dllhost.exe` (below). From the Xbox app itself: not measured | started as Play starts it, the scan set stops at `explorer.exe`; the launcher list is unchanged |
|
||||
| Chain members the guard's rights cannot open | **none**: every process of every chain — GameLaunchHelper while it lived, the stubs, the shipping executables, the Unity players and crash handlers, Jewel's WebView2 children (two of them at low and untrusted integrity) — opened with `QUERY_LIMITED_INFORMATION \| VM_READ` as the standard user | nothing to add |
|
||||
| Fuzzy-fragment module names in a chain member | **none** (the Unreal games load `xgameruntime.dll`, `XCurl.dll`, `libHttpClient.GDK.dll`, `GameChat2.dll`, `gameplatformservices.dll`, `gamingservicesproxy_17.dll`, `XblAuthManagerProxy.dll`) | nothing to add |
|
||||
| The token | every game process: in its package, **not an AppContainer**, medium integrity | the Tier-1 path; the session's object namespace |
|
||||
| Mitigations | none of the four on any game process: signature `0x0`, dynamic code `0x0`, user shadow stack `0x100` (only `CetDynamicApisOutOfProcOnly`), CFG `0x0`/`0x1` (no strict mode), image load `0x0`. Jewel's WebView2 sandboxes carry signed-only `0x5` and dynamic code `0x1` — children, never a target | inject; the `TargetMitigation` refusal is built for the titles that do |
|
||||
| The graphics runtime before a 1 Hz watcher sees the process | the Unreal shipping executables import `dxgi.dll` statically and create their D3D device 2.4–3.7 s later; the Unity players have it within 0.1–1.2 s | an attach within the watcher's second is before the Unreal device and around the Unity one: `late_attach`, as for a game Steam starts |
|
||||
| `CreateProcess` by path | **not error 5.** `FINAL FANTASY.exe` (the package's launch executable): Windows started **`gamelaunchhelper.exe`, outside the package, in its place** (that process's image path and main module both `gamelaunchhelper.exe`), which activated the package — a second, packaged `gamelaunchhelper.exe` (its parent `dllhost.exe`) started `FINAL FANTASY.exe` 6.2 s after the press; the process the caller holds is never the game, and the game is not its descendant. `DiggingGame-WinGDK-Shipping.exe` (not a launch executable): ran **as itself, outside its package** (`GetPackageFullName`: no package), its window up, until closed | D80 stands on two measured grounds instead of the one assumed: a start by path either hands itself to the package within seconds (an early exit the crash safety counts, and a launch whose game it never sees) or runs the game outside its package — which FrameLedger must never cause. The Agent refuses to start an executable under a GDK package root |
|
||||
|
||||
**Closing.** Five of the six closed on `CloseMainWindow`; Valor Mortis' window went at once and its two processes
|
||||
about 40 s later, by themselves. Microsoft Jewel ignored it and was left open for the owner, as agreed.
|
||||
|
||||
**Not measured:** a start from inside the Xbox app (GameLaunchHelper's parent there); a package that keeps write
|
||||
virtualization on (all 11 turn it off), so where the Overlay's log would land in one; any GDK title with anti-cheat;
|
||||
any Vulkan GDK title; the ring from a packaged process (first seen in the owner's hooked session).
|
||||
@@ -3,8 +3,8 @@
|
||||
## 1. Add the game
|
||||
|
||||
- **File ▸ Add game…** — pick the game's `.exe` file.
|
||||
- **File ▸ Import library…** — FrameLedger lists the games installed through Steam, GOG, Epic and itch.io, and you
|
||||
tick the ones to add.
|
||||
- **File ▸ Import library…** — FrameLedger lists the games installed through Steam, GOG, Epic, itch.io and the Xbox app
|
||||
(or the Microsoft Store — PC Game Pass games included), and you tick the ones to add.
|
||||
|
||||
Every game is added with **hooking off**.
|
||||
|
||||
@@ -33,6 +33,8 @@ why it was not measured.
|
||||
- **It found anti-cheat.** FrameLedger then turns hooking off for that game and says why on the game's page.
|
||||
- **The game is 32-bit or uses DirectX 9.**
|
||||
- **It is a Vulkan game** you started yourself.
|
||||
- **It is an older Microsoft Store app (UWP)**, or Windows runs the game under code protection the component cannot
|
||||
live under.
|
||||
- **The game runs as administrator.** Settings ▸ Capture agent ▸ *Run the agent as administrator* can help (off by
|
||||
default; Windows asks every time the agent starts). Read its risk in [Limitations](../LIMITATIONS.md) first.
|
||||
- **The game was already running when FrameLedger was updated** — restart the game once.
|
||||
|
||||
@@ -12,7 +12,8 @@ nothing is uploaded. The only network requests are the update check and the upda
|
||||
Your game library; your sessions — frame times when a game was measured, the statistics, your PC's sensors, the game's
|
||||
own memory use, how the game's window was shown; a short description of your hardware for each session; your tags and
|
||||
notes; your settings; and, in the `covers` folder, a copy of each picture you chose for a game. The pictures the Steam and
|
||||
GOG GALAXY apps keep for your games are shown from where those apps keep them, never copied. The
|
||||
GOG GALAXY apps keep for your games, and those an Xbox game ships in its own folder, are shown from where they are, never
|
||||
copied. The
|
||||
[Privacy Policy](../legal/PRIVACY_POLICY.md) lists all of it.
|
||||
|
||||
## How much is kept
|
||||
|
||||
+2
-1
@@ -8,7 +8,8 @@ FrameLedger cannot measure. The session's summary says which. See [Record a game
|
||||
## I switched hooking on, and the game is still not measured.
|
||||
|
||||
FrameLedger refuses a game where it finds anti-cheat, and cannot measure 32-bit games, DirectX 9 games, Vulkan games you
|
||||
start yourself, or a game that runs as administrator (unless the agent does too). A game that was already running when
|
||||
start yourself, or a game that runs as administrator (unless the agent does too). A game from the Xbox app is measured from a few
|
||||
seconds after it starts, because Windows starts it. A game that was already running when
|
||||
FrameLedger updated needs one restart. The game's page and the session's summary say what happened.
|
||||
|
||||
## Why "Presented FPS" and not the game's own frame rate?
|
||||
|
||||
+5
-4
@@ -27,7 +27,7 @@ stopped, hooking turned off — each with one button that only says you have rea
|
||||
| Menu | Item | What it does |
|
||||
|---|---|---|
|
||||
| **File** | **Add game…** | Pick a game's `.exe` file. It is added with hooking off, and its page opens. |
|
||||
| | **Import library…** | A checklist of the games installed through Steam, GOG Galaxy, Epic and itch.io. |
|
||||
| | **Import library…** | A checklist of the games installed through Steam, GOG Galaxy, Epic, itch.io and the Xbox app (or the Microsoft Store). |
|
||||
| | **Export** ▸ **Session CSV** · **Session JSON** · **Chart PNG** | Saves the session you last selected or opened. Read [Your data](05-your-data.md) before you share a file. |
|
||||
| | **Exit** | Quits FrameLedger, even when *Minimize to tray on close* is on. |
|
||||
| **Tools** | **Agent status…** | Opens the Dashboard, where the agent's card is. |
|
||||
@@ -71,11 +71,12 @@ stopped, hooking turned off — each with one button that only says you have rea
|
||||
|
||||
## A game's page
|
||||
|
||||
- **At the top:** the game's picture — a banner and its cover, from the Steam or GOG GALAXY app on your PC or the image
|
||||
you chose — in a band that takes the picture's colour; then the name, publisher, version, store and engine, the `.exe`
|
||||
- **At the top:** the game's picture — a banner and its cover, from the Steam or GOG GALAXY app on your PC, the logo and
|
||||
splash image an Xbox game ships in its own folder, or the image you chose — in a band that takes the picture's colour; then the name, publisher, version, store and engine, the `.exe`
|
||||
path, the last session, the last measured session's frame rate and its ray-tracing chips. A game with no picture shows
|
||||
none (**Settings ▸ Games** turns the picture and its colour off). **Play** starts the game: through the store that
|
||||
installed it, or directly — **Settings ▸ Games ▸ Play button** chooses. **Edit…** changes the name, publisher, version
|
||||
installed it, or directly — **Settings ▸ Games ▸ Play button** chooses; a game from the Xbox app always starts through
|
||||
Windows. **Edit…** changes the name, publisher, version
|
||||
and notes, and the picture: **Choose image…** (kept as a copy once you save) or **Use the store's image**. **Change
|
||||
executable…** points the entry at another `.exe` and turns hooking back off; its file dialog opens in the game's own
|
||||
folder. **Remove…** asks whether to keep the game's sessions.
|
||||
|
||||
@@ -48,9 +48,9 @@ The link under them, *Read what the hook does and does not do*, opens the safety
|
||||
|
||||
| Setting | What it does | Default |
|
||||
|---|---|---|
|
||||
| **Show game artwork** | A game's page shows a picture of the game: the image you chose for it (**Edit…**), or else the cover and banner the Steam or GOG GALAXY app already keeps on your PC. Nothing is downloaded; a game from another store shows a picture only once you choose one. | On |
|
||||
| **Show game artwork** | A game's page shows a picture of the game: the image you chose for it (**Edit…**), or else the cover and banner the Steam or GOG GALAXY app already keeps on your PC, or the logo and splash image an Xbox game ships in its own folder. Nothing is downloaded; a game from another store shows a picture only once you choose one. | On |
|
||||
| **Colour the game page from its artwork** | The band at the top of a game's page takes the picture's main colour — never so strongly that a text on it gets hard to read. Off, the band keeps the plain card colour. | On |
|
||||
| **Play button** | What **Play** does, on a game's page and on each game in the library. *Through the store*: Steam or the Epic Games Launcher starts the game, GOG GALAXY runs it, and the itch app asks which copy to launch — each store's app does what it does when you start a game from it. A game no store installed, and a GOG game without GOG GALAXY, is started by FrameLedger instead; so is every game while FrameLedger itself runs as administrator, so that the game does not. *Start directly*: FrameLedger's agent starts the game, recorded from its first frame, with your standard rights; it does not start a game whose recording is off, or one that asks to run as administrator. Some Steam games hand themselves to Steam when started directly — the game Steam then starts is recorded — and a few will not start outside Steam at all: start those through the store. | Through the store |
|
||||
| **Play button** | What **Play** does, on a game's page and on each game in the library. *Through the store*: Steam or the Epic Games Launcher starts the game, GOG GALAXY runs it, and the itch app asks which copy to launch — each store's app does what it does when you start a game from it. A game no store installed, and a GOG game without GOG GALAXY, is started by FrameLedger instead; so is every game while FrameLedger itself runs as administrator, so that the game does not. *Start directly*: FrameLedger's agent starts the game, recorded from its first frame, with your standard rights; it does not start a game whose recording is off, or one that asks to run as administrator. Some Steam games hand themselves to Steam when started directly — the game Steam then starts is recorded — and a few will not start outside Steam at all: start those through the store. A game from the Xbox app or the Microsoft Store always starts through Windows, as its Start-menu tile does, in either mode. | Through the store |
|
||||
|
||||
## Window
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ While the game runs, a notice may say *hooking refused*.
|
||||
| FrameLedger could not check the game's files. | It checks again by itself; Tools ▸ Update detection rules checks now. |
|
||||
| The game runs as administrator. | Settings ▸ Capture agent ▸ *Run the agent as administrator* — read its risk in [Limitations](../LIMITATIONS.md#running-the-agent-as-administrator) first. A game protected by an anti-cheat driver cannot be measured either way. |
|
||||
| The game is 32-bit, uses DirectX 9, or uses Vulkan. | Nothing: these are recorded, not measured ([Limitations](../LIMITATIONS.md#games-it-will-not-measure)). |
|
||||
| The game runs in an app container, or Windows protects it in a way the component can neither load into nor hook. | Nothing: an older Microsoft Store app (UWP), or a game under code protection, is recorded, not measured ([Limitations](../LIMITATIONS.md#xbox-app-and-microsoft-store-games)). |
|
||||
| **Disable all hooking** is on. | Switch it off in Settings ▸ Capture. |
|
||||
| The game was already running when FrameLedger was updated. | Close the game and start it again. |
|
||||
| Hooking was switched off after the game crashed twice soon after it started. | Switch it on again in the game's page if the cause may be gone — after a driver update, for example. |
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
HTML comments are not part of the block.
|
||||
-->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-19.** The software is a beta; its latest
|
||||
> **beta is `0.1.0-beta.32`** (2026-10-31), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.33`** (2026-11-03), an unsigned installer built from that tag with its
|
||||
> checksums published beside it (alphas — experimental builds on a prerelease .NET — are published apart). The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-19.** The software is a beta; its latest
|
||||
> **beta is `0.1.0-beta.32`** (2026-10-31), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.33`** (2026-11-03), an unsigned installer built from that tag with its
|
||||
> checksums published beside it (alphas — experimental builds on a prerelease .NET — are published apart). The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# FrameLedger — Privacy Policy
|
||||
|
||||
**Version:** 2.12 · **Effective:** {{RELEASE_DATE}}
|
||||
**Version:** 2.13 · **Effective:** {{RELEASE_DATE}}
|
||||
|
||||
**Short version: everything stays on your PC. FrameLedger has no accounts, no telemetry, no analytics, and never uploads your data anywhere.**
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
Stored in `%LOCALAPPDATA%\FrameLedger` on your device:
|
||||
|
||||
- Your game library entries (names, executable paths, metadata you or the app filled in, and whether each one is recorded).
|
||||
- Images you choose for a game (Edit…), copied into the `covers` folder; choosing the store's image again, or removing the game together with its sessions, deletes the copy. Artwork a store's app keeps on your PC is shown from where it is and not copied.
|
||||
- Images you choose for a game (Edit…), copied into the `covers` folder; choosing the store's image again, or removing the game together with its sessions, deletes the copy. Artwork a store's app keeps on your PC, or a game ships in its own folder, is shown from where it is and not copied.
|
||||
- Performance sessions: frame timing series, computed statistics, hardware sensor series (temperatures, load, power, memory usage, and the graphics card's clock speeds, fan speed, memory temperature and whether its power limit or heat held it back), the game's own memory use (its dedicated and shared video memory, private working set, working set and commit, once a second), session duration, crash flags, the graphics driver's settings the game ran under (NVIDIA only), how the game's window was shown (full-screen, borderless or windowed, for how long, its size and the monitor's), tags and notes you write.
|
||||
- A hardware snapshot per session (CPU/GPU model, driver version, RAM size, OS build, display mode) used for the "what changed between sessions" feature.
|
||||
- App settings, logs (rotated daily — the app keeps 7 days, the capture agent 14 — including the logs written by the component loaded into games), and, after a crash of the app itself, crash dump files.
|
||||
@@ -30,7 +30,7 @@ There is no other request. In particular, the anti-cheat safety list and the det
|
||||
|
||||
GitHub's own privacy practices apply to requests it receives: <https://docs.github.com/privacy>.
|
||||
|
||||
Pressing Play hands the game to its store's app on your PC, which may connect to its store as it does whenever you start a game from it; FrameLedger itself connects to nothing.
|
||||
Pressing Play hands the game to its store's app on your PC — or, for a game the Xbox app or the Microsoft Store installed, asks Windows to start it as its Start-menu tile does — which may connect to its store as it does whenever you start a game from it; FrameLedger itself connects to nothing.
|
||||
|
||||
## 3. Bug reports — always manual
|
||||
|
||||
@@ -42,7 +42,7 @@ An exported session (CSV or JSON) and a bug report can contain your games' names
|
||||
|
||||
## 4. What the app can technically observe
|
||||
|
||||
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured, the version information of its upscaling and frame-generation libraries, and whether each was loaded from the game's folder or from the graphics driver's own copy (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the lists of installed games that the Steam, GOG GALAXY, Epic Games and itch apps keep on your disk, and where GOG GALAXY is installed — read when you import your library and when you press Play, to find the store that installed a game and hand the game to that store's app — Steam's and GOG GALAXY's also when you open a game's page, to find the artwork their apps keep for it; the cover and banner images that the Steam and GOG GALAXY apps keep on your disk for a game in your library — read to show them on its page, never copied or sent anywhere; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
|
||||
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; whether a game you enabled hooking for runs in an app container, and which of Windows' code-protection settings it runs under (for example, accepting only Microsoft-signed code), read from Windows before any injection; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured, the version information of its upscaling and frame-generation libraries, and whether each was loaded from the game's folder or from the graphics driver's own copy (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) and, for a game the Xbox app or the Microsoft Store installed, the package files in its install folder that describe it (`MicrosoftGame.config` and `appxmanifest.xml`) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the lists of installed games that the Steam, GOG GALAXY, Epic Games and itch apps keep on your disk, and where GOG GALAXY is installed, the folders the Xbox app installs games into on each drive (named by the `.GamingRoot` file at the drive's root) with each game's package files, and Windows' answer to whether that game's package is installed for you — read when you import your library and when you press Play, to find the store that installed a game and hand the game to that store's app — Steam's and GOG GALAXY's also when you open a game's page, to find the artwork their apps keep for it; the cover and banner images that the Steam and GOG GALAXY apps keep on your disk for a game in your library and the logo and splash-screen images a game from the Xbox app ships in its own folder — read to show them on its page, never copied or sent anywhere; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
|
||||
|
||||
It does **not** read game memory outside those API parameters, and does not read game saves, chat, input content, network traffic, or anything unrelated to performance measurement. It records only for programs you added to your library and did not switch recording off for — a program whose recording is off is not watched at all — and injects only into games you individually enabled.
|
||||
|
||||
|
||||
+4
-2
@@ -7,7 +7,8 @@ documents the app asks you to accept.
|
||||
|
||||
## Other companies' names
|
||||
|
||||
Microsoft, Windows, DirectX, Direct3D and DXGI are trademarks of Microsoft Corporation. NVIDIA, GeForce, RTX, DLSS,
|
||||
Microsoft, Windows, DirectX, Direct3D, DXGI, Xbox, Xbox Game Pass, PC Game Pass and Microsoft Store are trademarks of
|
||||
Microsoft Corporation. NVIDIA, GeForce, RTX, DLSS,
|
||||
Reflex, NVAPI and Streamline are trademarks of NVIDIA Corporation. AMD, Radeon, FSR and FidelityFX are trademarks of
|
||||
Advanced Micro Devices, Inc. Intel, Arc and XeSS are trademarks of Intel Corporation. Vulkan is a registered trademark
|
||||
of the Khronos Group Inc.; OpenGL is a registered trademark of Hewlett Packard Enterprise, used under licence by the
|
||||
@@ -29,7 +30,8 @@ companies, by any game's developer or publisher, or by any anti-cheat vendor, an
|
||||
not a benchmark claim and not a recommendation.
|
||||
- **A game's artwork belongs to its owners.** FrameLedger ships none and downloads none: a game's page shows the image you
|
||||
chose for it, or the cover and banner the Steam or GOG GALAXY app already keeps on your PC, read from where that app
|
||||
keeps it and never copied (since 0.1.0-beta.23).
|
||||
keeps it and never copied (since 0.1.0-beta.23) — or, for a game the Xbox app installed, the logo and splash image the
|
||||
game ships in its own folder, read from there in the same way (since 0.1.0-beta.33).
|
||||
|
||||
## The name FrameLedger
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
"level, which made it a check that could not fire."
|
||||
],
|
||||
"schemaVersion": 2,
|
||||
"rulesVersion": "2026.10.4",
|
||||
"rulesVersion": "2026.11.1",
|
||||
|
||||
"engines": [
|
||||
{
|
||||
@@ -146,6 +146,14 @@
|
||||
],
|
||||
|
||||
"platforms": [
|
||||
{
|
||||
"id": "xbox",
|
||||
"name": "Xbox",
|
||||
"signals": { "all": [
|
||||
{ "type": "root_file", "value": "MicrosoftGame.config" },
|
||||
{ "type": "root_file", "value": "appxmanifest.xml" }
|
||||
] }
|
||||
},
|
||||
{
|
||||
"id": "steam",
|
||||
"name": "Steam",
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
},
|
||||
|
||||
"signalType": {
|
||||
"$comment": "Closed enum. `path_contains` is used by the seed (platforms/steam) but is ABSENT from the 05_DETECTION signal-type list, and `strings_regex` is used as a version extractor but is likewise absent - 05_DETECTION needs the same edit as this schema.",
|
||||
"$comment": "Closed enum. `path_contains` is used by the seed (platforms/steam) but is ABSENT from the 05_DETECTION signal-type list, and `strings_regex` is used as a version extractor but is likewise absent - 05_DETECTION needs the same edit as this schema. `root_file` (beta.33, platforms/xbox): an exact file name directly in the install root, answered from that one folder's listing, so a deep walk that ran short cannot make its miss Unknown.",
|
||||
"enum": [
|
||||
"file_exists",
|
||||
"dir_exists",
|
||||
@@ -129,7 +129,8 @@
|
||||
"pe_company_contains",
|
||||
"pe_product_contains",
|
||||
"strings_contains",
|
||||
"manifest_field"
|
||||
"manifest_field",
|
||||
"root_file"
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ using FrameLedger.Infrastructure.AntiCheat;
|
||||
using FrameLedger.Infrastructure.Blobs;
|
||||
using FrameLedger.Infrastructure.Capture;
|
||||
using FrameLedger.Infrastructure.Detection;
|
||||
using FrameLedger.Infrastructure.Import;
|
||||
using FrameLedger.Infrastructure.Ipc;
|
||||
using FrameLedger.Infrastructure.Persistence;
|
||||
using FrameLedger.Infrastructure.Recording;
|
||||
@@ -262,7 +263,7 @@ internal static class AgentServices
|
||||
sp.GetRequiredService<IGameRepository>(),
|
||||
sp.GetRequiredService<IProcessSnapshotSource>(),
|
||||
sp.GetRequiredService<IExecutableIdentitySource>(),
|
||||
new OrchestratorOptions { PayloadPath = AgentPaths.Payload },
|
||||
new OrchestratorOptions { PayloadPath = AgentPaths.Payload, IsPackaged = static exe => GdkPackageFiles.IsInPackage(exe) },
|
||||
static line => Serilog.Log.Information("{Line}", line),
|
||||
sp.GetRequiredService<ILaunchRecorderFactory>(),
|
||||
sp.GetRequiredService<ExecutableRelocator>(),
|
||||
|
||||
@@ -463,12 +463,14 @@ public partial class App : System.Windows.Application
|
||||
/// <summary>FR-1.2's library import (P4 PR-4): the stores, the executable guess, the importer over the games port, the review checklist behind a port.</summary>
|
||||
private static void AddImport(IServiceCollection services)
|
||||
{
|
||||
// FR-1.2's library import (P4 PR-4): the four stores read from their own local files and keys, the executable
|
||||
// guess for the two that name none, the importer over the games port, the review checklist behind a port.
|
||||
// FR-1.2's library import (P4 PR-4): the stores read from their own local files and keys (five since beta.33), the
|
||||
// executable guess for those that name none, the importer over the games port, the review checklist behind a port.
|
||||
services.AddSingleton<IStoreLibrarySource>(static _ => new SteamLibrarySource());
|
||||
services.AddSingleton<IStoreLibrarySource>(static _ => new GogLibrarySource());
|
||||
services.AddSingleton<IStoreLibrarySource>(static _ => new EpicLibrarySource());
|
||||
services.AddSingleton<IStoreLibrarySource>(static _ => new ItchLibrarySource(log: static line => Serilog.Log.Information("{Line}", line)));
|
||||
// beta.33 (D79): the Xbox app's and the Microsoft Store's games, from the drives' .GamingRoot folders and each package's own files.
|
||||
services.AddSingleton<IStoreLibrarySource>(static _ => new XboxLibrarySource());
|
||||
services.AddSingleton<IExecutableLocator, ExecutableLocator>();
|
||||
// beta.21 (D59): Play reads the same records to find the store that installed a game, and GOG GALAXY's program.
|
||||
services.AddSingleton<Application.Play.IGogGalaxyLocator>(static _ => new GogGalaxyLocator());
|
||||
@@ -491,9 +493,11 @@ public partial class App : System.Windows.Application
|
||||
services.AddSingleton<ImportLibraryFlow>();
|
||||
|
||||
// beta.23 (owner decisions D60/D61): a game's artwork — the image the user chose (kept in the data folder's covers),
|
||||
// else what the Steam and GOG GALAXY apps keep on this PC, found through the same store records Play reads.
|
||||
// else what the Steam and GOG GALAXY apps keep on this PC (and, since beta.33, what an Xbox game ships in its own
|
||||
// package folder), found through the same store records Play reads.
|
||||
services.AddSingleton<Application.Art.IStoreArtCache>(static _ => new SteamArtCache());
|
||||
services.AddSingleton<Application.Art.IStoreArtCache>(static _ => new GogArtCache());
|
||||
services.AddSingleton<Application.Art.IStoreArtCache>(static _ => new XboxArtCache());
|
||||
services.AddSingleton(static sp => new StoreRecordsReader(sp.GetServices<IStoreLibrarySource>()));
|
||||
services.AddSingleton(static sp => new GameArt(
|
||||
sp.GetRequiredService<Application.Settings.RegisteredSettings>(),
|
||||
|
||||
@@ -81,6 +81,11 @@
|
||||
<Setter Property="Width" Value="230" />
|
||||
<Setter Property="Height" Value="107" />
|
||||
</DataTrigger>
|
||||
<!-- An Xbox game's square logo (beta.33): whole, never cropped to a portrait. -->
|
||||
<DataTrigger Binding="{Binding ViewModel.ArtCoverIsSquare}" Value="True">
|
||||
<Setter Property="Width" Value="150" />
|
||||
<Setter Property="Height" Value="150" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ui:Image.Style>
|
||||
|
||||
@@ -313,9 +313,10 @@ public static class Formats
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// <c>games.game_version</c> said as what it is (beta.8): a store import writes a Steam build id or a GOG / Epic
|
||||
/// version string, and a bare "20374416" in the subtitle said nothing. Labelled with the store when a store wrote it
|
||||
/// (<paramref name="detected"/>); a version the user typed is shown as typed. Null when there is none.
|
||||
/// <c>games.game_version</c> said as what it is (beta.8): a store import writes a Steam build id, a GOG / Epic
|
||||
/// version string or an Xbox package's version (beta.33), and a bare "20374416" in the subtitle said nothing.
|
||||
/// Labelled with the store when a store wrote it (<paramref name="detected"/>); a version the user typed is shown as
|
||||
/// typed. Null when there is none.
|
||||
/// </summary>
|
||||
public static string? StoreVersion(string? platform, string? version, bool detected)
|
||||
{
|
||||
@@ -329,6 +330,7 @@ public static class Formats
|
||||
"steam" => Strings.Store_Steam_Format,
|
||||
"gog" => Strings.Store_Gog_Format,
|
||||
"epic" => Strings.Store_Epic_Format,
|
||||
"xbox" => Strings.Store_Xbox_Format,
|
||||
_ => null,
|
||||
};
|
||||
return format is null ? version : string.Format(CultureInfo.CurrentCulture, format, version);
|
||||
@@ -393,6 +395,7 @@ public static class Formats
|
||||
"gog" => "GOG",
|
||||
"epic" => "Epic Games",
|
||||
"itch" => "itch.io",
|
||||
"xbox" => "Xbox",
|
||||
_ => string.Empty,
|
||||
};
|
||||
|
||||
@@ -515,6 +518,8 @@ public static class Formats
|
||||
"LaunchTargetExited" => Strings.Guard_LaunchTargetExited,
|
||||
"LaunchNoPresentationRuntime" => Strings.Guard_LaunchNoPresentationRuntime,
|
||||
"TargetIsVulkanLayered" => Strings.Guard_TargetIsVulkanLayered,
|
||||
"TargetAppContainer" => Strings.Guard_TargetAppContainer,
|
||||
"TargetMitigation" => Strings.Guard_TargetMitigation,
|
||||
"SuspiciousUnsigned" => Strings.Guard_SuspiciousUnsigned,
|
||||
_ => string.Format(CultureInfo.CurrentCulture, Strings.Guard_Other_Format, reason),
|
||||
};
|
||||
|
||||
@@ -80,13 +80,21 @@ public sealed class GameArt
|
||||
string? platform = null;
|
||||
if (StoreRecords.Owning(game.Fingerprint.ExePath, game.StoreId, records) is { } record && _caches.TryGetValue(record.Platform, out IStoreArtCache? cache))
|
||||
{
|
||||
files = cache.Find(record.StoreId);
|
||||
files = cache.Find(record);
|
||||
platform = record.Platform;
|
||||
}
|
||||
|
||||
// The cover slot: the user's image, else the store's portrait cover, else its landscape header.
|
||||
// The cover slot: the user's image, else the store's portrait cover, else its square logo (an Xbox game's, beta.33),
|
||||
// else its landscape header.
|
||||
BitmapSource? storeCover = Decode(files.Cover, 0, 450);
|
||||
bool landscape = false;
|
||||
bool square = false;
|
||||
if (storeCover is null && Decode(files.Square, 0, 300) is { } logo)
|
||||
{
|
||||
storeCover = logo;
|
||||
square = true;
|
||||
}
|
||||
|
||||
if (storeCover is null && Decode(files.Header, 460, 0) is { } header)
|
||||
{
|
||||
storeCover = header;
|
||||
@@ -102,10 +110,13 @@ public sealed class GameArt
|
||||
}
|
||||
|
||||
Color? colour = tint ? DominantOf(cover ?? hero!) : null;
|
||||
string source = own is not null ? Strings.Art_Source_Yours
|
||||
: string.Equals(platform, "gog", StringComparison.Ordinal) ? Strings.Art_Source_Gog
|
||||
: Strings.Art_Source_Steam;
|
||||
return new GameArtView(cover, own is not null, own is null && landscape, storeCover, hero, colour, source);
|
||||
string source = own is not null ? Strings.Art_Source_Yours : platform switch
|
||||
{
|
||||
"gog" => Strings.Art_Source_Gog,
|
||||
"xbox" => Strings.Art_Source_Xbox,
|
||||
_ => Strings.Art_Source_Steam,
|
||||
};
|
||||
return new GameArtView(cover, own is not null, own is null && landscape, storeCover, hero, colour, source, own is null && square);
|
||||
}
|
||||
|
||||
private async Task<IReadOnlyList<StoreGame>> RecordsAsync()
|
||||
|
||||
@@ -7,7 +7,8 @@ namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// A game's artwork as its page shows it (beta.23, D60): the cover slot's image (the user's own, or the store's portrait
|
||||
/// cover, or its landscape header), the store's own cover for the edit dialog's "use the store's image", the banner, the
|
||||
/// band's colour (null: untinted), and where the images came from, for the tooltip.
|
||||
/// cover, or — beta.33 — an Xbox game's square logo, or its landscape header), the store's own cover for the edit dialog's
|
||||
/// "use the store's image", the banner, the band's colour (null: untinted), and where the images came from, for the tooltip.
|
||||
/// </summary>
|
||||
public sealed record GameArtView(ImageSource? Cover, bool CoverIsOwn, bool CoverIsLandscape, ImageSource? StoreCover, ImageSource? Hero, Color? Tint, string Source);
|
||||
public sealed record GameArtView(ImageSource? Cover, bool CoverIsOwn, bool CoverIsLandscape, ImageSource? StoreCover, ImageSource? Hero, Color? Tint, string Source,
|
||||
bool CoverIsSquare = false);
|
||||
@@ -21,7 +21,9 @@ namespace FrameLedger.App.Services;
|
||||
/// instead, and the notice says why. <c>direct</c> has the capture agent start it (<c>LaunchGame</c>, launch mode): recorded
|
||||
/// from its first frame, never as administrator (<c>UnelevatedProcess</c>), hooked only where the gate allows exactly as for any
|
||||
/// start (CLAUDE.md rule 1). FrameLedger itself connects to nothing (rule 8): a store's app does what it does when a game is
|
||||
/// started from it.
|
||||
/// started from it. A game the Xbox app or the Microsoft Store installed (beta.33, D80) is handed to Windows in either mode —
|
||||
/// <c>explorer.exe shell:AppsFolder\<AUMID></c>, as its Start-menu tile starts it — because started by its path it is never
|
||||
/// the game in its package (<c>spike-notes</c> §25).
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public sealed class GamePlayer
|
||||
@@ -52,42 +54,42 @@ public sealed class GamePlayer
|
||||
public async Task<PlayResult> PlayAsync(GameRow game, CancellationToken ct = default)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(game);
|
||||
StoreGame? record = await OwningAsync(game, ct).ConfigureAwait(false);
|
||||
|
||||
// beta.33 (D80): a game the Xbox app or the Microsoft Store installed starts through Windows in either mode, and from
|
||||
// an elevated App too — the user's shell activates it, unelevated. Started by its path it is never the game in its
|
||||
// package (spike-notes §25: Windows hands the launch executable back to the package; an Unreal shipping binary runs
|
||||
// outside it).
|
||||
if (record is { Platform: "xbox" })
|
||||
{
|
||||
return StoreLaunches.For(record, galaxyClientPath: null) is { } windows ? HandOff(game, windows) : NotActivated(game);
|
||||
}
|
||||
|
||||
PlayFallback fallback = PlayFallback.None;
|
||||
StoreGame? record = null;
|
||||
if (!await IsDirectAsync(ct).ConfigureAwait(false))
|
||||
{
|
||||
if (_elevated())
|
||||
{
|
||||
fallback = PlayFallback.Elevated;
|
||||
}
|
||||
else if (record is null)
|
||||
{
|
||||
fallback = PlayFallback.NoStore;
|
||||
}
|
||||
else
|
||||
{
|
||||
record = await OwningAsync(game, ct).ConfigureAwait(false);
|
||||
if (record is null)
|
||||
string? galaxy = string.Equals(record.Platform, "gog", StringComparison.Ordinal) ? _galaxy.ClientPath() : null;
|
||||
if (StoreLaunches.For(record, galaxy) is { } launch)
|
||||
{
|
||||
fallback = PlayFallback.NoStore;
|
||||
return HandOff(game, launch);
|
||||
}
|
||||
else
|
||||
{
|
||||
string? galaxy = string.Equals(record.Platform, "gog", StringComparison.Ordinal) ? _galaxy.ClientPath() : null;
|
||||
if (StoreLaunches.For(record, galaxy) is { } launch)
|
||||
{
|
||||
return HandOff(game, launch);
|
||||
}
|
||||
|
||||
fallback = WhyNoHandOff(game, record, galaxy);
|
||||
}
|
||||
fallback = WhyNoHandOff(game, record, galaxy);
|
||||
}
|
||||
}
|
||||
|
||||
// beta.27: a game Steam installed may hand itself to Steam when something else starts it (Lies of P, 2026-10-19:
|
||||
// its process left within seconds and Steam started the game again), and the notice says so. No store's records
|
||||
// name a game that fell back for want of one, so they are read only where they were not already.
|
||||
if (fallback is PlayFallback.None or PlayFallback.Elevated)
|
||||
{
|
||||
record = await OwningAsync(game, ct).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
// its process left within seconds and Steam started the game again), and the notice says so.
|
||||
bool steamGame = string.Equals(record?.Platform, "steam", StringComparison.Ordinal);
|
||||
return await StartDirectlyAsync(game, fallback, steamGame, ct).ConfigureAwait(false);
|
||||
}
|
||||
@@ -103,8 +105,12 @@ public sealed class GamePlayer
|
||||
"steam" => string.Format(CultureInfo.CurrentCulture, Strings.Play_Steam_Format, gameName),
|
||||
"epic" => string.Format(CultureInfo.CurrentCulture, Strings.Play_Epic_Format, gameName),
|
||||
"gog" => string.Format(CultureInfo.CurrentCulture, Strings.Play_Gog_Format, gameName),
|
||||
"xbox" => string.Format(CultureInfo.CurrentCulture, Strings.Play_Xbox_Format, gameName),
|
||||
_ => string.Format(CultureInfo.CurrentCulture, Strings.Play_Itch_Format, gameName),
|
||||
}, false),
|
||||
PlayOutcome.Failed when string.Equals(result.Store, "xbox", StringComparison.Ordinal) =>
|
||||
(string.Format(CultureInfo.CurrentCulture, Strings.Play_Xbox_NotStarted_Format, gameName), true),
|
||||
PlayOutcome.PackagedGame => (string.Format(CultureInfo.CurrentCulture, Strings.Play_PackagedGame_Format, gameName), true),
|
||||
PlayOutcome.StartedByAgent => (result.Fallback switch
|
||||
{
|
||||
PlayFallback.NoStore => string.Format(CultureInfo.CurrentCulture, Strings.Play_NoStore_Format, gameName),
|
||||
@@ -138,6 +144,16 @@ public sealed class GamePlayer
|
||||
return handed ? new PlayResult(PlayOutcome.HandedToStore, launch.Platform) : new PlayResult(PlayOutcome.Failed, launch.Platform);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An Xbox game whose package names nothing Windows can activate (no application id of the AUMID's shape): FrameLedger
|
||||
/// cannot start it by its path either (D80), so the notice says to start it from the Xbox app or the Start menu.
|
||||
/// </summary>
|
||||
private static PlayResult NotActivated(GameRow game)
|
||||
{
|
||||
Log.Warning("play: {Game} (id {Id}): its Xbox package names nothing Windows can activate; not started", game.Name, game.Id);
|
||||
return new PlayResult(PlayOutcome.Failed, "xbox");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A store's record with no hand-off: a GOG game without GOG GALAXY, or — never seen, and logged — an id or a folder of a
|
||||
/// shape that store's own never have, which <see cref="StoreLaunches"/> puts in no link.
|
||||
@@ -199,6 +215,7 @@ public sealed class GamePlayer
|
||||
"RecordingOff" => new PlayResult(PlayOutcome.RecordingOff, Fallback: fallback),
|
||||
"SessionRunning" => new PlayResult(PlayOutcome.AlreadyRunning, Fallback: fallback),
|
||||
"UnknownGame" => new PlayResult(PlayOutcome.NotInLibrary, Fallback: fallback),
|
||||
"PackagedGame" => new PlayResult(PlayOutcome.PackagedGame, Fallback: fallback),
|
||||
_ => new PlayResult(PlayOutcome.Failed, Fallback: fallback, Detail: ack.Outcome),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -32,4 +32,10 @@ public enum PlayOutcome
|
||||
|
||||
/// <summary>Windows would not open the store's app, or the agent refused for another reason (<see cref="PlayResult.Detail"/>).</summary>
|
||||
Failed,
|
||||
|
||||
/// <summary>
|
||||
/// beta.33 (D80): the agent was asked to start a game the Xbox app or the Microsoft Store installed (<c>PackagedGame</c>) —
|
||||
/// reached only when no store's records name its package, since Play hands such a game to Windows itself.
|
||||
/// </summary>
|
||||
PackagedGame,
|
||||
}
|
||||
@@ -8,7 +8,11 @@ using Serilog;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>The shell's own hand-off. The App runs with the user's standard rights; an elevated App never reaches here (<see cref="GamePlayer"/>).</summary>
|
||||
/// <summary>
|
||||
/// The shell's own hand-off. The App runs with the user's standard rights; an elevated App reaches here only for an Xbox game
|
||||
/// (beta.33, D80), whose hand-off is <c>explorer.exe shell:AppsFolder\<AUMID></c>: the running shell activates the package,
|
||||
/// unelevated (<see cref="GamePlayer"/>).
|
||||
/// </summary>
|
||||
public sealed class ShellStarter : IShellStarter
|
||||
{
|
||||
public bool OpenLink(string link)
|
||||
|
||||
Generated
+21
@@ -93,6 +93,7 @@ public static class Strings
|
||||
nameof(Art_ImportFailed),
|
||||
nameof(Art_Source_Gog),
|
||||
nameof(Art_Source_Steam),
|
||||
nameof(Art_Source_Xbox),
|
||||
nameof(Art_Source_Yours),
|
||||
nameof(Blocked_Directory_Format),
|
||||
nameof(Blocked_Executable_Format),
|
||||
@@ -620,8 +621,10 @@ public static class Strings
|
||||
nameof(Guard_RulesUnreadable),
|
||||
nameof(Guard_ServiceQueryFailed),
|
||||
nameof(Guard_SuspiciousUnsigned),
|
||||
nameof(Guard_TargetAppContainer),
|
||||
nameof(Guard_TargetIsVulkanLayered),
|
||||
nameof(Guard_TargetIsWow64),
|
||||
nameof(Guard_TargetMitigation),
|
||||
nameof(Guide_Title),
|
||||
nameof(Hooking_NotX64_Format),
|
||||
nameof(ImagePicker_Filter),
|
||||
@@ -788,6 +791,7 @@ public static class Strings
|
||||
nameof(Play_NoGalaxy_Format),
|
||||
nameof(Play_NoStore_Format),
|
||||
nameof(Play_NotInLibrary_Format),
|
||||
nameof(Play_PackagedGame_Format),
|
||||
nameof(Play_RecordingOff_Fallback_Format),
|
||||
nameof(Play_RecordingOff_Format),
|
||||
nameof(Play_Started_Format),
|
||||
@@ -796,6 +800,8 @@ public static class Strings
|
||||
nameof(Play_Title),
|
||||
nameof(Play_ToolTip_Direct),
|
||||
nameof(Play_ToolTip_Store),
|
||||
nameof(Play_Xbox_Format),
|
||||
nameof(Play_Xbox_NotStarted_Format),
|
||||
nameof(RemoveGame_Body),
|
||||
nameof(RemoveGame_Delete),
|
||||
nameof(RemoveGame_Keep),
|
||||
@@ -983,6 +989,7 @@ public static class Strings
|
||||
nameof(Store_Epic_Format),
|
||||
nameof(Store_Gog_Format),
|
||||
nameof(Store_Steam_Format),
|
||||
nameof(Store_Xbox_Format),
|
||||
nameof(Summary_Annotations_Header),
|
||||
nameof(Summary_Crash_Body),
|
||||
nameof(Summary_Crash_Title),
|
||||
@@ -1314,6 +1321,8 @@ public static class Strings
|
||||
|
||||
public static string Art_Source_Steam => ResourceManager.GetString(nameof(Art_Source_Steam), Culture) ?? nameof(Art_Source_Steam);
|
||||
|
||||
public static string Art_Source_Xbox => ResourceManager.GetString(nameof(Art_Source_Xbox), Culture) ?? nameof(Art_Source_Xbox);
|
||||
|
||||
public static string Art_Source_Yours => ResourceManager.GetString(nameof(Art_Source_Yours), Culture) ?? nameof(Art_Source_Yours);
|
||||
|
||||
public static string Blocked_Directory_Format => ResourceManager.GetString(nameof(Blocked_Directory_Format), Culture) ?? nameof(Blocked_Directory_Format);
|
||||
@@ -2368,10 +2377,14 @@ public static class Strings
|
||||
|
||||
public static string Guard_SuspiciousUnsigned => ResourceManager.GetString(nameof(Guard_SuspiciousUnsigned), Culture) ?? nameof(Guard_SuspiciousUnsigned);
|
||||
|
||||
public static string Guard_TargetAppContainer => ResourceManager.GetString(nameof(Guard_TargetAppContainer), Culture) ?? nameof(Guard_TargetAppContainer);
|
||||
|
||||
public static string Guard_TargetIsVulkanLayered => ResourceManager.GetString(nameof(Guard_TargetIsVulkanLayered), Culture) ?? nameof(Guard_TargetIsVulkanLayered);
|
||||
|
||||
public static string Guard_TargetIsWow64 => ResourceManager.GetString(nameof(Guard_TargetIsWow64), Culture) ?? nameof(Guard_TargetIsWow64);
|
||||
|
||||
public static string Guard_TargetMitigation => ResourceManager.GetString(nameof(Guard_TargetMitigation), Culture) ?? nameof(Guard_TargetMitigation);
|
||||
|
||||
public static string Guide_Title => ResourceManager.GetString(nameof(Guide_Title), Culture) ?? nameof(Guide_Title);
|
||||
|
||||
public static string Hooking_NotX64_Format => ResourceManager.GetString(nameof(Hooking_NotX64_Format), Culture) ?? nameof(Hooking_NotX64_Format);
|
||||
@@ -2704,6 +2717,8 @@ public static class Strings
|
||||
|
||||
public static string Play_NotInLibrary_Format => ResourceManager.GetString(nameof(Play_NotInLibrary_Format), Culture) ?? nameof(Play_NotInLibrary_Format);
|
||||
|
||||
public static string Play_PackagedGame_Format => ResourceManager.GetString(nameof(Play_PackagedGame_Format), Culture) ?? nameof(Play_PackagedGame_Format);
|
||||
|
||||
public static string Play_RecordingOff_Fallback_Format => ResourceManager.GetString(nameof(Play_RecordingOff_Fallback_Format), Culture) ?? nameof(Play_RecordingOff_Fallback_Format);
|
||||
|
||||
public static string Play_RecordingOff_Format => ResourceManager.GetString(nameof(Play_RecordingOff_Format), Culture) ?? nameof(Play_RecordingOff_Format);
|
||||
@@ -2720,6 +2735,10 @@ public static class Strings
|
||||
|
||||
public static string Play_ToolTip_Store => ResourceManager.GetString(nameof(Play_ToolTip_Store), Culture) ?? nameof(Play_ToolTip_Store);
|
||||
|
||||
public static string Play_Xbox_Format => ResourceManager.GetString(nameof(Play_Xbox_Format), Culture) ?? nameof(Play_Xbox_Format);
|
||||
|
||||
public static string Play_Xbox_NotStarted_Format => ResourceManager.GetString(nameof(Play_Xbox_NotStarted_Format), Culture) ?? nameof(Play_Xbox_NotStarted_Format);
|
||||
|
||||
public static string RemoveGame_Body => ResourceManager.GetString(nameof(RemoveGame_Body), Culture) ?? nameof(RemoveGame_Body);
|
||||
|
||||
public static string RemoveGame_Delete => ResourceManager.GetString(nameof(RemoveGame_Delete), Culture) ?? nameof(RemoveGame_Delete);
|
||||
@@ -3094,6 +3113,8 @@ public static class Strings
|
||||
|
||||
public static string Store_Steam_Format => ResourceManager.GetString(nameof(Store_Steam_Format), Culture) ?? nameof(Store_Steam_Format);
|
||||
|
||||
public static string Store_Xbox_Format => ResourceManager.GetString(nameof(Store_Xbox_Format), Culture) ?? nameof(Store_Xbox_Format);
|
||||
|
||||
public static string Summary_Annotations_Header => ResourceManager.GetString(nameof(Summary_Annotations_Header), Culture) ?? nameof(Summary_Annotations_Header);
|
||||
|
||||
public static string Summary_Crash_Body => ResourceManager.GetString(nameof(Summary_Crash_Body), Culture) ?? nameof(Summary_Crash_Body);
|
||||
|
||||
@@ -294,7 +294,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Import_NothingFound" xml:space="preserve">
|
||||
<value>このマシンの Steam、GOG Galaxy、Epic、itch.io にインストール済みのゲームは見つかりませんでした。</value>
|
||||
<value>このマシンの Steam、GOG Galaxy、Epic、itch.io、Xbox アプリにインストール済みのゲームは見つかりませんでした。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Import_NothingNew" xml:space="preserve">
|
||||
@@ -2310,7 +2310,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Body" xml:space="preserve">
|
||||
<value>FrameLedger は Steam、GOG Galaxy、Epic、itch.io のインストール済みゲームを読み取り、チェックリストから追加できます — 入った後、「ファイル ▸ ライブラリをインポート…」から。取り込んだゲームはどれも、手動で追加したものと同じくフック無効で始まります。</value>
|
||||
<value>FrameLedger は Steam、GOG Galaxy、Epic、itch.io、Xbox アプリのインストール済みゲームを読み取り、チェックリストから追加できます — 入った後、「ファイル ▸ ライブラリをインポート…」から。取り込んだゲームはどれも、手動で追加したものと同じくフック無効で始まります。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Header" xml:space="preserve">
|
||||
@@ -2913,6 +2913,10 @@
|
||||
<value>Epic バージョン {0}</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Store_Xbox_Format" xml:space="preserve">
|
||||
<value>Xbox バージョン {0}</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Details_Header" xml:space="preserve">
|
||||
<value>詳細</value>
|
||||
<comment>review</comment>
|
||||
@@ -3329,6 +3333,14 @@
|
||||
<value>ゲームは Vulkan で描画しており、代わりに Vulkan レイヤーが計測します</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Guard_TargetAppContainer" xml:space="preserve">
|
||||
<value>このゲームはアプリ コンテナー内で実行されています (デスクトップ ゲームではなく Microsoft Store アプリ)。FrameLedger はそこには読み込みません</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Guard_TargetMitigation" xml:space="preserve">
|
||||
<value>Windows がこのゲームを、FrameLedger のコンポーネントが読み込みもフックもできない方法で保護しています</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Guard_SuspiciousUnsigned" xml:space="preserve">
|
||||
<value>アンチチートに似た名前の署名のないモジュールが読み込まれていました</value>
|
||||
<comment>review</comment>
|
||||
@@ -4238,11 +4250,11 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Play_ToolTip_Store" xml:space="preserve">
|
||||
<value>ゲームをインストールしたストア経由でプレイします。Steam または Epic Games Launcher が起動し、GOG GALAXY が実行し、itch アプリは先に確認します。どのストアからもインストールされていないゲームは FrameLedger が起動します。</value>
|
||||
<value>ゲームをインストールしたストア経由でプレイします。Steam または Epic Games Launcher が起動し、GOG GALAXY が実行し、itch アプリは先に確認します。Xbox アプリまたは Microsoft Store のゲームは Windows 経由で起動します。どのストアからもインストールされていないゲームは FrameLedger が起動します。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Play_ToolTip_Direct" xml:space="preserve">
|
||||
<value>プレイ: FrameLedger がゲームを自分で起動します。最初のフレームから記録し、通常の権限で実行します。Steam のゲームは先に Steam へ起動を引き継ぐことがあります。その場合は Steam が起動したゲームを記録します。</value>
|
||||
<value>プレイ: FrameLedger がゲームを自分で起動します。最初のフレームから記録し、通常の権限で実行します。Steam のゲームは先に Steam へ起動を引き継ぐことがあります。その場合は Steam が起動したゲームを記録します。Xbox アプリまたは Microsoft Store のゲームは代わりに常に Windows 経由で起動します。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Play_Started_Steam_Format" xml:space="preserve">
|
||||
@@ -4273,6 +4285,18 @@
|
||||
<value>itch アプリが起動する {0} のコピーを確認します。そちらで確定してください。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Play_Xbox_Format" xml:space="preserve">
|
||||
<value>Windows が {0} をパッケージ経由で起動しています (スタート メニューのタイルと同じ)。Xbox アプリのゲームは常にこの方法で起動します。FrameLedger は表示され次第記録します。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Play_Xbox_NotStarted_Format" xml:space="preserve">
|
||||
<value>Windows は {0} をパッケージ経由で起動できませんでした。Xbox アプリまたはスタート メニューから起動してください。FrameLedger は表示され次第記録します。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Play_PackagedGame_Format" xml:space="preserve">
|
||||
<value>{0} は Xbox アプリまたは Microsoft Store のゲームで、Windows 経由でしか起動できません。Xbox アプリまたはスタート メニューから起動してください。FrameLedger は表示され次第記録します。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Play_Started_Format" xml:space="preserve">
|
||||
<value>FrameLedger が {0} を起動しています。</value>
|
||||
<comment>review</comment>
|
||||
@@ -4318,7 +4342,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_PlayMode_Body" xml:space="preserve">
|
||||
<value>ストア経由: Steam と Epic Games Launcher がゲームを起動し、GOG GALAXY が実行し、itch アプリは先に確認します。どのストアからもインストールされていないゲームは FrameLedger が起動します。直接: FrameLedger がゲームを自分で起動します。最初のフレームから記録し、通常の権限で実行します。一部の Steam ゲームは直接起動すると Steam へ起動を引き継ぎます (その後 Steam が起動したゲームを記録します)。Steam 以外からは起動できないゲームもあるため、それらはストア経由で起動してください。</value>
|
||||
<value>ストア経由: Steam と Epic Games Launcher がゲームを起動し、GOG GALAXY が実行し、itch アプリは先に確認します。どのストアからもインストールされていないゲームは FrameLedger が起動します。直接: FrameLedger がゲームを自分で起動します。最初のフレームから記録し、通常の権限で実行します。一部の Steam ゲームは直接起動すると Steam へ起動を引き継ぎます (その後 Steam が起動したゲームを記録します)。Steam 以外からは起動できないゲームもあるため、それらはストア経由で起動してください。Xbox アプリまたは Microsoft Store のゲームは、どちらのモードでも、スタート メニューのタイルと同じく常に Windows 経由で起動します。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_PlayMode_Store" xml:space="preserve">
|
||||
@@ -4346,7 +4370,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_GameArt_Body" xml:space="preserve">
|
||||
<value>ゲームのページに、そのゲームに選んだ画像、なければ Steam または GOG GALAXY のアプリがこの PC に保存しているカバーとバナーを表示します。何もダウンロードしません。</value>
|
||||
<value>ゲームのページに、そのゲームに選んだ画像、なければ Steam または GOG GALAXY のアプリがこの PC に保存しているカバーとバナー、または Xbox のゲームが自分のフォルダーに同梱しているロゴとスプラッシュ画像を表示します。何もダウンロードしません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_GameArtTint_Label" xml:space="preserve">
|
||||
@@ -4365,6 +4389,10 @@
|
||||
<value>この PC の GOG GALAXY アプリのアートワーク</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Art_Source_Xbox" xml:space="preserve">
|
||||
<value>ゲーム自身のファイルのアートワーク (Xbox アプリ)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Art_Source_Yours" xml:space="preserve">
|
||||
<value>このゲームに選んだ画像</value>
|
||||
<comment>review</comment>
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
<value>Add selected</value>
|
||||
</data>
|
||||
<data name="Import_NothingFound" xml:space="preserve">
|
||||
<value>No installed games were found in Steam, GOG Galaxy, Epic or itch.io on this machine.</value>
|
||||
<value>No installed games were found in Steam, GOG Galaxy, Epic, itch.io or the Xbox app on this machine.</value>
|
||||
</data>
|
||||
<data name="Import_NothingNew" xml:space="preserve">
|
||||
<value>No new games: every game your stores have installed is already in the library.</value>
|
||||
@@ -1738,7 +1738,7 @@
|
||||
<value>Finish</value>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Body" xml:space="preserve">
|
||||
<value>FrameLedger can read what Steam, GOG Galaxy, Epic and itch.io have installed and add them from a checklist — File ▸ Import library…, once you are in. Every imported game starts with hooking off, exactly like one you add by hand.</value>
|
||||
<value>FrameLedger can read what Steam, GOG Galaxy, Epic, itch.io and the Xbox app have installed and add them from a checklist — File ▸ Import library…, once you are in. Every imported game starts with hooking off, exactly like one you add by hand.</value>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Header" xml:space="preserve">
|
||||
<value>Your library</value>
|
||||
@@ -2195,6 +2195,9 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="Store_Epic_Format" xml:space="preserve">
|
||||
<value>Epic version {0}</value>
|
||||
</data>
|
||||
<data name="Store_Xbox_Format" xml:space="preserve">
|
||||
<value>Xbox version {0}</value>
|
||||
</data>
|
||||
<data name="GameDetail_Details_Header" xml:space="preserve">
|
||||
<value>Details</value>
|
||||
</data>
|
||||
@@ -2507,6 +2510,12 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="Guard_TargetIsVulkanLayered" xml:space="preserve">
|
||||
<value>the game renders with Vulkan, which the Vulkan layer measures instead</value>
|
||||
</data>
|
||||
<data name="Guard_TargetAppContainer" xml:space="preserve">
|
||||
<value>the game runs in an app container (a Microsoft Store app, not a desktop game), which FrameLedger does not load into</value>
|
||||
</data>
|
||||
<data name="Guard_TargetMitigation" xml:space="preserve">
|
||||
<value>Windows protects the game in a way FrameLedger's component can neither load into nor hook</value>
|
||||
</data>
|
||||
<data name="Guard_SuspiciousUnsigned" xml:space="preserve">
|
||||
<value>an unsigned module with an anti-cheat-like name was loaded</value>
|
||||
</data>
|
||||
@@ -3189,10 +3198,10 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<value>Play</value>
|
||||
</data>
|
||||
<data name="Play_ToolTip_Store" xml:space="preserve">
|
||||
<value>Play through the store that installed the game: Steam or the Epic Games Launcher starts it, GOG GALAXY runs it, the itch app asks first. A game no store installed is started by FrameLedger.</value>
|
||||
<value>Play through the store that installed the game: Steam or the Epic Games Launcher starts it, GOG GALAXY runs it, the itch app asks first; a game from the Xbox app or the Microsoft Store starts through Windows. A game no store installed is started by FrameLedger.</value>
|
||||
</data>
|
||||
<data name="Play_ToolTip_Direct" xml:space="preserve">
|
||||
<value>Play: FrameLedger starts the game itself, recorded from its first frame, with your standard rights. A Steam game may hand itself to Steam first; the game Steam then starts is recorded.</value>
|
||||
<value>Play: FrameLedger starts the game itself, recorded from its first frame, with your standard rights. A Steam game may hand itself to Steam first; the game Steam then starts is recorded. A game from the Xbox app or the Microsoft Store always starts through Windows instead.</value>
|
||||
</data>
|
||||
<data name="Play_Started_Steam_Format" xml:space="preserve">
|
||||
<value>FrameLedger is starting {0}. A Steam game may hand itself to Steam first; the game Steam then starts is recorded.</value>
|
||||
@@ -3215,6 +3224,15 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="Play_Itch_Format" xml:space="preserve">
|
||||
<value>The itch app asks which copy of {0} to launch — confirm there.</value>
|
||||
</data>
|
||||
<data name="Play_Xbox_Format" xml:space="preserve">
|
||||
<value>Windows is starting {0} through its package, as its Start-menu tile does — a game from the Xbox app always starts this way. FrameLedger records it once it appears.</value>
|
||||
</data>
|
||||
<data name="Play_Xbox_NotStarted_Format" xml:space="preserve">
|
||||
<value>Windows could not start {0} through its package. Start it from the Xbox app or the Start menu; FrameLedger records it once it appears.</value>
|
||||
</data>
|
||||
<data name="Play_PackagedGame_Format" xml:space="preserve">
|
||||
<value>{0} is a game from the Xbox app or the Microsoft Store, which starts only through Windows. Start it from the Xbox app or the Start menu; FrameLedger records it once it appears.</value>
|
||||
</data>
|
||||
<data name="Play_Started_Format" xml:space="preserve">
|
||||
<value>FrameLedger is starting {0}.</value>
|
||||
</data>
|
||||
@@ -3249,7 +3267,7 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<value>Play button</value>
|
||||
</data>
|
||||
<data name="Settings_PlayMode_Body" xml:space="preserve">
|
||||
<value>Through the store: Steam and the Epic Games Launcher start the game, GOG GALAXY runs it, the itch app asks first; a game no store installed is started by FrameLedger. Directly: FrameLedger starts the game itself — recorded from its first frame, with your standard rights. Some Steam games hand themselves to Steam when started directly — the game Steam then starts is recorded — and a few will not start outside Steam at all: start those through the store.</value>
|
||||
<value>Through the store: Steam and the Epic Games Launcher start the game, GOG GALAXY runs it, the itch app asks first; a game no store installed is started by FrameLedger. Directly: FrameLedger starts the game itself — recorded from its first frame, with your standard rights. Some Steam games hand themselves to Steam when started directly — the game Steam then starts is recorded — and a few will not start outside Steam at all: start those through the store. A game from the Xbox app or the Microsoft Store always starts through Windows, as its Start-menu tile does, in either mode.</value>
|
||||
</data>
|
||||
<data name="Settings_PlayMode_Store" xml:space="preserve">
|
||||
<value>Through the store</value>
|
||||
@@ -3270,7 +3288,7 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<value>Show game artwork</value>
|
||||
</data>
|
||||
<data name="Settings_GameArt_Body" xml:space="preserve">
|
||||
<value>A game's page shows the image you chose for it, or else the cover and banner the Steam or GOG GALAXY app keeps on this PC. Nothing is downloaded.</value>
|
||||
<value>A game's page shows the image you chose for it, or else the cover and banner the Steam or GOG GALAXY app keeps on this PC, or the logo and splash image an Xbox game ships in its own folder. Nothing is downloaded.</value>
|
||||
</data>
|
||||
<data name="Settings_GameArtTint_Label" xml:space="preserve">
|
||||
<value>Colour the game page from its artwork</value>
|
||||
@@ -3284,6 +3302,9 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="Art_Source_Gog" xml:space="preserve">
|
||||
<value>Artwork from the GOG GALAXY app on this PC</value>
|
||||
</data>
|
||||
<data name="Art_Source_Xbox" xml:space="preserve">
|
||||
<value>Artwork from the game's own files (Xbox app)</value>
|
||||
</data>
|
||||
<data name="Art_Source_Yours" xml:space="preserve">
|
||||
<value>The image you chose for this game</value>
|
||||
</data>
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
<value>Thêm mục đã chọn</value>
|
||||
</data>
|
||||
<data name="Import_NothingFound" xml:space="preserve">
|
||||
<value>Không tìm thấy game nào đã cài trong Steam, GOG Galaxy, Epic hay itch.io trên máy này.</value>
|
||||
<value>Không tìm thấy game nào đã cài trong Steam, GOG Galaxy, Epic, itch.io hay Xbox app trên máy này.</value>
|
||||
</data>
|
||||
<data name="Import_NothingNew" xml:space="preserve">
|
||||
<value>Không có game mới: mọi game các store đã cài đều đã có trong thư viện.</value>
|
||||
@@ -1733,7 +1733,7 @@
|
||||
<value>Hoàn tất</value>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Body" xml:space="preserve">
|
||||
<value>FrameLedger có thể đọc những gì Steam, GOG Galaxy, Epic và itch.io đã cài và thêm chúng từ một danh sách chọn — Tệp ▸ Nhập thư viện…, khi bạn đã vào trong. Mọi game nhập vào đều bắt đầu với hooking tắt, đúng như game bạn thêm thủ công.</value>
|
||||
<value>FrameLedger có thể đọc những gì Steam, GOG Galaxy, Epic, itch.io và Xbox app đã cài và thêm chúng từ một danh sách chọn — Tệp ▸ Nhập thư viện…, khi bạn đã vào trong. Mọi game nhập vào đều bắt đầu với hooking tắt, đúng như game bạn thêm thủ công.</value>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Header" xml:space="preserve">
|
||||
<value>Thư viện của bạn</value>
|
||||
@@ -2190,6 +2190,9 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<data name="Store_Epic_Format" xml:space="preserve">
|
||||
<value>Epic phiên bản {0}</value>
|
||||
</data>
|
||||
<data name="Store_Xbox_Format" xml:space="preserve">
|
||||
<value>Xbox phiên bản {0}</value>
|
||||
</data>
|
||||
<data name="GameDetail_Details_Header" xml:space="preserve">
|
||||
<value>Chi tiết</value>
|
||||
</data>
|
||||
@@ -2502,6 +2505,12 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<data name="Guard_TargetIsVulkanLayered" xml:space="preserve">
|
||||
<value>game kết xuất bằng Vulkan, thứ mà Vulkan layer đo thay</value>
|
||||
</data>
|
||||
<data name="Guard_TargetAppContainer" xml:space="preserve">
|
||||
<value>game này chạy trong app container (một app Microsoft Store, không phải game desktop), FrameLedger không nạp vào đó</value>
|
||||
</data>
|
||||
<data name="Guard_TargetMitigation" xml:space="preserve">
|
||||
<value>Windows bảo vệ game này theo cách mà thành phần của FrameLedger không thể nạp hay hook</value>
|
||||
</data>
|
||||
<data name="Guard_SuspiciousUnsigned" xml:space="preserve">
|
||||
<value>một mô-đun không ký số có tên giống anti-cheat đã được nạp</value>
|
||||
</data>
|
||||
@@ -3184,10 +3193,10 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<value>Chơi</value>
|
||||
</data>
|
||||
<data name="Play_ToolTip_Store" xml:space="preserve">
|
||||
<value>Chơi qua store đã cài game: Steam hoặc Epic Games Launcher sẽ chạy game, GOG GALAXY chạy game, app itch hỏi trước. Game không do store nào cài thì FrameLedger tự chạy.</value>
|
||||
<value>Chơi qua store đã cài game: Steam hoặc Epic Games Launcher sẽ chạy game, GOG GALAXY chạy game, app itch hỏi trước; game từ Xbox app hoặc Microsoft Store chạy qua Windows. Game không do store nào cài thì FrameLedger tự chạy.</value>
|
||||
</data>
|
||||
<data name="Play_ToolTip_Direct" xml:space="preserve">
|
||||
<value>Chơi: FrameLedger tự chạy game, ghi lại từ khung hình đầu tiên, với quyền thường của bạn. Game Steam có thể tự chuyển sang Steam trước; game do Steam chạy sau đó vẫn được ghi lại.</value>
|
||||
<value>Chơi: FrameLedger tự chạy game, ghi lại từ khung hình đầu tiên, với quyền thường của bạn. Game Steam có thể tự chuyển sang Steam trước; game do Steam chạy sau đó vẫn được ghi lại. Game từ Xbox app hoặc Microsoft Store luôn chạy qua Windows thay vào đó.</value>
|
||||
</data>
|
||||
<data name="Play_Started_Steam_Format" xml:space="preserve">
|
||||
<value>FrameLedger đang chạy {0}. Game Steam có thể tự chuyển sang Steam trước; game do Steam chạy sau đó vẫn được ghi lại.</value>
|
||||
@@ -3210,6 +3219,15 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<data name="Play_Itch_Format" xml:space="preserve">
|
||||
<value>App itch sẽ hỏi chạy bản nào của {0} — hãy xác nhận ở đó.</value>
|
||||
</data>
|
||||
<data name="Play_Xbox_Format" xml:space="preserve">
|
||||
<value>Windows đang chạy {0} qua gói của nó, như khi bấm ô của nó trong Start menu — game từ Xbox app luôn chạy theo cách này. FrameLedger ghi lại khi game xuất hiện.</value>
|
||||
</data>
|
||||
<data name="Play_Xbox_NotStarted_Format" xml:space="preserve">
|
||||
<value>Windows không chạy được {0} qua gói của nó. Hãy chạy từ Xbox app hoặc Start menu; FrameLedger ghi lại khi game xuất hiện.</value>
|
||||
</data>
|
||||
<data name="Play_PackagedGame_Format" xml:space="preserve">
|
||||
<value>{0} là game từ Xbox app hoặc Microsoft Store, chỉ chạy được qua Windows. Hãy chạy từ Xbox app hoặc Start menu; FrameLedger ghi lại khi game xuất hiện.</value>
|
||||
</data>
|
||||
<data name="Play_Started_Format" xml:space="preserve">
|
||||
<value>FrameLedger đang chạy {0}.</value>
|
||||
</data>
|
||||
@@ -3244,7 +3262,7 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<value>Nút Chơi</value>
|
||||
</data>
|
||||
<data name="Settings_PlayMode_Body" xml:space="preserve">
|
||||
<value>Qua store: Steam và Epic Games Launcher chạy game, GOG GALAXY chạy game, app itch hỏi trước; game không do store nào cài thì FrameLedger tự chạy. Chạy trực tiếp: FrameLedger tự chạy game — ghi lại từ khung hình đầu tiên, với quyền thường của bạn. Một số game Steam tự chuyển sang Steam khi được chạy trực tiếp — game do Steam chạy sau đó vẫn được ghi lại — và vài game không chạy được ngoài Steam: hãy chạy chúng qua store.</value>
|
||||
<value>Qua store: Steam và Epic Games Launcher chạy game, GOG GALAXY chạy game, app itch hỏi trước; game không do store nào cài thì FrameLedger tự chạy. Chạy trực tiếp: FrameLedger tự chạy game — ghi lại từ khung hình đầu tiên, với quyền thường của bạn. Một số game Steam tự chuyển sang Steam khi được chạy trực tiếp — game do Steam chạy sau đó vẫn được ghi lại — và vài game không chạy được ngoài Steam: hãy chạy chúng qua store. Game từ Xbox app hoặc Microsoft Store luôn chạy qua Windows, như khi bấm ô của nó trong Start menu, ở cả hai chế độ.</value>
|
||||
</data>
|
||||
<data name="Settings_PlayMode_Store" xml:space="preserve">
|
||||
<value>Qua store</value>
|
||||
@@ -3265,7 +3283,7 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<value>Hiện ảnh của game</value>
|
||||
</data>
|
||||
<data name="Settings_GameArt_Body" xml:space="preserve">
|
||||
<value>Trang của game hiện ảnh bạn đã chọn cho nó, nếu không có thì ảnh bìa và banner mà ứng dụng Steam hoặc GOG GALAXY lưu sẵn trên máy này. Không tải gì về.</value>
|
||||
<value>Trang của game hiện ảnh bạn đã chọn cho nó, nếu không có thì ảnh bìa và banner mà ứng dụng Steam hoặc GOG GALAXY lưu sẵn trên máy này, hoặc logo và ảnh splash mà game Xbox kèm sẵn trong thư mục của nó. Không tải gì về.</value>
|
||||
</data>
|
||||
<data name="Settings_GameArtTint_Label" xml:space="preserve">
|
||||
<value>Tô màu trang game theo ảnh</value>
|
||||
@@ -3279,6 +3297,9 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<data name="Art_Source_Gog" xml:space="preserve">
|
||||
<value>Ảnh từ ứng dụng GOG GALAXY trên máy này</value>
|
||||
</data>
|
||||
<data name="Art_Source_Xbox" xml:space="preserve">
|
||||
<value>Ảnh từ chính các tệp của game (Xbox app)</value>
|
||||
</data>
|
||||
<data name="Art_Source_Yours" xml:space="preserve">
|
||||
<value>Ảnh bạn đã chọn cho game này</value>
|
||||
</data>
|
||||
|
||||
@@ -103,6 +103,10 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
[ObservableProperty]
|
||||
private bool _artCoverIsLandscape;
|
||||
|
||||
/// <summary>The cover slot holds an Xbox game's square logo (beta.33): drawn square, never cropped to a portrait.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _artCoverIsSquare;
|
||||
|
||||
/// <summary>The store's wide banner, above the header band; null without one.</summary>
|
||||
[ObservableProperty]
|
||||
private ImageSource? _artHero;
|
||||
@@ -548,6 +552,7 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
{
|
||||
ArtCover = view?.Cover;
|
||||
ArtCoverIsLandscape = view?.CoverIsLandscape ?? false;
|
||||
ArtCoverIsSquare = view?.CoverIsSquare ?? false;
|
||||
ArtHero = view?.Hero;
|
||||
ArtTint = view?.Tint;
|
||||
ArtSource = view?.Source;
|
||||
@@ -1168,7 +1173,7 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
GameRow row = detail.Row;
|
||||
Name = row.Name;
|
||||
// A store's version is said as one ("Steam build 20374416", beta.8), and then names the store itself.
|
||||
bool storeVersion = EditGameViewModel.IsDetectedField(row.FieldProvenanceJson, "game_version") && row.Platform is "steam" or "gog" or "epic";
|
||||
bool storeVersion = EditGameViewModel.IsDetectedField(row.FieldProvenanceJson, "game_version") && row.Platform is "steam" or "gog" or "epic" or "xbox";
|
||||
string?[] subtitle = storeVersion
|
||||
? [row.Publisher, Formats.StoreVersion(row.Platform, row.GameVersion, detected: true) ?? Formats.Platform(row.Platform), EngineText(row)]
|
||||
: [row.Publisher, row.GameVersion, Formats.Platform(row.Platform), EngineText(row)];
|
||||
|
||||
@@ -5,13 +5,14 @@ namespace FrameLedger.Application.Art;
|
||||
|
||||
/// <summary>
|
||||
/// The artwork a store's own app keeps on this PC for one game (beta.23, owner decision D60): the full paths of its portrait
|
||||
/// cover, its wide banner and its landscape header, each null when that app keeps none. FrameLedger downloads none of it and
|
||||
/// copies none of it; it shows these files from where the store's app put them.
|
||||
/// cover, its wide banner and its landscape header, each null when that app keeps none — and since beta.33 a square logo,
|
||||
/// what an Xbox game's package ships instead of a portrait cover (its <c>Square480x480Logo</c>). FrameLedger downloads
|
||||
/// none of it and copies none of it; it shows these files from where the store's app or the game put them.
|
||||
/// </summary>
|
||||
public sealed record GameArtFiles(string? Cover, string? Hero, string? Header)
|
||||
public sealed record GameArtFiles(string? Cover, string? Hero, string? Header, string? Square = null)
|
||||
{
|
||||
/// <summary>No artwork: the store keeps none, is not installed, or the id is not one of its own.</summary>
|
||||
public static GameArtFiles None { get; } = new(null, null, null);
|
||||
|
||||
public bool IsEmpty => Cover is null && Hero is null && Header is null;
|
||||
public bool IsEmpty => Cover is null && Hero is null && Header is null && Square is null;
|
||||
}
|
||||
@@ -1,18 +1,25 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FrameLedger.Application.Import;
|
||||
|
||||
namespace FrameLedger.Application.Art;
|
||||
|
||||
/// <summary>
|
||||
/// One store app's own artwork folder on this PC (beta.23, owner decision D60): Steam's <c>appcache\librarycache</c>, GOG
|
||||
/// GALAXY's <c>webcache</c>. Read-only. A store that is not installed, an id that is not of the store's own shape, or a
|
||||
/// folder with nothing in it answers <see cref="GameArtFiles.None"/>, never an error. Which store installed a game is
|
||||
/// asked of the stores' own records, as Play asks (<c>Play.StoreRecords.Owning</c>) — never of the row's platform alone.
|
||||
/// One store's artwork for a game on this PC (beta.23, owner decision D60): Steam's <c>appcache\librarycache</c>, GOG
|
||||
/// GALAXY's <c>webcache</c>, and since beta.33 the logo and splash image an Xbox game ships in its own package folder.
|
||||
/// Read-only. A store that is not installed, an id that is not of the store's own shape, or a folder with nothing in it
|
||||
/// answers <see cref="GameArtFiles.None"/>, never an error. Which store installed a game is asked of the stores' own
|
||||
/// records, as Play asks (<c>Play.StoreRecords.Owning</c>) — never of the row's platform alone.
|
||||
/// </summary>
|
||||
public interface IStoreArtCache
|
||||
{
|
||||
/// <summary><c>steam</c> · <c>gog</c> — <c>games.platform</c>'s vocabulary.</summary>
|
||||
/// <summary><c>steam</c> · <c>gog</c> · <c>xbox</c> — <c>games.platform</c>'s vocabulary.</summary>
|
||||
string Platform { get; }
|
||||
|
||||
GameArtFiles Find(string storeId);
|
||||
/// <summary>
|
||||
/// The artwork for <paramref name="record"/>, the owning store's record of the game: the whole record since beta.33,
|
||||
/// because an Xbox game's pictures are in its install folder, not keyed by its id.
|
||||
/// </summary>
|
||||
GameArtFiles Find(StoreGame record);
|
||||
}
|
||||
@@ -6,12 +6,13 @@ namespace FrameLedger.Application.Import;
|
||||
/// <summary>
|
||||
/// One store's installed library, read from its local files (FR-1.2, <c>05_DETECTION</c> §Platform signatures &
|
||||
/// metadata: Steam's <c>libraryfolders.vdf</c> + <c>appmanifest_*.acf</c>, GOG's registry keys, Epic's
|
||||
/// <c>Manifests\*.item</c>, itch's receipts). A store that is not installed answers an empty list, never an error;
|
||||
/// a file that will not parse costs that one entry.
|
||||
/// <c>Manifests\*.item</c>, itch's receipts, and since beta.33 the Xbox app's games folders — each drive's
|
||||
/// <c>.GamingRoot</c>, each game's <c>MicrosoftGame.config</c> and <c>appxmanifest.xml</c>). A store that is not
|
||||
/// installed answers an empty list, never an error; a file that will not parse costs that one entry.
|
||||
/// </summary>
|
||||
public interface IStoreLibrarySource
|
||||
{
|
||||
/// <summary><c>steam</c> · <c>gog</c> · <c>epic</c> · <c>itch</c> — <c>games.platform</c>'s vocabulary.</summary>
|
||||
/// <summary><c>steam</c> · <c>gog</c> · <c>epic</c> · <c>itch</c> · <c>xbox</c> — <c>games.platform</c>'s vocabulary.</summary>
|
||||
string Platform { get; }
|
||||
|
||||
ValueTask<IReadOnlyList<StoreGame>> ListAsync(CancellationToken ct = default);
|
||||
|
||||
@@ -11,7 +11,9 @@ namespace FrameLedger.Application.Import;
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <c>LaunchKey</c> (beta.21, Play, D59): what the store's own launch link names where that is more than the store id —
|
||||
/// the Epic Games Launcher's <c>CatalogNamespace:CatalogItemId:AppName</c>; null for every other store.
|
||||
/// the Epic Games Launcher's <c>CatalogNamespace:CatalogItemId:AppName</c>, and since beta.33 an Xbox game's
|
||||
/// AppUserModelID <c><package family name>!<application id></c>, which Windows activates (D80); null for every
|
||||
/// other store.
|
||||
/// </remarks>
|
||||
public sealed record StoreGame(string Platform, string StoreId, string Name, string InstallDirectory, string? ExePath, string? Version,
|
||||
string? LaunchKey = null);
|
||||
@@ -13,7 +13,7 @@ public sealed record GameMetadata
|
||||
{
|
||||
public required string Name { get; init; }
|
||||
|
||||
/// <summary><c>steam|gog|epic|itch|none</c>.</summary>
|
||||
/// <summary><c>steam|gog|epic|itch|xbox|none</c> (<c>xbox</c> since beta.33: the Xbox app and the Microsoft Store, D79).</summary>
|
||||
public string Platform { get; init; } = "none";
|
||||
|
||||
public string? StoreId { get; init; }
|
||||
@@ -30,7 +30,7 @@ public sealed record GameMetadata
|
||||
|
||||
public string? Notes { get; init; }
|
||||
|
||||
public static readonly IReadOnlyList<string> Platforms = ["steam", "gog", "epic", "itch", "none"];
|
||||
public static readonly IReadOnlyList<string> Platforms = ["steam", "gog", "epic", "itch", "xbox", "none"];
|
||||
|
||||
public static GameMetadata Of(GameRow row)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,9 @@ namespace FrameLedger.Application.Play;
|
||||
/// the game shortcut GALAXY made there; GALAXY starts the game.</item>
|
||||
/// <item><b>itch</b>: <c>itch://install?game_id=<id>&launch</c>, which the itch app (26.22.0, read from its own code)
|
||||
/// answers by asking which installed copy to launch — the user confirms there.</item>
|
||||
/// <item><b>Xbox</b> (beta.33, D80): <c>explorer.exe shell:AppsFolder\<AUMID></c> — Windows activates the game's
|
||||
/// package as its Start-menu tile does, the command measured on FINAL FANTASY (<c>spike-notes</c> §25: GameLaunchHelper's
|
||||
/// parent was the user's shell, the game in its package). Started by its path, a GDK game is never that.</item>
|
||||
/// </list>
|
||||
/// Every id is checked against what that store's ids look like before it is put in a link the shell will open.
|
||||
/// </summary>
|
||||
@@ -40,10 +43,38 @@ public static class StoreLaunches
|
||||
Path.GetDirectoryName(galaxyClientPath)),
|
||||
"itch" when IsDigits(record.StoreId) =>
|
||||
new StoreLaunch("itch", StoreLaunchKind.OpenLink, "itch://install?game_id=" + record.StoreId + "&launch"),
|
||||
"xbox" when record.LaunchKey is { } aumid && IsAumid(aumid) && aumid.StartsWith(record.StoreId + "!", StringComparison.Ordinal) =>
|
||||
new StoreLaunch("xbox", StoreLaunchKind.RunProgram, ExplorerPath, "shell:AppsFolder\\" + aumid),
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>The user's shell, which activates a package for an elevated caller too (it runs unelevated itself).</summary>
|
||||
public static string ExplorerPath => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "explorer.exe");
|
||||
|
||||
/// <summary>
|
||||
/// An AppUserModelID of the shape Windows gives a packaged app: <c><Name>_<13-character publisher id>!<Application
|
||||
/// Id></c> — the name 3–50 letters, digits, '.' or '-'; the id 1–64 letters, digits or '.', starting with a letter. Nothing
|
||||
/// that could be read as another argument or path.
|
||||
/// </summary>
|
||||
public static bool IsAumid(string aumid)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(aumid);
|
||||
int bang = aumid.IndexOf('!', StringComparison.Ordinal);
|
||||
int underscore = bang < 0 ? -1 : aumid.AsSpan(0, bang).LastIndexOf('_');
|
||||
if (bang < 0 || underscore < 0 || bang - underscore - 1 != 13)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
string name = aumid[..underscore];
|
||||
string publisherId = aumid[(underscore + 1)..bang];
|
||||
string appId = aumid[(bang + 1)..];
|
||||
return name.Length is >= 3 and <= 50 && name.All(static c => char.IsAsciiLetterOrDigit(c) || c is '.' or '-')
|
||||
&& publisherId.All(static c => char.IsAsciiDigit(c) || char.IsAsciiLetterLower(c))
|
||||
&& appId.Length is >= 1 and <= 64 && char.IsAsciiLetter(appId[0]) && appId.All(static c => char.IsAsciiLetterOrDigit(c) || c == '.');
|
||||
}
|
||||
|
||||
private static StoreLaunch? Epic(StoreGame record)
|
||||
{
|
||||
string? key = record.LaunchKey?.Split(':') is [var ns, var item, var app]
|
||||
|
||||
@@ -282,6 +282,13 @@ public sealed class CaptureOrchestrator
|
||||
}
|
||||
|
||||
string path = game.Fingerprint.ExePath;
|
||||
if (_options.IsPackaged?.Invoke(path) == true)
|
||||
{
|
||||
// beta.33 (D80): a GDK game is started by Windows through its package, never by its path (spike-notes §25).
|
||||
_log($"launch: {game.Name} is a game the Xbox app or the Microsoft Store installed; it starts through Windows, not by its path");
|
||||
return LaunchResult.Of(LaunchOutcome.PackagedGame);
|
||||
}
|
||||
|
||||
lock (_table)
|
||||
{
|
||||
if (_running.TryGetValue(path, out Running? current) && !current.Task.IsCompleted)
|
||||
|
||||
@@ -23,4 +23,11 @@ public enum LaunchOutcome
|
||||
|
||||
/// <summary>The entry's recording is switched off (schema 0009, 2026-09-23): FrameLedger does not start what it will not record.</summary>
|
||||
RecordingOff,
|
||||
|
||||
/// <summary>
|
||||
/// The entry's executable is in a game the Xbox app or the Microsoft Store installed (beta.33, D80): started by its path it
|
||||
/// is either handed back to its package by Windows or runs outside it (<c>spike-notes</c> §25), so FrameLedger never starts
|
||||
/// it that way; Windows starts it, from Play or its Start-menu tile, and the watcher records it.
|
||||
/// </summary>
|
||||
PackagedGame,
|
||||
}
|
||||
@@ -11,4 +11,11 @@ public sealed record OrchestratorOptions
|
||||
|
||||
/// <summary>The watcher's cadence; <c>01_ARCHITECTURE</c> §Lifecycle says 1 Hz and ~0 % CPU.</summary>
|
||||
public TimeSpan PollInterval { get; init; } = TimeSpan.FromSeconds(1);
|
||||
|
||||
/// <summary>
|
||||
/// True for an executable whose install root is a GDK package root (beta.33, D80): <c>LaunchGame</c> answers
|
||||
/// <see cref="LaunchOutcome.PackagedGame"/> for it rather than start it by its path — started that way it is never the game
|
||||
/// in its package (<c>spike-notes</c> §25). Null: nothing is treated as packaged (tests, the console's election).
|
||||
/// </summary>
|
||||
public Func<string, bool>? IsPackaged { get; init; }
|
||||
}
|
||||
@@ -225,4 +225,26 @@ public enum AntiCheatRefusalReason
|
||||
/// one (<c>19_SAFETY</c> §The user-mode exception).
|
||||
/// </remarks>
|
||||
AllowedUnderUserModeException = 28,
|
||||
|
||||
/// <summary>
|
||||
/// The game runs in an AppContainer — a Microsoft Store app of the UWP kind, not a desktop game — which the Overlay
|
||||
/// cannot load into (beta.33, owner decision D78). Read from the game's own token just before the injection.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Not a finding: nothing is written to the game, and the session is Tier 2 with this reason. The Overlay's shared
|
||||
/// memory, its <c>Local\</c> names and the rules it reads live where an AppContainer cannot reach. A GDK game from the
|
||||
/// Xbox app is full trust and is not this (<c>spike-notes</c> §25).
|
||||
/// </remarks>
|
||||
TargetAppContainer = 29,
|
||||
|
||||
/// <summary>
|
||||
/// Windows runs the game under a code-protection policy the Overlay cannot live under (beta.33, D78): images signed
|
||||
/// by Microsoft or the Store only, no dynamic code, a strict or non-CET-blocking user shadow stack, or strict Control
|
||||
/// Flow Guard. Read from the game's own mitigation policies just before the injection; the signal names the policy.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Not a finding, and Tier 2 like <see cref="TargetIsWow64"/>. Each of these ended before as a failed injection, an
|
||||
/// Overlay that installed no hooks, or a risk of ending the game that no fault policy can catch.
|
||||
/// </remarks>
|
||||
TargetMitigation = 30,
|
||||
}
|
||||
@@ -35,4 +35,10 @@ public enum DetectionSignalType
|
||||
|
||||
/// <summary>A field in a store manifest. Not collected this phase.</summary>
|
||||
ManifestField,
|
||||
|
||||
/// <summary>
|
||||
/// A file of exactly this name directly in the install root (beta.33, the <c>xbox</c> platform): answered from the
|
||||
/// root's own listing, so a deep walk that ran short cannot make its miss Unknown — a root that could not be listed can.
|
||||
/// </summary>
|
||||
RootFile,
|
||||
}
|
||||
@@ -63,6 +63,13 @@ public sealed record GameFileSnapshot
|
||||
/// </remarks>
|
||||
public required bool FileListingComplete { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The names of the files directly in <see cref="GameDirectory"/>, from a listing of that one folder (beta.33); null
|
||||
/// when it could not be listed. What a <see cref="DetectionSignalType.RootFile"/> signal is answered from: a complete
|
||||
/// listing of the root decides its miss as surely as its hit, whatever the deep walk did.
|
||||
/// </summary>
|
||||
public IReadOnlySet<string>? RootFiles { get; init; }
|
||||
|
||||
/// <summary>PE <c>CompanyName</c>, or null if it could not be read.</summary>
|
||||
public string? PeCompanyName { get; init; }
|
||||
|
||||
|
||||
@@ -62,6 +62,11 @@ public sealed class RuleEvaluator
|
||||
Found(snapshot.RelativeDirectories, needle, snapshot.FileListingComplete),
|
||||
DetectionSignalType.PathContains => Outcome(
|
||||
snapshot.GameDirectory.Contains(needle.Replace('\\', '/'), StringComparison.OrdinalIgnoreCase)),
|
||||
|
||||
// beta.33: one folder's own listing, so its miss is as certain as its hit — unless the folder was not listed.
|
||||
DetectionSignalType.RootFile => snapshot.RootFiles is { } root
|
||||
? Outcome(root.Contains(needle))
|
||||
: SignalOutcome.Unknown,
|
||||
DetectionSignalType.PeCompanyContains => Contains(snapshot.PeCompanyName, needle),
|
||||
DetectionSignalType.PeProductContains => Contains(snapshot.PeProductName, needle),
|
||||
DetectionSignalType.StringsContains => Outcome(snapshot.MatchedStringNeedles.Contains(signal.Value)),
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FrameLedger.Application.Art;
|
||||
using FrameLedger.Application.Import;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Art;
|
||||
|
||||
@@ -18,8 +19,10 @@ public sealed class GogArtCache(string? webcacheRoot = null) : IStoreArtCache
|
||||
|
||||
public string Platform => "gog";
|
||||
|
||||
public GameArtFiles Find(string storeId)
|
||||
public GameArtFiles Find(StoreGame record)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(record);
|
||||
string storeId = record.StoreId;
|
||||
if (!SteamArtCache.IsNumericId(storeId))
|
||||
{
|
||||
return GameArtFiles.None;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FrameLedger.Application.Art;
|
||||
using FrameLedger.Application.Import;
|
||||
using FrameLedger.Infrastructure.Import;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Art;
|
||||
@@ -24,8 +25,10 @@ public sealed class SteamArtCache(string? steamRoot = null) : IStoreArtCache
|
||||
|
||||
public string Platform => "steam";
|
||||
|
||||
public GameArtFiles Find(string storeId)
|
||||
public GameArtFiles Find(StoreGame record)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(record);
|
||||
string storeId = record.StoreId;
|
||||
if (!IsNumericId(storeId) || (steamRoot ?? SteamLibrarySource.InstalledRoot()) is not { } root)
|
||||
{
|
||||
return GameArtFiles.None;
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FrameLedger.Application.Art;
|
||||
using FrameLedger.Application.Import;
|
||||
using FrameLedger.Infrastructure.Import;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Art;
|
||||
|
||||
/// <summary>
|
||||
/// The pictures an Xbox game ships in its own package folder (beta.33, D60 "a game's artwork is what is already on the
|
||||
/// PC"): <c>MicrosoftGame.config</c>'s <c>ShellVisuals</c> names them — <c>Square480x480Logo</c> (480×480 on the owner's 11
|
||||
/// games, else <c>Square150x150Logo</c>) as a square cover, <c>SplashScreenImage</c> (1920×1080) as the banner and the
|
||||
/// landscape header (<c>spike-notes</c> §25). Read from the record's install folder, which is the package root.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A name that points outside the package root is ignored, whatever the file says. Where the plain file is absent, the
|
||||
/// MSIX resource variants beside it (<c>Logo.scale-200.png</c>) are tried, the largest first; the 11 measured all ship the
|
||||
/// plain names.
|
||||
/// </remarks>
|
||||
public sealed class XboxArtCache : IStoreArtCache
|
||||
{
|
||||
public string Platform => "xbox";
|
||||
|
||||
public GameArtFiles Find(StoreGame record)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(record);
|
||||
try
|
||||
{
|
||||
if (GdkPackageFiles.Read(record.InstallDirectory) is not { } package)
|
||||
{
|
||||
return GameArtFiles.None;
|
||||
}
|
||||
|
||||
string? square = Image(record.InstallDirectory, package.Square480Logo) ?? Image(record.InstallDirectory, package.Square150Logo);
|
||||
string? splash = Image(record.InstallDirectory, package.SplashScreen);
|
||||
return new GameArtFiles(Cover: null, Hero: splash, Header: splash, Square: square);
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or System.Security.SecurityException)
|
||||
{
|
||||
return GameArtFiles.None;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The image <paramref name="relative"/> names inside <paramref name="root"/>, or null when there is none there.</summary>
|
||||
public static string? Image(string root, string? relative)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(relative) || string.IsNullOrWhiteSpace(root))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string rootFull;
|
||||
string full;
|
||||
try
|
||||
{
|
||||
rootFull = Path.TrimEndingDirectorySeparator(Path.GetFullPath(root));
|
||||
full = Path.GetFullPath(Path.Combine(rootFull, relative));
|
||||
}
|
||||
catch (Exception ex) when (ex is ArgumentException or NotSupportedException or PathTooLongException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!full.StartsWith(rootFull + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return null; // a name that escapes the package is not the package's picture
|
||||
}
|
||||
|
||||
var plain = new FileInfo(full);
|
||||
if (plain.Exists && plain.Length > 0)
|
||||
{
|
||||
return plain.FullName;
|
||||
}
|
||||
|
||||
return plain.Directory is { Exists: true } folder
|
||||
? folder.EnumerateFiles(Path.GetFileNameWithoutExtension(full) + ".scale-*" + Path.GetExtension(full))
|
||||
.Where(static f => f.Length > 0)
|
||||
.OrderByDescending(static f => f.Length)
|
||||
.FirstOrDefault()?.FullName
|
||||
: null;
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,10 @@ namespace FrameLedger.Infrastructure.Capture;
|
||||
/// exactly one candidate carries it (<see cref="ChromiumGpuProcess"/>). Measured on
|
||||
/// <i>Flower in Us</i>: three <c>Game.exe</c>, one path, <c>TargetAmbiguous</c>.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>A candidate's path is the watcher's own spelling</b> (beta.33): <see cref="ProcessImagePath"/>, the kernel's image
|
||||
/// name, which the watcher keys the game on. It was the loader's (<c>Process.MainModule</c>) until then.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class TargetResolver : ITargetResolver
|
||||
{
|
||||
@@ -146,36 +150,29 @@ public sealed class TargetResolver : ITargetResolver
|
||||
{
|
||||
try
|
||||
{
|
||||
// MainModule needs rights we may not have for another user's or an elevated process.
|
||||
// A process we cannot read is NOT a match — "could not look" must not widen the set —
|
||||
// but it is counted below so it cannot narrow one either.
|
||||
string? image = p.MainModule?.FileName;
|
||||
// THE WATCHER'S OWN SPELLING (beta.33): the kernel's image name, normalised as the watcher normalises
|
||||
// it, where this read the loader's (MainModule) until then and a game started through a junction could
|
||||
// come back spelled differently from the path the watcher had just matched (ProcessImagePath).
|
||||
//
|
||||
// Opened with the guard's rights, which MainModule's open also needed: a process an anti-cheat driver
|
||||
// closes, or an elevated game to an unelevated Agent, is NOT a match -- "could not look" must not widen
|
||||
// the set -- but it is counted below so it cannot narrow one either (D21: TargetUnreadable).
|
||||
string? image = ProcessImagePath.Read(p.Id, ProcessImagePath.GuardRights, out int error);
|
||||
if (image is null)
|
||||
{
|
||||
// A process that is in the snapshot with NO main module yet -- it exists and has
|
||||
// not finished mapping its image. Measured on the hosted runner 2026-09-04, twice
|
||||
// in one hour, on a single freshly started instance: the resolver skipped it here
|
||||
// without counting it and answered TargetNotRunning about a process it had just
|
||||
// enumerated. "Could not look" must not narrow the set, and that includes this
|
||||
// shape; it is counted like a process we lack the rights to read.
|
||||
// Exited between enumeration and the read, not ours to read, or a name that would not
|
||||
// normalise. Either way we did not establish whether it is our target.
|
||||
unreadable++;
|
||||
why.Add($"pid {p.Id}: no main module yet");
|
||||
string because = error == 0 ? "its image path would not normalise" : new System.ComponentModel.Win32Exception(error).Message;
|
||||
why.Add($"pid {p.Id}: {because}");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (string.Equals(ExecutableIdentity.Normalise(image), normalisedExePath,
|
||||
StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(image, normalisedExePath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
matches.Add(p.Id);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) when (ex is InvalidOperationException or System.ComponentModel.Win32Exception)
|
||||
{
|
||||
// Exited between enumeration and the read, or not ours to read. Either way we did not
|
||||
// establish whether it is our target.
|
||||
unreadable++;
|
||||
why.Add($"pid {p.Id}: {ex.Message}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
p.Dispose();
|
||||
|
||||
@@ -191,6 +191,7 @@ public sealed class DetectionRulesFile : IDetectionRulesSource
|
||||
"pe_product_contains" => DetectionSignalType.PeProductContains,
|
||||
"strings_contains" => DetectionSignalType.StringsContains,
|
||||
"manifest_field" => DetectionSignalType.ManifestField,
|
||||
"root_file" => DetectionSignalType.RootFile,
|
||||
_ => throw new InvalidOperationException($"'{owner}' has unknown signal type '{d.Type}'"),
|
||||
};
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ public sealed class GameFileProbe : IGameFileProbe
|
||||
RelativeFiles = files,
|
||||
RelativeDirectories = dirs,
|
||||
FileListingComplete = listingComplete,
|
||||
RootFiles = ListRootFiles(dir),
|
||||
PeCompanyName = pe.Company,
|
||||
PeProductName = pe.Product,
|
||||
PeFileVersion = pe.FileVersion,
|
||||
@@ -333,6 +334,38 @@ public sealed class GameFileProbe : IGameFileProbe
|
||||
return found;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The names of the files directly in <paramref name="root"/> — what a <c>root_file</c> signal is answered from (beta.33)
|
||||
/// — or null when that one folder could not be listed or holds more than <see cref="MaxEntries"/> files.
|
||||
/// </summary>
|
||||
private static HashSet<string>? ListRootFiles(string root)
|
||||
{
|
||||
if (string.IsNullOrEmpty(root))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var names = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (string file in Directory.EnumerateFiles(root))
|
||||
{
|
||||
if (names.Count >= MaxEntries)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
names.Add(Path.GetFileName(file));
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Breadth-first, bounded. Returns false if the walk did not complete.</summary>
|
||||
private static bool TryWalk(string root, List<string> files, List<string> dirs)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FrameLedger.Infrastructure.Import;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Detection;
|
||||
|
||||
/// <summary>
|
||||
@@ -27,6 +29,19 @@ namespace FrameLedger.Infrastructure.Detection;
|
||||
/// <c>D:\another\epic\AlanWake2</c> is a folder of unrelated games, and scanning
|
||||
/// a sibling title's anti-cheat would be a false refusal with no appeal.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <strong>Except at a GDK package root (beta.33).</strong> The Xbox app installs to
|
||||
/// <c><games folder>\<Game>\Content\</c> under a folder the user names, so no
|
||||
/// string can bound it; the package marks its own root instead, with
|
||||
/// <c>MicrosoftGame.config</c> beside <c>appxmanifest.xml</c>. Only when no string
|
||||
/// boundary matched, the nearest folder at or above the executable's that holds
|
||||
/// both is the root (<see cref="GdkPackageFiles.NearestPackageRoot"/>) — which can
|
||||
/// only widen the walk relative to the exe's own directory, never narrow it. Without
|
||||
/// it, an Unreal title's <c>Content\…\Binaries\WinGDK</c> was all check 4 saw
|
||||
/// (<c>spike-notes</c> §25). The native <c>ResolveInstallRoot</c> answers the same,
|
||||
/// and a shared case list (<c>tests/fixtures/install-roots/cases.txt</c>) holds the
|
||||
/// two to it.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static class InstallRoot
|
||||
{
|
||||
@@ -81,6 +96,6 @@ public static class InstallRoot
|
||||
}
|
||||
}
|
||||
|
||||
return exeDir;
|
||||
return GdkPackageFiles.NearestPackageRoot(exeDir) ?? exeDir;
|
||||
}
|
||||
}
|
||||
@@ -71,6 +71,9 @@ public sealed class ExecutableLocator : IExecutableLocator
|
||||
public static readonly IReadOnlySet<string> RuntimeHelperNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"notification_helper", "crashpad_handler", "UnityCrashHandler64", "UnityCrashHandler32", "CrashReportClient", "nwjc", "chromedriver",
|
||||
// beta.33: the GDK's launcher at every Xbox game's package root (spike-notes §25) — it activates the package and
|
||||
// exits; the game is what it starts.
|
||||
"gamelaunchhelper",
|
||||
};
|
||||
|
||||
/// <summary>True for a name in <see cref="RuntimeHelperNames"/>.</summary>
|
||||
@@ -145,14 +148,14 @@ public sealed class ExecutableLocator : IExecutableLocator
|
||||
return null;
|
||||
}
|
||||
|
||||
string installName = Squash(Path.GetFileName(Path.TrimEndingDirectorySeparator(installDirectory)));
|
||||
string installName = Squash(InstallName(installDirectory));
|
||||
string? best = null;
|
||||
int bestRank = -1;
|
||||
long bestSize = -1;
|
||||
foreach (string exe in Walk(installDirectory, 0))
|
||||
{
|
||||
string name = Path.GetFileNameWithoutExtension(exe);
|
||||
if (IsHelper(name) || IsUnderPluginFolder(installDirectory, exe))
|
||||
if (IsHelper(name) || IsRuntimeHelper(name) || IsUnderPluginFolder(installDirectory, exe))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -203,6 +206,19 @@ public sealed class ExecutableLocator : IExecutableLocator
|
||||
return named ? _rankNamedAfterTheInstall : 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The install's own name: its folder's, except for a GDK package root (beta.33), whose folder is always
|
||||
/// <c>Content</c> and whose game's name is the folder above it (<c>D:\xbox\Valor Mortis\Content</c>).
|
||||
/// </summary>
|
||||
private static string InstallName(string installDirectory)
|
||||
{
|
||||
string folder = Path.TrimEndingDirectorySeparator(installDirectory);
|
||||
return string.Equals(Path.GetFileName(folder), XboxLibrarySource.ContentFolder, StringComparison.OrdinalIgnoreCase)
|
||||
&& GdkPackageFiles.IsPackageRoot(folder) && Path.GetDirectoryName(folder) is { } parent
|
||||
? Path.GetFileName(parent)
|
||||
: Path.GetFileName(folder);
|
||||
}
|
||||
|
||||
/// <summary>Letters and digits, lower-cased: "Cyberpunk 2077" and "Cyberpunk2077" are the same name.</summary>
|
||||
private static string Squash(string value) =>
|
||||
string.Concat(value.Where(char.IsLetterOrDigit).Select(char.ToLowerInvariant));
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Buffers.Binary;
|
||||
using System.Text;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Import;
|
||||
|
||||
/// <summary>
|
||||
/// The folders the Xbox app installs games into, as each drive's own <c>.GamingRoot</c> file names them (beta.33,
|
||||
/// <c>spike-notes</c> §25): the bytes <c>RGBX</c>, a little-endian 32-bit count, then that many NUL-terminated UTF-16
|
||||
/// folder names relative to the drive — measured <c>XboxGames</c> on C: (28 bytes) and <c>xbox</c> on D: (18 bytes).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The file is the Xbox app's, undocumented in the way Steam's <c>libraryfolders.vdf</c> is; it is read defensively: a
|
||||
/// file that does not start with the magic, claims more names than <see cref="MaxCount"/>, runs past its end, or names
|
||||
/// anything but a plain relative folder costs that drive (or that name), never the import.
|
||||
/// </remarks>
|
||||
public static class GamingRoots
|
||||
{
|
||||
/// <summary>The file at a drive's root.</summary>
|
||||
public const string FileName = ".GamingRoot";
|
||||
|
||||
/// <summary>More names than any install would have; a count above it is a file that is not one.</summary>
|
||||
public const int MaxCount = 64;
|
||||
|
||||
/// <summary>The largest file read.</summary>
|
||||
public const int MaxBytes = 64 * 1024;
|
||||
|
||||
private const int _headerBytes = 8;
|
||||
|
||||
private static ReadOnlySpan<byte> Magic => "RGBX"u8;
|
||||
|
||||
/// <summary>The folders <paramref name="bytes"/> names, each joined to <paramref name="driveRoot"/>; empty for a file that is not a <c>.GamingRoot</c>.</summary>
|
||||
public static IReadOnlyList<string> Parse(ReadOnlySpan<byte> bytes, string driveRoot)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(driveRoot);
|
||||
if (bytes.Length < _headerBytes || !bytes[..4].SequenceEqual(Magic))
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
uint count = BinaryPrimitives.ReadUInt32LittleEndian(bytes[4..8]);
|
||||
if (count == 0 || count > MaxCount)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
List<string> roots = [];
|
||||
int at = _headerBytes;
|
||||
for (uint i = 0; i < count; i++)
|
||||
{
|
||||
int end = at;
|
||||
while (end + 1 < bytes.Length && (bytes[end] != 0 || bytes[end + 1] != 0))
|
||||
{
|
||||
end += 2;
|
||||
}
|
||||
|
||||
if (end + 1 >= bytes.Length)
|
||||
{
|
||||
break; // ran past the end: the names read so far stand, the rest is not there
|
||||
}
|
||||
|
||||
string name = Encoding.Unicode.GetString(bytes[at..end]);
|
||||
if (Resolve(driveRoot, name) is { } root)
|
||||
{
|
||||
roots.Add(root);
|
||||
}
|
||||
|
||||
at = end + 2;
|
||||
}
|
||||
|
||||
return roots;
|
||||
}
|
||||
|
||||
/// <summary>Every games folder the ready fixed and removable drives' <c>.GamingRoot</c> files name.</summary>
|
||||
public static IReadOnlyList<string> OnThisPc()
|
||||
{
|
||||
List<string> roots = [];
|
||||
DriveInfo[] drives;
|
||||
try
|
||||
{
|
||||
drives = DriveInfo.GetDrives();
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
return roots;
|
||||
}
|
||||
|
||||
foreach (DriveInfo drive in drives)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (drive.DriveType is not (DriveType.Fixed or DriveType.Removable) || !drive.IsReady)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string file = Path.Combine(drive.RootDirectory.FullName, FileName);
|
||||
var info = new FileInfo(file);
|
||||
if (!info.Exists || info.Length > MaxBytes)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
roots.AddRange(Parse(File.ReadAllBytes(file), drive.RootDirectory.FullName));
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
|
||||
{
|
||||
// A drive that will not answer is a drive with no games folder this time.
|
||||
}
|
||||
}
|
||||
|
||||
return roots;
|
||||
}
|
||||
|
||||
/// <summary><paramref name="name"/> joined to the drive, or null for a name that is not a plain relative folder on it.</summary>
|
||||
private static string? Resolve(string driveRoot, string name)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name) || Path.IsPathRooted(name) || name.Contains(':', StringComparison.Ordinal)
|
||||
|| name.IndexOfAny(Path.GetInvalidPathChars()) >= 0
|
||||
|| name.Split('\\', '/').Any(static segment => segment is "." or ".."))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string drive = Path.GetFullPath(driveRoot);
|
||||
string full = Path.GetFullPath(Path.Combine(drive, name));
|
||||
return full.StartsWith(drive, StringComparison.OrdinalIgnoreCase) && full.Length > drive.Length ? full : null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.Infrastructure.Import;
|
||||
|
||||
/// <summary>What <see cref="GdkPackageFiles.Read"/> found in a GDK package root; every member but the identity may be null.</summary>
|
||||
public sealed record GdkPackage
|
||||
{
|
||||
/// <summary><c>Identity/@Name</c>, e.g. <c>LyricalGamesLLC.ValorMortis</c>.</summary>
|
||||
public required string Name { get; init; }
|
||||
|
||||
/// <summary><c>Identity/@Publisher</c>, the certificate subject the family name is computed from.</summary>
|
||||
public required string Publisher { get; init; }
|
||||
|
||||
/// <summary><c>Identity/@Version</c>, e.g. <c>1.3.5124.0</c>.</summary>
|
||||
public string? Version { get; init; }
|
||||
|
||||
/// <summary><c>ShellVisuals/@DefaultDisplayName</c>, else the manifest's <c>DisplayName</c> — never an <c>ms-resource:</c> reference.</summary>
|
||||
public string? DisplayName { get; init; }
|
||||
|
||||
/// <summary>The first <c>ExecutableList/Executable/@Name</c>: the executable the package launches (the Unreal stub, the Unity player).</summary>
|
||||
public string? LaunchExecutable { get; init; }
|
||||
|
||||
/// <summary>The manifest <c>Application/@Id</c> whose executable is <c>GameLaunchHelper.exe</c>, else the first.</summary>
|
||||
public string? ApplicationId { get; init; }
|
||||
|
||||
/// <summary><c>StoreId</c>, the Microsoft Store's product id (<c>9P861V1542BL</c>).</summary>
|
||||
public string? StoreId { get; init; }
|
||||
|
||||
/// <summary><c>ShellVisuals/@Square480x480Logo</c>, relative to the package root.</summary>
|
||||
public string? Square480Logo { get; init; }
|
||||
|
||||
/// <summary><c>ShellVisuals/@Square150x150Logo</c>, relative to the package root.</summary>
|
||||
public string? Square150Logo { get; init; }
|
||||
|
||||
/// <summary><c>ShellVisuals/@SplashScreenImage</c> (1920×1080 on the 11 measured), relative to the package root.</summary>
|
||||
public string? SplashScreen { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Import;
|
||||
|
||||
/// <summary>
|
||||
/// The two files a Microsoft GDK game's package root carries (beta.33, <c>spike-notes</c> §25): <c>MicrosoftGame.config</c>
|
||||
/// — the game's identity, its shell visuals and the executable its package launches — and <c>appxmanifest.xml</c>, whose
|
||||
/// <c>Application</c> names the id Windows activates. The Xbox app and the Microsoft Store install every such game into
|
||||
/// <c><drive>\<games folder>\<Game>\Content\</c>, with both files at the root of <c>Content</c>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>Read with a hardened reader</b>: no DTD, no resolver, a size cap — the files are the publisher's, and an
|
||||
/// unexpected shape costs that one game, never the import. Nothing here opens the game's executable: every game
|
||||
/// <c>.exe</c> under <c>Content</c> refuses <c>FILE_READ_DATA</c> to a process outside its package (§25), while these XML
|
||||
/// files, the images and the DLLs read.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>A package root is the folder holding both files</b> (<see cref="IsPackageRoot"/>). The install-root resolvers use
|
||||
/// that test only where no store boundary is recognised (<c>InstallRoot</c>, native <c>ResolveInstallRoot</c>), so it
|
||||
/// can widen what detection and the guard's check 4 walk, never narrow it.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static class GdkPackageFiles
|
||||
{
|
||||
/// <summary>The GDK's own description of the game; the FINAL FANTASY titles spell it <c>MicrosoftGame.Config</c> (NTFS does not mind).</summary>
|
||||
public const string ConfigFileName = "MicrosoftGame.config";
|
||||
|
||||
/// <summary>The package manifest Windows registers.</summary>
|
||||
public const string ManifestFileName = "appxmanifest.xml";
|
||||
|
||||
/// <summary>How far above an executable's folder <see cref="NearestPackageRoot"/> looks: §25 measured three levels (Unreal's <c><Project>\Binaries\WinGDK</c>).</summary>
|
||||
public const int MaxLevelsUp = 8;
|
||||
|
||||
/// <summary>The largest description file read; the 11 measured on the owner's PC are 1.5–30 KB.</summary>
|
||||
public const long MaxFileBytes = 1024 * 1024;
|
||||
|
||||
private const string _manifestNamespace = "http://schemas.microsoft.com/appx/manifest/foundation/windows10";
|
||||
private const string _launchHelper = "GameLaunchHelper.exe";
|
||||
private const string _resourcePrefix = "ms-resource:";
|
||||
|
||||
private static readonly XmlReaderSettings _xml = new()
|
||||
{
|
||||
DtdProcessing = DtdProcessing.Prohibit,
|
||||
XmlResolver = null,
|
||||
MaxCharactersInDocument = MaxFileBytes,
|
||||
IgnoreComments = true,
|
||||
IgnoreProcessingInstructions = true,
|
||||
};
|
||||
|
||||
/// <summary>True when <paramref name="folder"/> holds both a <c>MicrosoftGame.config</c> and an <c>appxmanifest.xml</c> file.</summary>
|
||||
public static bool IsPackageRoot(string folder)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(folder))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return File.Exists(Path.Combine(folder, ConfigFileName)) && File.Exists(Path.Combine(folder, ManifestFileName));
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <paramref name="folder"/> itself or the nearest of its parents, at most <see cref="MaxLevelsUp"/> levels up and never a
|
||||
/// drive's root, that <see cref="IsPackageRoot"/>; null when there is none.
|
||||
/// </summary>
|
||||
public static string? NearestPackageRoot(string folder)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(folder))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
DirectoryInfo? current = new(folder);
|
||||
for (int level = 0; level <= MaxLevelsUp && current is { Parent: not null }; level++)
|
||||
{
|
||||
if (IsPackageRoot(current.FullName))
|
||||
{
|
||||
return current.FullName;
|
||||
}
|
||||
|
||||
current = current.Parent;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// True when <paramref name="exePath"/>'s install root (<c>Detection.InstallRoot</c>) is a GDK package root — a game the
|
||||
/// Xbox app or the Microsoft Store installed, which FrameLedger never starts by its path (beta.33, D80, §25).
|
||||
/// </summary>
|
||||
public static bool IsInPackage(string exePath)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(exePath);
|
||||
try
|
||||
{
|
||||
return IsPackageRoot(Detection.InstallRoot.Resolve(exePath));
|
||||
}
|
||||
catch (Exception ex) when (ex is ArgumentException or NotSupportedException or PathTooLongException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The package <paramref name="contentFolder"/> is the root of, or null when it is not one or its files will not parse.</summary>
|
||||
public static GdkPackage? Read(string contentFolder)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(contentFolder);
|
||||
if (!IsPackageRoot(contentFolder))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
XDocument? config = Load(Path.Combine(contentFolder, ConfigFileName));
|
||||
XDocument? manifest = Load(Path.Combine(contentFolder, ManifestFileName));
|
||||
if (config?.Root is not { } game || manifest?.Root is not { } package)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
XElement? identity = Child(game, "Identity");
|
||||
string? name = Attribute(identity, "Name");
|
||||
string? publisher = Attribute(identity, "Publisher");
|
||||
if (name is null || publisher is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
XElement? visuals = Child(game, "ShellVisuals");
|
||||
XNamespace ns = _manifestNamespace;
|
||||
List<XElement> applications = [.. package.Elements(ns + "Applications").Elements(ns + "Application")];
|
||||
XElement? application = applications.Find(static a => string.Equals(Attribute(a, "Executable"), _launchHelper, StringComparison.OrdinalIgnoreCase))
|
||||
?? applications.FirstOrDefault();
|
||||
|
||||
return new GdkPackage
|
||||
{
|
||||
Name = name,
|
||||
Publisher = publisher,
|
||||
Version = Attribute(identity, "Version"),
|
||||
DisplayName = Plain(Attribute(visuals, "DefaultDisplayName")) ?? Plain(package.Element(ns + "Properties")?.Element(ns + "DisplayName")?.Value),
|
||||
LaunchExecutable = Attribute(Child(Child(game, "ExecutableList"), "Executable"), "Name"),
|
||||
ApplicationId = Attribute(application, "Id"),
|
||||
StoreId = Plain(Child(game, "StoreId")?.Value),
|
||||
Square480Logo = Attribute(visuals, "Square480x480Logo"),
|
||||
Square150Logo = Attribute(visuals, "Square150x150Logo"),
|
||||
SplashScreen = Attribute(visuals, "SplashScreenImage"),
|
||||
};
|
||||
}
|
||||
|
||||
private static XDocument? Load(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var info = new FileInfo(path);
|
||||
if (!info.Exists || info.Length > MaxFileBytes)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
using XmlReader reader = XmlReader.Create(path, _xml);
|
||||
return XDocument.Load(reader);
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or XmlException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The first child element named <paramref name="localName"/> in any namespace — <c>MicrosoftGame.config</c> declares none.</summary>
|
||||
private static XElement? Child(XElement? parent, string localName) =>
|
||||
parent?.Elements().FirstOrDefault(e => string.Equals(e.Name.LocalName, localName, StringComparison.Ordinal));
|
||||
|
||||
private static string? Attribute(XElement? element, string name) =>
|
||||
element?.Attribute(name)?.Value is { } value && !string.IsNullOrWhiteSpace(value) ? value.Trim() : null;
|
||||
|
||||
/// <summary>A name as text, or null for an empty one or an <c>ms-resource:</c> reference this reader does not resolve.</summary>
|
||||
private static string? Plain(string? value) =>
|
||||
string.IsNullOrWhiteSpace(value) || value.TrimStart().StartsWith(_resourcePrefix, StringComparison.OrdinalIgnoreCase) ? null : value.Trim();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.Infrastructure.Import;
|
||||
|
||||
/// <summary>
|
||||
/// Windows' own answers about an app package (beta.33): the family name a package identity has, and whether a package of
|
||||
/// that family is installed for the current user. The Xbox library asks both of every game folder it finds, so a folder
|
||||
/// the Xbox app left behind, or one installed for another user, is not offered.
|
||||
/// </summary>
|
||||
public interface IInstalledPackages
|
||||
{
|
||||
/// <summary>The package family name Windows computes for <paramref name="name"/> and <paramref name="publisher"/>, or null when it does not.</summary>
|
||||
string? FamilyName(string name, string publisher);
|
||||
|
||||
/// <summary>True when a package of the family <paramref name="familyName"/> is installed for the current user.</summary>
|
||||
bool IsInstalled(string familyName);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Import;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="IInstalledPackages"/> over <c>appmodel.h</c>'s documented calls — <c>PackageFamilyNameFromId</c> and
|
||||
/// <c>GetPackagesByPackageFamily</c> — which answer for the user without elevation (measured on the owner's 11 games,
|
||||
/// <c>spike-notes</c> §25). Hand-written <c>DllImport</c>s beside <c>ToolhelpProcessSnapshotSource</c>'s, for its reason:
|
||||
/// the marshaling-off CsWin32 profile would hand back raw <c>PWSTR</c>s for the strings this class exists to read.
|
||||
/// </summary>
|
||||
public sealed class WindowsInstalledPackages : IInstalledPackages
|
||||
{
|
||||
private const int _errorSuccess = 0;
|
||||
private const int _errorInsufficientBuffer = 122;
|
||||
private const int _familyNameCapacity = 128; // PACKAGE_FAMILY_NAME_MAX_LENGTH is 64 + the terminator
|
||||
|
||||
/// <summary>The one instance; it holds nothing.</summary>
|
||||
public static WindowsInstalledPackages Instance { get; } = new();
|
||||
|
||||
/// <inheritdoc />
|
||||
public string? FamilyName(string name, string publisher)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(name);
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(publisher);
|
||||
var id = new PackageId { Name = name, Publisher = publisher };
|
||||
uint length = _familyNameCapacity;
|
||||
char[] buffer = new char[_familyNameCapacity];
|
||||
int result = PackageFamilyNameFromId(ref id, ref length, buffer);
|
||||
return result == _errorSuccess && length > 1 && length <= buffer.Length ? new string(buffer, 0, checked((int)length - 1)) : null;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsInstalled(string familyName)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(familyName);
|
||||
uint count = 0;
|
||||
uint bufferLength = 0;
|
||||
int result = GetPackagesByPackageFamily(familyName, ref count, IntPtr.Zero, ref bufferLength, IntPtr.Zero);
|
||||
|
||||
// Asked with no buffers, an installed family answers "insufficient buffer" with its count; none answers success and 0.
|
||||
return result == _errorInsufficientBuffer || (result == _errorSuccess && count > 0);
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
private struct PackageId
|
||||
{
|
||||
public uint Reserved;
|
||||
public uint ProcessorArchitecture;
|
||||
public ulong Version;
|
||||
public string Name;
|
||||
public string Publisher;
|
||||
public string? ResourceId;
|
||||
public string? PublisherId;
|
||||
}
|
||||
|
||||
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
|
||||
private static extern int PackageFamilyNameFromId(ref PackageId packageId, ref uint packageFamilyNameLength, [Out] char[] packageFamilyName);
|
||||
|
||||
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
|
||||
private static extern int GetPackagesByPackageFamily(string packageFamilyName, ref uint count, IntPtr packageFullNames, ref uint bufferLength,
|
||||
IntPtr buffer);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FrameLedger.Application.Import;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Import;
|
||||
|
||||
/// <summary>
|
||||
/// The games the Xbox app and the Microsoft Store installed — PC Game Pass included (beta.33, owner decisions D78/D79,
|
||||
/// <c>spike-notes</c> §25): every <c><games folder>\<Game>\Content\</c> that is a GDK package root, under the
|
||||
/// folders the drives' <c>.GamingRoot</c> files name (<see cref="GamingRoots"/>), whose package Windows says is installed
|
||||
/// for this user (<see cref="IInstalledPackages"/>).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>The record:</b> the store id is the package family name (stable across the game's updates, unlike the WindowsApps
|
||||
/// folder whose name carries the version); the install directory is <c>Content</c>, the spelling the game's process
|
||||
/// reports for its own image (§25 — never the <c>C:\Program Files\WindowsApps</c> junction); the launch key is the
|
||||
/// AppUserModelID <c><family name>!<Application Id></c>, exactly what Windows' Start menu lists, which Play
|
||||
/// activates (D80). The executable is left to <c>ExecutableLocator</c>, because the one the package launches is the
|
||||
/// Unreal stub, not the shipping executable that presents.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// GDK titles only (D78): a UWP app has no <c>MicrosoftGame.config</c> and lives in no games folder, so it is not listed.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class XboxLibrarySource(IReadOnlyList<string>? gamingRoots = null, IInstalledPackages? packages = null) : IStoreLibrarySource
|
||||
{
|
||||
/// <summary>The package root's folder name under each game's folder.</summary>
|
||||
public const string ContentFolder = "Content";
|
||||
|
||||
public string Platform => "xbox";
|
||||
|
||||
public ValueTask<IReadOnlyList<StoreGame>> ListAsync(CancellationToken ct = default)
|
||||
{
|
||||
IReadOnlyList<string> roots = gamingRoots ?? GamingRoots.OnThisPc();
|
||||
IInstalledPackages registry = packages ?? WindowsInstalledPackages.Instance;
|
||||
List<StoreGame> games = [];
|
||||
foreach (string root in roots)
|
||||
{
|
||||
string[] folders;
|
||||
try
|
||||
{
|
||||
folders = Directory.GetDirectories(root);
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (string folder in folders)
|
||||
{
|
||||
ct.ThrowIfCancellationRequested();
|
||||
if (Read(folder, registry) is { } game)
|
||||
{
|
||||
games.Add(game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ValueTask.FromResult<IReadOnlyList<StoreGame>>(games);
|
||||
}
|
||||
|
||||
/// <summary>The game in <paramref name="gameFolder"/>, or null when it holds no installed GDK package.</summary>
|
||||
public static StoreGame? Read(string gameFolder, IInstalledPackages registry)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(gameFolder);
|
||||
ArgumentNullException.ThrowIfNull(registry);
|
||||
string content = Path.Combine(gameFolder, ContentFolder);
|
||||
if (GdkPackageFiles.Read(content) is not { } package)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string? family = registry.FamilyName(package.Name, package.Publisher);
|
||||
if (family is null || !registry.IsInstalled(family))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string name = package.DisplayName ?? Path.GetFileName(Path.TrimEndingDirectorySeparator(gameFolder));
|
||||
string? launchKey = package.ApplicationId is { } appId ? family + "!" + appId : null;
|
||||
return new StoreGame("xbox", family, name, content, ExePath: null, package.Version, launchKey);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Io;
|
||||
|
||||
/// <summary>
|
||||
/// A process's image path as the kernel names it — <c>QueryFullProcessImageNameW</c> — normalised the way
|
||||
/// <see cref="ExecutableIdentity"/> normalises a consent record's. The ONE spelling the capture path compares (beta.33,
|
||||
/// D80): the watcher keys a game on it, and <c>TargetResolver</c> re-finds the game by it just before injecting.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// The resolver read the LOADER's name until beta.33 (<c>Process.MainModule</c>): the spelling a process was started
|
||||
/// with, where the watcher had the kernel's. For a game started through a junction — a package Windows activates from
|
||||
/// <c>C:\Program Files\WindowsApps\<package></c>, which is a junction to the game's own folder — the two could
|
||||
/// differ, and the session would end <c>TargetNotRunning</c> about a game the watcher had just seen. <c>spike-notes</c>
|
||||
/// §25 measured them equal on the owner's eleven Xbox titles; one source keeps them equal by construction.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Nothing here reads the process's memory: the kernel copies the name into a buffer we own. Null is "could not
|
||||
/// read", never a name — a caller must not let it narrow or widen a set.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static class ProcessImagePath
|
||||
{
|
||||
/// <summary><c>PROCESS_QUERY_LIMITED_INFORMATION</c>: the least right that answers, which the watcher holds on most processes.</summary>
|
||||
public const uint QueryLimited = 0x1000;
|
||||
|
||||
/// <summary>
|
||||
/// <c>PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_VM_READ</c>: the rights the guard's module check opens a target with
|
||||
/// (<c>fl_guard_sources.cpp</c>). A process that refuses them — one an anti-cheat driver closes, or an elevated game
|
||||
/// to an unelevated Agent — cannot pass the guard, and the resolver says so before asking it (D21).
|
||||
/// </summary>
|
||||
public const uint GuardRights = QueryLimited | 0x0010;
|
||||
|
||||
private const int _maxPath = 32_767;
|
||||
|
||||
/// <summary>The normalised image path of <paramref name="pid"/> opened with <paramref name="access"/>, or null with the Win32 error.</summary>
|
||||
/// <param name="pid">The process.</param>
|
||||
/// <param name="access"><see cref="QueryLimited"/> or <see cref="GuardRights"/>.</param>
|
||||
/// <param name="error">The error that stopped the read; 0 when the name was read and would not normalise.</param>
|
||||
public static string? Read(int pid, uint access, out int error)
|
||||
{
|
||||
error = 0;
|
||||
if (pid <= 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
using SafeProcessHandle handle = OpenProcess(access, false, unchecked((uint)pid));
|
||||
if (handle.IsInvalid)
|
||||
{
|
||||
error = Marshal.GetLastPInvokeError();
|
||||
return null;
|
||||
}
|
||||
|
||||
return Of(handle, out error);
|
||||
}
|
||||
|
||||
/// <summary>The normalised image path of the process <paramref name="handle"/> names, or null with the Win32 error.</summary>
|
||||
public static string? Of(SafeProcessHandle handle, out int error)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(handle);
|
||||
error = 0;
|
||||
char[] buffer = new char[_maxPath];
|
||||
uint size = (uint)buffer.Length;
|
||||
if (!QueryFullProcessImageNameW(handle, 0, buffer, ref size) || size == 0)
|
||||
{
|
||||
error = Marshal.GetLastPInvokeError();
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return ExecutableIdentity.Normalise(new string(buffer, 0, checked((int)size)));
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern SafeProcessHandle OpenProcess(uint desiredAccess,
|
||||
[MarshalAs(UnmanagedType.Bool)] bool inheritHandle, uint processId);
|
||||
|
||||
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
|
||||
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool QueryFullProcessImageNameW(SafeProcessHandle process, uint flags,
|
||||
[Out] char[] exeName, ref uint size);
|
||||
}
|
||||
@@ -184,7 +184,7 @@ public sealed class SqliteGameRepository : IGameRepository
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(metadata.Name, nameof(metadata));
|
||||
if (!GameMetadata.Platforms.Contains(metadata.Platform, StringComparer.Ordinal))
|
||||
{
|
||||
throw new ArgumentException($"'{metadata.Platform}' is not a platform (steam|gog|epic|itch|none)", nameof(metadata));
|
||||
throw new ArgumentException($"'{metadata.Platform}' is not a platform ({string.Join('|', GameMetadata.Platforms)})", nameof(metadata));
|
||||
}
|
||||
|
||||
return _db.WriteAsync(async (c, tx, token) =>
|
||||
@@ -295,7 +295,7 @@ public sealed class SqliteGameRepository : IGameRepository
|
||||
ArgumentNullException.ThrowIfNull(store);
|
||||
if (!GameMetadata.Platforms.Contains(store.Platform, StringComparer.Ordinal) || string.Equals(store.Platform, "none", StringComparison.Ordinal))
|
||||
{
|
||||
throw new ArgumentException($"'{store.Platform}' is not a store (steam|gog|epic|itch)", nameof(store));
|
||||
throw new ArgumentException($"'{store.Platform}' is not a store ({string.Join('|', GameMetadata.Platforms.Where(static p => !string.Equals(p, "none", StringComparison.Ordinal)))})", nameof(store));
|
||||
}
|
||||
|
||||
return _db.WriteAsync(async (c, tx, token) =>
|
||||
|
||||
@@ -34,8 +34,6 @@ namespace FrameLedger.Infrastructure.Watch;
|
||||
public sealed class ToolhelpProcessSnapshotSource : IProcessSnapshotSource
|
||||
{
|
||||
private const uint _snapProcess = 0x00000002;
|
||||
private const uint _queryLimitedInformation = 0x1000;
|
||||
private const int _maxPath = 32_767;
|
||||
private static readonly IntPtr _invalidHandle = new(-1);
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -80,39 +78,20 @@ public sealed class ToolhelpProcessSnapshotSource : IProcessSnapshotSource
|
||||
|
||||
private static (string? Path, DateTimeOffset? StartedAt) Describe(int pid)
|
||||
{
|
||||
using SafeProcessHandle handle = OpenProcess(_queryLimitedInformation, false, unchecked((uint)pid));
|
||||
using SafeProcessHandle handle = OpenProcess(ProcessImagePath.QueryLimited, false, unchecked((uint)pid));
|
||||
if (handle.IsInvalid)
|
||||
{
|
||||
return (null, null);
|
||||
}
|
||||
|
||||
string? path = ImagePathOf(handle);
|
||||
// The same reader TargetResolver re-finds the game with (beta.33): one spelling for the whole capture path.
|
||||
string? path = ProcessImagePath.Of(handle, out _);
|
||||
DateTimeOffset? started = GetProcessTimes(handle, out long creation, out _, out _, out _)
|
||||
? DateTimeOffset.FromFileTime(creation)
|
||||
: null;
|
||||
return (path, started);
|
||||
}
|
||||
|
||||
private static string? ImagePathOf(SafeProcessHandle handle)
|
||||
{
|
||||
char[] buffer = new char[_maxPath];
|
||||
uint size = (uint)buffer.Length;
|
||||
if (!QueryFullProcessImageNameW(handle, 0, buffer, ref size) || size == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string raw = new(buffer, 0, checked((int)size));
|
||||
try
|
||||
{
|
||||
return ExecutableIdentity.Normalise(raw);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
private struct ProcessEntry32W
|
||||
{
|
||||
@@ -154,12 +133,6 @@ public sealed class ToolhelpProcessSnapshotSource : IProcessSnapshotSource
|
||||
private static extern SafeProcessHandle OpenProcess(uint desiredAccess,
|
||||
[MarshalAs(UnmanagedType.Bool)] bool inheritHandle, uint processId);
|
||||
|
||||
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
|
||||
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool QueryFullProcessImageNameW(SafeProcessHandle process, uint flags,
|
||||
[Out] char[] exeName, ref uint size);
|
||||
|
||||
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
|
||||
@@ -201,6 +201,25 @@ enum class Reason : std::uint8_t {
|
||||
// checks read exactly as before.
|
||||
kAllowedUserModeException,
|
||||
|
||||
// THE TARGET CANNOT TAKE THE OVERLAY AT ALL (beta.33, owner decision D78; spike-notes §25). Both are read from the
|
||||
// target itself -- its token and its process mitigation policies, through Sources::TargetIsolationFacts -- as the
|
||||
// last question before the primitive, after every check above and the payload's identity passed. Neither is a
|
||||
// finding about anti-cheat: nothing is written to the game's row, and the session is Tier 2 with this reason. Each
|
||||
// ended before as a failed injection, an Overlay that installed no hooks, or a risk of killing the game, and never
|
||||
// as a working session -- so no game that measured before is refused now.
|
||||
//
|
||||
// The token is an AppContainer's: a Microsoft Store app of the UWP kind, not a desktop game. The Overlay's shared
|
||||
// memory, its `Local\` names and the rules file it reads live in the user's session namespace and profile, which an
|
||||
// AppContainer cannot open. GDK games from the Xbox app are full trust and are not this (D78).
|
||||
kTargetAppContainer,
|
||||
|
||||
// Windows runs the target under a code-protection policy the Overlay cannot live under: images signed by Microsoft
|
||||
// or the Store only (the Overlay is neither), no dynamic code (MinHook's trampolines are dynamic code), a user
|
||||
// shadow stack in strict mode or one that refuses images not marked CET-compatible (the Overlay is not), or Control
|
||||
// Flow Guard in strict mode (native/CMakeLists.txt H1: a host in strict mode could still __fastfail on the
|
||||
// trampolines, which no fault policy can catch). The policy is the signal, and an audit-only flag is not one.
|
||||
kTargetMitigation,
|
||||
|
||||
// NOT A REASON. The count, so appending above it updates the exported
|
||||
// FlGuardReasonCount by construction.
|
||||
//
|
||||
@@ -288,6 +307,19 @@ using ModuleSink = bool (*)(void* ctx, const char* name, const wchar_t* path);
|
||||
// the name would be a second, weaker classifier.
|
||||
using DirEntrySink = bool (*)(void* ctx, const char* name, bool isDirectory);
|
||||
|
||||
// What the target's own token and mitigation policies say about loading the Overlay (beta.33, D78) -- read by
|
||||
// Sources::TargetIsolationFacts, judged by the guard (kTargetAppContainer, kTargetMitigation). Each field is one
|
||||
// Windows flag, named as winnt.h names it, so a refusal's signal can say which one it was.
|
||||
struct TargetIsolation {
|
||||
bool appContainer = false; // TokenIsAppContainer
|
||||
bool microsoftSignedOnly = false; // ProcessSignaturePolicy.MicrosoftSignedOnly
|
||||
bool storeSignedOnly = false; // ProcessSignaturePolicy.StoreSignedOnly
|
||||
bool dynamicCodeProhibited = false; // ProcessDynamicCodePolicy.ProhibitDynamicCode
|
||||
bool shadowStackStrict = false; // ProcessUserShadowStackPolicy: enabled, EnableUserShadowStackStrictMode
|
||||
bool shadowStackBlocksNonCet = false; // ProcessUserShadowStackPolicy.BlockNonCetBinaries(NonEhcont)
|
||||
bool cfgStrict = false; // ProcessControlFlowGuardPolicy.StrictMode
|
||||
};
|
||||
|
||||
struct Sources {
|
||||
// Loaded modules of one process, by base name and load path.
|
||||
Collected (*EnumerateModules)(std::uint32_t pid, ModuleSink sink, void* ctx) = nullptr;
|
||||
@@ -455,6 +487,17 @@ struct Sources {
|
||||
// Same trust base as above: that swap needs write access we have already
|
||||
// conceded.
|
||||
Collected (*PayloadIsOurOwn)(const wchar_t* dllPath, bool* isOurs) = nullptr;
|
||||
|
||||
// beta.33 (D78) -- can the target take the Overlay at all? Its token (TokenIsAppContainer) and four of its
|
||||
// process mitigation policies, read through a PROCESS_QUERY_LIMITED_INFORMATION handle, which answers both
|
||||
// (measured 2026-11-03 on Windows 11: GetProcessMitigationPolicy needs no more). A policy this Windows does not
|
||||
// know (ERROR_INVALID_PARAMETER, which is what an unknown policy answers -- measured) cannot be in effect, and
|
||||
// reads as clear; any other failure is kFailed.
|
||||
//
|
||||
// kFailed and a null seam refuse, as kProcessUnreadable: "could not tell" never reads as "clear". Asked by
|
||||
// GuardedInjectImpl only, never by EvaluateImpl -- the 30 s re-scan runs inside a process the Overlay is already
|
||||
// in, where the question has been answered.
|
||||
Collected (*TargetIsolationFacts)(std::uint32_t pid, TargetIsolation* out) = nullptr;
|
||||
};
|
||||
|
||||
// TWO SEAMS, ONE IMPLEMENTATION. SystemSources() wires both ModuleIsOurOwn and
|
||||
|
||||
@@ -84,8 +84,9 @@ inline constexpr std::size_t kMaxPreScanPathLen = 1024;
|
||||
// anti-cheat SDK. For exactly the layout most likely to carry EAC, check 4 was
|
||||
// looking in the wrong place.
|
||||
//
|
||||
// Walks up to a hardcoded platform boundary (`steamapps\common\<X>` and
|
||||
// friends) and returns that game's folder. Boundaries are hardcoded for the same
|
||||
// Walks up to a hardcoded platform boundary (`steamapps\common\<X>`,
|
||||
// `GOG Galaxy\Games\<X>`, `Epic Games\<X>`, `GamesInstalled\<X>`) and returns
|
||||
// that game's folder. Boundaries are hardcoded for the same
|
||||
// reason IsPlatformLauncher is: a data-driven boundary would let a rules update
|
||||
// move where the hard gate looks.
|
||||
//
|
||||
@@ -94,6 +95,15 @@ inline constexpr std::size_t kMaxPreScanPathLen = 1024;
|
||||
// `D:\games\Title\` is a folder of other games, and refusing this title because
|
||||
// a sibling ships anti-cheat is a false refusal with no appeal.
|
||||
//
|
||||
// EXCEPT AT A GDK PACKAGE ROOT (beta.33, spike-notes §25). The Xbox app installs
|
||||
// to `<games folder>\<Game>\Content\` under a folder the user names; the package
|
||||
// marks its own root with `MicrosoftGame.config` beside `appxmanifest.xml`. Only
|
||||
// when no string boundary matched, the nearest folder at or above `exeDir` (at
|
||||
// most 8 levels up, never a drive's root) holding both FILES is the root — not a
|
||||
// blind walk up, a marker the package itself writes, and only ever a widening of
|
||||
// the walk relative to `exeDir`. The managed InstallRoot answers the same; the
|
||||
// case list tests/fixtures/install-roots/cases.txt holds both to it.
|
||||
//
|
||||
// The root REPLACED the executable's folder as check 4's one walk on 2026-09-25,
|
||||
// and that was half right: what sits at the root (Lies of P's EasyAntiCheat/) is
|
||||
// seen, what sits beside a nested executable is not (kMaxPreScanDepth). Since
|
||||
|
||||
@@ -594,6 +594,10 @@ const char* ReasonName(Reason r) noexcept {
|
||||
return "KillSwitchEngaged";
|
||||
case Reason::kAllowedUserModeException:
|
||||
return "AllowedUnderUserModeException";
|
||||
case Reason::kTargetAppContainer:
|
||||
return "TargetAppContainer";
|
||||
case Reason::kTargetMitigation:
|
||||
return "TargetMitigation";
|
||||
case Reason::kCount:
|
||||
break; // not a reason; falls through to the guard below
|
||||
}
|
||||
@@ -717,6 +721,50 @@ Verdict EvaluateImpl(std::uint32_t targetPid, const Sources& sources, const char
|
||||
// A refusal returns here, and there is no argument that changes that (the `acknowledged` flag of 2026-09-21 was
|
||||
// withdrawn on 2026-09-22 with the bypass it served). Everything below -- the payload's existence, the payload's
|
||||
// identity, the primitive, the bitness answer -- runs only for a target the full evaluation allowed.
|
||||
// beta.33 (D78) -- the first policy in `facts` the Overlay cannot live under, named for the refusal's signal; null
|
||||
// when there is none. Which one names a refusal changes nothing a user can do, so the order is just winnt.h's.
|
||||
const char* BlockingMitigation(const TargetIsolation& facts) noexcept {
|
||||
if (facts.microsoftSignedOnly) {
|
||||
return "signature policy: Microsoft-signed images only";
|
||||
}
|
||||
if (facts.storeSignedOnly) {
|
||||
return "signature policy: Store-signed images only";
|
||||
}
|
||||
if (facts.dynamicCodeProhibited) {
|
||||
return "dynamic code policy: dynamic code prohibited";
|
||||
}
|
||||
if (facts.shadowStackStrict) {
|
||||
return "user shadow stack policy: strict mode";
|
||||
}
|
||||
if (facts.shadowStackBlocksNonCet) {
|
||||
return "user shadow stack policy: images not marked CET-compatible are blocked";
|
||||
}
|
||||
if (facts.cfgStrict) {
|
||||
return "Control Flow Guard policy: strict mode";
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// beta.33 (D78) -- can the target take the Overlay at all? kAllow, or the refusal. "Could not tell" refuses as
|
||||
// kProcessUnreadable, the module check's own word for a process it could not read: it never reads as "clear".
|
||||
Verdict TargetIsolationVerdict(std::uint32_t targetPid, const Sources& sources) noexcept {
|
||||
if (sources.TargetIsolationFacts == nullptr) {
|
||||
return Refuse(Reason::kProcessUnreadable, nullptr, "no target isolation source");
|
||||
}
|
||||
TargetIsolation facts;
|
||||
if (sources.TargetIsolationFacts(targetPid, &facts) != Collected::kOk) {
|
||||
return Refuse(Reason::kProcessUnreadable, nullptr,
|
||||
"the target's token or code-protection policies could not be read");
|
||||
}
|
||||
if (facts.appContainer) {
|
||||
return Refuse(Reason::kTargetAppContainer, nullptr, "the target's token is an AppContainer's");
|
||||
}
|
||||
if (const char* mitigation = BlockingMitigation(facts); mitigation != nullptr) {
|
||||
return Refuse(Reason::kTargetMitigation, nullptr, mitigation);
|
||||
}
|
||||
return Allow();
|
||||
}
|
||||
|
||||
Verdict GuardedInjectImpl(std::uint32_t targetPid, const wchar_t* dllPath, const Sources& sources,
|
||||
const char* toleratedFamilies) noexcept {
|
||||
const Verdict v = EvaluateImpl(targetPid, sources, toleratedFamilies);
|
||||
@@ -768,6 +816,15 @@ Verdict GuardedInjectImpl(std::uint32_t targetPid, const wchar_t* dllPath, const
|
||||
return Refuse(Reason::kPayloadNotOurs, nullptr, "the payload is not one of FrameLedger's own binaries");
|
||||
}
|
||||
|
||||
// beta.33 (D78) -- the last question before the primitive: can the target take the Overlay at all? Its token and
|
||||
// its mitigation policies answer, and a refusal names which. AFTER the payload checks, so a misuse of the exported
|
||||
// ABI is reported as one whatever the target; BEFORE the primitive, which still answers bitness itself -- a 32-bit
|
||||
// target under none of these policies reaches it and is kTargetIsWow64 as before.
|
||||
const Verdict isolation = TargetIsolationVerdict(targetPid, sources);
|
||||
if (!isolation.Allowed()) {
|
||||
return isolation;
|
||||
}
|
||||
|
||||
// Injection failing is not a guard refusal — the gate passed — but it is
|
||||
// also NOT an allow. Allowed() means "the DLL is loaded in the target",
|
||||
// which is the only reading a caller can act on. The reason says whose
|
||||
|
||||
@@ -938,6 +938,71 @@ Collected ModuleSignerOrganisationImpl(const wchar_t* modulePath, char* out, std
|
||||
return ReadSignerOrganisation(modulePath, out, cap) ? Collected::kOk : Collected::kFailed;
|
||||
}
|
||||
|
||||
// beta.33 (D78) -- one mitigation policy, read into its winnt.h structure. A policy this Windows does not know answers
|
||||
// ERROR_INVALID_PARAMETER (measured 2026-11-03 with a value no Windows defines) and cannot be in effect: the structure
|
||||
// stays zero and the read counts as answered. Every other failure is a failure.
|
||||
template <typename Policy>
|
||||
bool ReadMitigation(HANDLE proc, PROCESS_MITIGATION_POLICY which, Policy* policy) noexcept {
|
||||
*policy = Policy{};
|
||||
if (GetProcessMitigationPolicy(proc, which, policy, sizeof(Policy))) {
|
||||
return true;
|
||||
}
|
||||
return GetLastError() == ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// beta.33 (D78) -- the target's own token and four of its mitigation policies. spike-notes §25 read them on the owner's
|
||||
// eleven GDK titles and every process of their launch chains: full trust, none of the four. One
|
||||
// PROCESS_QUERY_LIMITED_INFORMATION handle answers both questions (measured: GetProcessMitigationPolicy needs no more,
|
||||
// and OpenProcessToken asks exactly that right).
|
||||
Collected TargetIsolationFactsImpl(std::uint32_t pid, TargetIsolation* out) noexcept {
|
||||
if (out == nullptr) {
|
||||
return Collected::kFailed;
|
||||
}
|
||||
*out = TargetIsolation{};
|
||||
|
||||
HANDLE proc = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid);
|
||||
if (proc == nullptr) {
|
||||
return Collected::kFailed; // ACCESS_DENIED on a protected target, or gone: cannot determine
|
||||
}
|
||||
|
||||
bool read = false;
|
||||
HANDLE token = nullptr;
|
||||
if (OpenProcessToken(proc, TOKEN_QUERY, &token)) {
|
||||
DWORD isAppContainer = 0;
|
||||
DWORD returned = 0;
|
||||
read = GetTokenInformation(token, TokenIsAppContainer, &isAppContainer, sizeof(isAppContainer), &returned) &&
|
||||
returned == sizeof(isAppContainer);
|
||||
out->appContainer = isAppContainer != 0;
|
||||
CloseHandle(token);
|
||||
}
|
||||
|
||||
PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY signature{};
|
||||
PROCESS_MITIGATION_DYNAMIC_CODE_POLICY dynamicCode{};
|
||||
PROCESS_MITIGATION_USER_SHADOW_STACK_POLICY shadowStack{};
|
||||
PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY cfg{};
|
||||
read = read && ReadMitigation(proc, ProcessSignaturePolicy, &signature) &&
|
||||
ReadMitigation(proc, ProcessDynamicCodePolicy, &dynamicCode) &&
|
||||
ReadMitigation(proc, ProcessUserShadowStackPolicy, &shadowStack) &&
|
||||
ReadMitigation(proc, ProcessControlFlowGuardPolicy, &cfg);
|
||||
CloseHandle(proc);
|
||||
if (!read) {
|
||||
*out = TargetIsolation{};
|
||||
return Collected::kFailed;
|
||||
}
|
||||
|
||||
// The enforcing flags only. Audit* records what WOULD be refused and refuses nothing, and SetContextIpValidation
|
||||
// without strict mode is what every CET-compatible process carries (measured: pwsh.exe 0x105) -- refusing on it
|
||||
// would refuse games that work today.
|
||||
out->microsoftSignedOnly = signature.MicrosoftSignedOnly != 0;
|
||||
out->storeSignedOnly = signature.StoreSignedOnly != 0;
|
||||
out->dynamicCodeProhibited = dynamicCode.ProhibitDynamicCode != 0;
|
||||
out->shadowStackStrict = shadowStack.EnableUserShadowStack != 0 && shadowStack.EnableUserShadowStackStrictMode != 0;
|
||||
out->shadowStackBlocksNonCet =
|
||||
shadowStack.BlockNonCetBinaries != 0 || shadowStack.BlockNonCetBinariesNonEhcont != 0;
|
||||
out->cfgStrict = cfg.StrictMode != 0;
|
||||
return Collected::kOk;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
std::uint64_t ProcessCreatedAt(std::uint32_t pid) noexcept {
|
||||
@@ -975,6 +1040,7 @@ Sources SystemSources() noexcept {
|
||||
// §S19(b), the embedded half only. The catalog half is a deferral with a
|
||||
// written rationale, not a gap nobody noticed.
|
||||
s.ModuleSignerOrganisation = &ModuleSignerOrganisationImpl;
|
||||
s.TargetIsolationFacts = &TargetIsolationFactsImpl;
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
// windows.h stays in its own block above the sorted group, as fl_ac_rules.cpp does: WideCharToMultiByte (the one
|
||||
// Win32 call here, for the executable's leaf name) needs it.
|
||||
// windows.h stays in its own block above the sorted group, as fl_ac_rules.cpp does: WideCharToMultiByte (for the
|
||||
// executable's leaf name) and GetFileAttributesW (a GDK package root's two files, beta.33) need it.
|
||||
#include <windows.h>
|
||||
|
||||
#include <cstring>
|
||||
#include <cwchar>
|
||||
#include <fl_prescan.h>
|
||||
#include <string_view>
|
||||
|
||||
namespace fl::guard {
|
||||
namespace {
|
||||
@@ -272,6 +273,29 @@ Verdict PreScanGameWith(const wchar_t* exePath, const Sources& s, const char* to
|
||||
return finding.seen ? ToleratedVerdict(finding) : Passed();
|
||||
}
|
||||
|
||||
// A GDK package root (beta.33, spike-notes §25): the folder holding both `MicrosoftGame.config` and `appxmanifest.xml`
|
||||
// as files. `folder` is the first `len` characters of a path; the probe path is built on the stack. A probe that fails
|
||||
// — too long, absent, a directory, unreadable — is not a root.
|
||||
bool IsGdkPackageRoot(const wchar_t* folder, std::size_t len) noexcept {
|
||||
// Lengths known at compile time: no strlen-family call on a name (SonarCloud cpp:S5813, PR-1).
|
||||
static constexpr std::wstring_view kFiles[] = {L"MicrosoftGame.config", L"appxmanifest.xml"};
|
||||
for (const std::wstring_view file : kFiles) {
|
||||
wchar_t probe[kMaxPreScanPathLen] = {};
|
||||
if (len + 1 + file.size() + 1 > kMaxPreScanPathLen) {
|
||||
return false;
|
||||
}
|
||||
std::wmemcpy(probe, folder, len);
|
||||
probe[len] = L'\\';
|
||||
std::wmemcpy(probe + len + 1, file.data(), file.size());
|
||||
probe[len + 1 + file.size()] = L'\0';
|
||||
const DWORD attrs = GetFileAttributesW(probe);
|
||||
if (attrs == INVALID_FILE_ATTRIBUTES || (attrs & FILE_ATTRIBUTE_DIRECTORY) != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool ResolveInstallRoot(const wchar_t* exeDir, wchar_t* out, std::size_t cap) noexcept {
|
||||
@@ -306,10 +330,13 @@ bool ResolveInstallRoot(const wchar_t* exeDir, wchar_t* out, std::size_t cap) no
|
||||
const wchar_t* seg[2];
|
||||
std::size_t len;
|
||||
};
|
||||
// `GamesInstalled` joined on 2026-11-03 (beta.33): the managed resolver had it since #17 and this one never did, so
|
||||
// detection and check 4 walked different folders for a game under one. More is walked here now, never less.
|
||||
static const Boundary kBoundaries[] = {
|
||||
{{L"steamapps", L"common"}, 2},
|
||||
{{L"GOG Galaxy", L"Games"}, 2},
|
||||
{{L"Epic Games", nullptr}, 1},
|
||||
{{L"GamesInstalled", nullptr}, 1},
|
||||
};
|
||||
|
||||
for (const Boundary& b : kBoundaries) {
|
||||
@@ -333,7 +360,26 @@ bool ResolveInstallRoot(const wchar_t* exeDir, wchar_t* out, std::size_t cap) no
|
||||
}
|
||||
}
|
||||
|
||||
// No boundary recognised: the executable's own directory, unchanged.
|
||||
// No string boundary: a GDK package root at or above the executable's folder (beta.33, spike-notes §25). The Xbox
|
||||
// app installs to <games folder>\<Game>\Content\ under a folder the user names, so no string bounds it; the package
|
||||
// marks its own root. Asked only here — after every string boundary missed — so it widens the walk relative to the
|
||||
// exe's own folder, never narrows it; the nearest one wins, at most kMaxGdkLevelsUp levels up, and never a drive's
|
||||
// root (two segments at least). Without it an Unreal title's Content\<Project>\Binaries\WinGDK was all check 4 saw.
|
||||
constexpr std::size_t kMaxGdkLevelsUp = 8;
|
||||
for (std::size_t up = 0; up <= kMaxGdkLevelsUp && up + 2 <= count; ++up) {
|
||||
const auto n = static_cast<std::size_t>(ends[count - 1 - up] - exeDir);
|
||||
if (!IsGdkPackageRoot(exeDir, n)) {
|
||||
continue;
|
||||
}
|
||||
if (n + 1 > cap) {
|
||||
return false; // a truncated path is a path to somewhere else
|
||||
}
|
||||
std::wmemcpy(out, exeDir, n);
|
||||
out[n] = L'\0';
|
||||
return true;
|
||||
}
|
||||
|
||||
// Nothing recognised: the executable's own directory, unchanged.
|
||||
if (wcslen(exeDir) + 1 > cap) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -120,6 +120,9 @@ add_custom_target(fl_stage_overlay_payload DEPENDS "${FL_STAGED_OVERLAY}")
|
||||
|
||||
target_compile_definitions(fl_guard_test PRIVATE
|
||||
FL_HARNESS_EXE=L"$<TARGET_FILE:hook-harness>"
|
||||
# The install-root cases the managed InstallRootCasesTests read too (beta.33): one list, so the two resolvers
|
||||
# cannot answer a layout differently without one of the two suites going red.
|
||||
FL_INSTALL_ROOT_CASES=L"${CMAKE_SOURCE_DIR}/../../tests/fixtures/install-roots/cases.txt"
|
||||
# The extent hook-harness tags, from src/native/CMakeLists.txt. Shared rather
|
||||
# than retyped: a fixture and its assertion holding separate copies of the
|
||||
# number under test is how a test starts proving something else.
|
||||
|
||||
@@ -209,6 +209,15 @@ struct Fake {
|
||||
kCannotTell, // force kFailed
|
||||
};
|
||||
Payload payload = Payload::kReal;
|
||||
|
||||
// beta.33 (D78) — the target isolation seam. DEFAULTS TO THE REAL IMPLEMENTATION, as the payload seam does and for
|
||||
// its reason: every injection case in this file then also proves the real seam reads a plain process — the harness,
|
||||
// a 32-bit cmd, this test — as clear, which is the green direction of kTargetAppContainer and kTargetMitigation for
|
||||
// free. `isolationReal = false` answers with `isolation` and `isolationResult` instead.
|
||||
bool isolationReal = true;
|
||||
TargetIsolation isolation;
|
||||
Collected isolationResult = Collected::kOk;
|
||||
int isolationCalls = 0;
|
||||
};
|
||||
|
||||
Fake g;
|
||||
@@ -432,6 +441,15 @@ Collected FakePayloadIsOurOwn(const wchar_t* dllPath, bool* isOurs) {
|
||||
}
|
||||
}
|
||||
|
||||
Collected FakeTargetIsolationFacts(std::uint32_t pid, TargetIsolation* out) {
|
||||
++g.isolationCalls;
|
||||
if (g.isolationReal) {
|
||||
return SystemSources().TargetIsolationFacts(pid, out);
|
||||
}
|
||||
*out = g.isolation;
|
||||
return g.isolationResult;
|
||||
}
|
||||
|
||||
Sources FakeSources() {
|
||||
Sources s;
|
||||
s.ReadRulesFile = &FakeReadRules;
|
||||
@@ -447,6 +465,7 @@ Sources FakeSources() {
|
||||
s.ModuleIsOurOwn = &FakeModuleIsOurOwn;
|
||||
s.PayloadIsOurOwn = &FakePayloadIsOurOwn;
|
||||
s.ModuleSignerOrganisation = &FakeModuleSignerOrganisation;
|
||||
s.TargetIsolationFacts = &FakeTargetIsolationFacts;
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -3700,6 +3719,205 @@ TEST_CASE("the payload check can PASS — the staged Overlay is accepted", "[gua
|
||||
CHECK(SystemSources().PayloadIsOurOwn(FL_OVERLAY_DLL, nullptr) == Collected::kFailed);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// beta.33 (D78) — can the target take the Overlay at all? Its token and its
|
||||
// mitigation policies, asked as the last question before the primitive
|
||||
// (kTargetAppContainer, kTargetMitigation). Neither is a finding: no family, and
|
||||
// nothing is loaded.
|
||||
// ===========================================================================
|
||||
namespace {
|
||||
|
||||
// A child of this test started under the creation-time mitigation policies in `policy`, suspended and inert. cmd.exe
|
||||
// is Microsoft-signed, so a signature policy lets it start. Child's destructor ends it.
|
||||
bool StartMitigatedChild(Child& child, DWORD64 policy) {
|
||||
SIZE_T size = 0;
|
||||
InitializeProcThreadAttributeList(nullptr, 1, 0, &size);
|
||||
std::vector<unsigned char> buffer(size);
|
||||
auto* list = reinterpret_cast<LPPROC_THREAD_ATTRIBUTE_LIST>(buffer.data());
|
||||
if (size == 0 || !InitializeProcThreadAttributeList(list, 1, 0, &size)) {
|
||||
return false;
|
||||
}
|
||||
bool started = false;
|
||||
if (UpdateProcThreadAttribute(list, 0, PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY, &policy, sizeof(policy), nullptr,
|
||||
nullptr)) {
|
||||
wchar_t sys[MAX_PATH]{};
|
||||
GetSystemDirectoryW(sys, MAX_PATH);
|
||||
const std::wstring cmd = std::wstring(sys) + L"\\cmd.exe";
|
||||
std::wstring line = L"\"" + cmd + L"\" /c pause";
|
||||
STARTUPINFOEXW si{};
|
||||
si.StartupInfo.cb = sizeof(si);
|
||||
si.lpAttributeList = list;
|
||||
started = CreateProcessW(cmd.c_str(), line.data(), nullptr, nullptr, FALSE,
|
||||
CREATE_SUSPENDED | CREATE_NO_WINDOW | EXTENDED_STARTUPINFO_PRESENT, nullptr, nullptr,
|
||||
&si.StartupInfo, &child.pi) != 0;
|
||||
}
|
||||
DeleteProcThreadAttributeList(list);
|
||||
return started;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
TEST_CASE("an AppContainer target is refused by its own reason, and nothing is loaded", "[guard][inject][isolation]") {
|
||||
Child child;
|
||||
REQUIRE(StartHarness(child));
|
||||
|
||||
ResetFake();
|
||||
g.modules = {"kernel32.dll"};
|
||||
g.scanSet = {child.pi.dwProcessId};
|
||||
g.isolationReal = false;
|
||||
g.isolation.appContainer = true;
|
||||
|
||||
const Verdict v = GuardedInjectWithSources(child.pi.dwProcessId, FL_OVERLAY_DLL, FakeSources());
|
||||
INFO("reason " << ReasonName(v.reason) << " signal=" << v.signal);
|
||||
CHECK_FALSE(v.Allowed());
|
||||
CHECK(v.reason == Reason::kTargetAppContainer);
|
||||
CHECK(v.family[0] == '\0'); // not an anti-cheat finding: no family, so nothing is written to the game
|
||||
CHECK_FALSE(TargetHasModule(child.pi.dwProcessId, L"FrameLedger.Overlay.dll"));
|
||||
}
|
||||
|
||||
TEST_CASE("each blocking mitigation refuses as kTargetMitigation and names its policy", "[guard][inject][isolation]") {
|
||||
// One target for every case: a refusal here never touches the target, which the last line checks.
|
||||
Child child;
|
||||
REQUIRE(StartHarness(child));
|
||||
|
||||
struct Case {
|
||||
bool TargetIsolation::* flag;
|
||||
const char* named;
|
||||
};
|
||||
const Case cases[] = {
|
||||
{&TargetIsolation::microsoftSignedOnly, "Microsoft-signed"},
|
||||
{&TargetIsolation::storeSignedOnly, "Store-signed"},
|
||||
{&TargetIsolation::dynamicCodeProhibited, "dynamic code prohibited"},
|
||||
{&TargetIsolation::shadowStackStrict, "shadow stack policy: strict mode"},
|
||||
{&TargetIsolation::shadowStackBlocksNonCet, "CET-compatible"},
|
||||
{&TargetIsolation::cfgStrict, "Control Flow Guard policy: strict mode"},
|
||||
};
|
||||
for (const Case& c : cases) {
|
||||
ResetFake();
|
||||
g.modules = {"kernel32.dll"};
|
||||
g.scanSet = {child.pi.dwProcessId};
|
||||
g.isolationReal = false;
|
||||
g.isolation.*(c.flag) = true;
|
||||
|
||||
const Verdict v = GuardedInjectWithSources(child.pi.dwProcessId, FL_OVERLAY_DLL, FakeSources());
|
||||
INFO("expected '" << c.named << "', got " << ReasonName(v.reason) << " signal=" << v.signal);
|
||||
CHECK(v.reason == Reason::kTargetMitigation);
|
||||
CHECK(std::string(v.signal).find(c.named) != std::string::npos);
|
||||
CHECK(v.family[0] == '\0');
|
||||
}
|
||||
CHECK_FALSE(TargetHasModule(child.pi.dwProcessId, L"FrameLedger.Overlay.dll"));
|
||||
}
|
||||
|
||||
TEST_CASE("an isolation seam that cannot answer refuses, and so does a guard wired without one",
|
||||
"[guard][inject][isolation][failclosed]") {
|
||||
Child child;
|
||||
REQUIRE(StartHarness(child));
|
||||
|
||||
// Every fact clear beside a failed result: the result is what is honoured, never the facts next to it.
|
||||
for (const Collected bad : {Collected::kFailed, Collected::kIncomplete, Collected::kRetry}) {
|
||||
ResetFake();
|
||||
g.modules = {"kernel32.dll"};
|
||||
g.scanSet = {child.pi.dwProcessId};
|
||||
g.isolationReal = false;
|
||||
g.isolationResult = bad;
|
||||
|
||||
const Verdict v = GuardedInjectWithSources(child.pi.dwProcessId, FL_OVERLAY_DLL, FakeSources());
|
||||
INFO("reason " << ReasonName(v.reason) << " signal=" << v.signal);
|
||||
CHECK(v.reason == Reason::kProcessUnreadable);
|
||||
}
|
||||
|
||||
// Sources members default to nullptr: forgetting to wire this must refuse, never load.
|
||||
ResetFake();
|
||||
g.modules = {"kernel32.dll"};
|
||||
g.scanSet = {child.pi.dwProcessId};
|
||||
Sources s = FakeSources();
|
||||
s.TargetIsolationFacts = nullptr;
|
||||
const Verdict unwired = GuardedInjectWithSources(child.pi.dwProcessId, FL_OVERLAY_DLL, s);
|
||||
CHECK(unwired.reason == Reason::kProcessUnreadable);
|
||||
CHECK(std::string(unwired.signal) == "no target isolation source");
|
||||
|
||||
CHECK_FALSE(TargetHasModule(child.pi.dwProcessId, L"FrameLedger.Overlay.dll"));
|
||||
}
|
||||
|
||||
TEST_CASE("the isolation check comes after the guard and the payload, and the re-scan never asks it",
|
||||
"[guard][inject][isolation]") {
|
||||
// A blocked target outranks it: anti-cheat in the target is the fact that matters.
|
||||
ResetFake();
|
||||
g.modules = {"kernel32.dll", "BEClient_x64.dll"};
|
||||
g.scanSet = {GetCurrentProcessId()};
|
||||
g.isolationReal = false;
|
||||
g.isolation.appContainer = true;
|
||||
CHECK(GuardedInjectWithSources(GetCurrentProcessId(), FL_OVERLAY_DLL, FakeSources()).reason ==
|
||||
Reason::kBlockedModule);
|
||||
CHECK(g.isolationCalls == 0);
|
||||
|
||||
// So does a foreign payload: a misuse of the exported ABI is reported as one, whatever the target.
|
||||
ResetFake();
|
||||
g.modules = {"kernel32.dll"};
|
||||
g.scanSet = {GetCurrentProcessId()};
|
||||
g.payload = Fake::Payload::kForeign;
|
||||
g.isolationReal = false;
|
||||
g.isolation.appContainer = true;
|
||||
CHECK(GuardedInjectWithSources(GetCurrentProcessId(), FL_OVERLAY_DLL, FakeSources()).reason ==
|
||||
Reason::kPayloadNotOurs);
|
||||
CHECK(g.isolationCalls == 0);
|
||||
|
||||
// The 30 s re-scan evaluates a process the Overlay is already in: the question was answered before it loaded.
|
||||
ResetFake();
|
||||
g.isolationReal = false;
|
||||
g.isolation.appContainer = true;
|
||||
CHECK(EvaluateWithSources(1234, FakeSources()).Allowed());
|
||||
CHECK(g.isolationCalls == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("the real isolation seam reads a plain desktop process as clear", "[guard][inject][isolation]") {
|
||||
// This test: full trust, not CET-compatible, Control Flow Guard on but not strict.
|
||||
TargetIsolation facts;
|
||||
facts.appContainer = true; // the seam writes every field, not only the ones it finds set
|
||||
REQUIRE(SystemSources().TargetIsolationFacts(GetCurrentProcessId(), &facts) == Collected::kOk);
|
||||
CHECK_FALSE(facts.appContainer);
|
||||
CHECK_FALSE(facts.microsoftSignedOnly);
|
||||
CHECK_FALSE(facts.storeSignedOnly);
|
||||
CHECK_FALSE(facts.dynamicCodeProhibited);
|
||||
CHECK_FALSE(facts.shadowStackStrict);
|
||||
CHECK_FALSE(facts.shadowStackBlocksNonCet);
|
||||
CHECK_FALSE(facts.cfgStrict);
|
||||
|
||||
// A process that does not exist cannot be answered, and a null out-param is the caller getting it wrong.
|
||||
TargetIsolation none;
|
||||
CHECK(SystemSources().TargetIsolationFacts(0x7FFFFFFCu, &none) == Collected::kFailed);
|
||||
CHECK(SystemSources().TargetIsolationFacts(GetCurrentProcessId(), nullptr) == Collected::kFailed);
|
||||
}
|
||||
|
||||
TEST_CASE("the real isolation seam reads the policies a process was started under", "[guard][inject][isolation]") {
|
||||
// Against Windows, not a fake: a child started with "no dynamic code" and "Microsoft-signed images only" -- two
|
||||
// policies every supported Windows can start a process under, unlike strict CFG or a shadow stack, which need a
|
||||
// newer build or CET hardware -- reads as exactly those two.
|
||||
Child child;
|
||||
REQUIRE(StartMitigatedChild(child, PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_ALWAYS_ON |
|
||||
PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_ON));
|
||||
|
||||
TargetIsolation facts;
|
||||
REQUIRE(SystemSources().TargetIsolationFacts(child.pi.dwProcessId, &facts) == Collected::kOk);
|
||||
CHECK(facts.dynamicCodeProhibited);
|
||||
CHECK(facts.microsoftSignedOnly);
|
||||
CHECK_FALSE(facts.appContainer);
|
||||
CHECK_FALSE(facts.storeSignedOnly);
|
||||
CHECK_FALSE(facts.shadowStackStrict);
|
||||
CHECK_FALSE(facts.shadowStackBlocksNonCet);
|
||||
CHECK_FALSE(facts.cfgStrict);
|
||||
|
||||
// ...and the guard, through the seam it ships with, refuses it by that reason, naming the first policy.
|
||||
ResetFake();
|
||||
g.modules = {"kernel32.dll"};
|
||||
g.scanSet = {child.pi.dwProcessId};
|
||||
const Verdict v = GuardedInjectWithSources(child.pi.dwProcessId, FL_OVERLAY_DLL, FakeSources());
|
||||
INFO("reason " << ReasonName(v.reason) << " signal=" << v.signal);
|
||||
CHECK(v.reason == Reason::kTargetMitigation);
|
||||
CHECK(std::string(v.signal).find("Microsoft-signed") != std::string::npos);
|
||||
CHECK(v.family[0] == '\0');
|
||||
}
|
||||
|
||||
#endif // FL_HARNESS_EXE && FL_OVERLAY_DLL
|
||||
|
||||
// ===========================================================================
|
||||
@@ -3961,6 +4179,145 @@ TEST_CASE("an unrecognised layout keeps the exe's own directory", "[guard][presc
|
||||
CHECK_FALSE(ResolveInstallRoot(nullptr, out, kMaxPreScanPathLen));
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// The shared install-root cases (beta.33): tests/fixtures/install-roots/cases.txt, read here and by the managed
|
||||
// InstallRootCasesTests, so ResolveInstallRoot and InstallRoot.Resolve cannot drift apart again — they had, over
|
||||
// `GamesInstalled`, since #17. A GDK package root is marked by FILES, so each case builds its tree in a temp folder.
|
||||
// ===========================================================================
|
||||
namespace {
|
||||
|
||||
struct InstallRootCase {
|
||||
std::wstring files;
|
||||
std::wstring exe;
|
||||
std::wstring root;
|
||||
};
|
||||
|
||||
// The case file is ASCII (its own header says so); Narrow, its inverse, is the log tests' above.
|
||||
std::wstring Widen(const std::string& ascii) {
|
||||
std::wstring w;
|
||||
for (char ch : ascii) {
|
||||
w.push_back(static_cast<wchar_t>(static_cast<unsigned char>(ch)));
|
||||
}
|
||||
return w;
|
||||
}
|
||||
|
||||
std::vector<InstallRootCase> ReadInstallRootCases() {
|
||||
FILE* f = nullptr;
|
||||
REQUIRE(_wfopen_s(&f, FL_INSTALL_ROOT_CASES, L"rb") == 0);
|
||||
REQUIRE(f != nullptr);
|
||||
std::string text;
|
||||
char chunk[4096];
|
||||
std::size_t got = 0;
|
||||
while ((got = std::fread(chunk, 1, sizeof(chunk), f)) > 0) {
|
||||
text.append(chunk, got);
|
||||
}
|
||||
std::fclose(f);
|
||||
|
||||
std::vector<InstallRootCase> cases;
|
||||
std::size_t start = 0;
|
||||
while (start < text.size()) {
|
||||
std::size_t end = text.find('\n', start);
|
||||
if (end == std::string::npos) {
|
||||
end = text.size();
|
||||
}
|
||||
std::string line = text.substr(start, end - start);
|
||||
start = end + 1;
|
||||
if (!line.empty() && line.back() == '\r') {
|
||||
line.pop_back();
|
||||
}
|
||||
if (line.empty() || line[0] == '#') {
|
||||
continue;
|
||||
}
|
||||
const std::size_t a = line.find('|');
|
||||
const std::size_t b = (a == std::string::npos) ? std::string::npos : line.find('|', a + 1);
|
||||
INFO("case line: " << line);
|
||||
REQUIRE(b != std::string::npos);
|
||||
cases.push_back({Widen(line.substr(0, a)), Widen(line.substr(a + 1, b - a - 1)), Widen(line.substr(b + 1))});
|
||||
}
|
||||
return cases;
|
||||
}
|
||||
|
||||
void MakeFolders(const std::wstring& dir) {
|
||||
for (std::size_t i = 3; i <= dir.size(); ++i) { // past "C:\"
|
||||
if (i == dir.size() || dir[i] == L'\\') {
|
||||
static_cast<void>(CreateDirectoryW(dir.substr(0, i).c_str(), nullptr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveFolderTree(const std::wstring& dir) {
|
||||
WIN32_FIND_DATAW fd{};
|
||||
HANDLE h = FindFirstFileW((dir + L"\\*").c_str(), &fd);
|
||||
if (h != INVALID_HANDLE_VALUE) {
|
||||
do {
|
||||
const std::wstring name = fd.cFileName;
|
||||
if (name == L"." || name == L"..") {
|
||||
continue;
|
||||
}
|
||||
const std::wstring path = dir + L"\\" + name;
|
||||
if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
|
||||
RemoveFolderTree(path);
|
||||
} else {
|
||||
static_cast<void>(DeleteFileW(path.c_str()));
|
||||
}
|
||||
} while (FindNextFileW(h, &fd) != 0);
|
||||
FindClose(h);
|
||||
}
|
||||
static_cast<void>(RemoveDirectoryW(dir.c_str()));
|
||||
}
|
||||
|
||||
void WriteEmptyFile(const std::wstring& path) {
|
||||
HANDLE h = CreateFileW(path.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
REQUIRE(h != INVALID_HANDLE_VALUE);
|
||||
CloseHandle(h);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
TEST_CASE("the shared install-root cases resolve as the managed resolver resolves them", "[guard][prescan]") {
|
||||
const std::vector<InstallRootCase> cases = ReadInstallRootCases();
|
||||
REQUIRE(cases.size() >= 10); // an empty list is a green test that compared nothing
|
||||
|
||||
wchar_t base[MAX_PATH] = {};
|
||||
REQUIRE(GetTempPathW(MAX_PATH, base) > 0);
|
||||
int index = 0;
|
||||
for (const InstallRootCase& c : cases) {
|
||||
const std::wstring temp = std::wstring(base) + L"fl_roots_" + std::to_wstring(GetCurrentProcessId()) + L"_" +
|
||||
std::to_wstring(index++);
|
||||
RemoveFolderTree(temp);
|
||||
MakeFolders(temp);
|
||||
|
||||
std::size_t start = 0;
|
||||
while (start < c.files.size()) {
|
||||
std::size_t end = c.files.find(L';', start);
|
||||
if (end == std::wstring::npos) {
|
||||
end = c.files.size();
|
||||
}
|
||||
const std::wstring item = c.files.substr(start, end - start);
|
||||
start = end + 1;
|
||||
if (item.empty()) {
|
||||
continue;
|
||||
}
|
||||
const std::wstring path = temp + L"\\" + item;
|
||||
if (path.back() == L'\\') {
|
||||
MakeFolders(path.substr(0, path.size() - 1));
|
||||
} else {
|
||||
MakeFolders(path.substr(0, path.rfind(L'\\')));
|
||||
WriteEmptyFile(path);
|
||||
}
|
||||
}
|
||||
|
||||
const std::wstring exe = temp + L"\\" + c.exe;
|
||||
const std::wstring exeDir = exe.substr(0, exe.rfind(L'\\'));
|
||||
wchar_t out[kMaxPreScanPathLen] = {};
|
||||
INFO("case " << index << ": " << Narrow(c.exe));
|
||||
const bool resolved = ResolveInstallRoot(exeDir.c_str(), out, kMaxPreScanPathLen);
|
||||
RemoveFolderTree(temp);
|
||||
REQUIRE(resolved);
|
||||
CHECK(Narrow(out) == Narrow(temp + L"\\" + c.root));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("the advisory pre-scan reaches the same verdict as the one inside the guard", "[guard][prescan]") {
|
||||
// FR-2.2's UI question. Same matcher, same polarity — the only difference is
|
||||
// that it takes the executable's path instead of a pid.
|
||||
|
||||
@@ -157,6 +157,7 @@ public sealed class FormatsTests
|
||||
InEnglish(() => Formats.ExitStatusText(ExitStatus.Crashed)).Should().Be("crashed");
|
||||
InEnglish(() => Formats.ExitStatusText(ExitStatus.UnhookedSafety)).Should().Be("unhooked (safety)");
|
||||
Formats.Platform("steam").Should().Be("Steam");
|
||||
Formats.Platform("xbox").Should().Be("Xbox", "beta.33, D79: the Xbox app and the Microsoft Store");
|
||||
Formats.Platform("none").Should().BeEmpty();
|
||||
}
|
||||
|
||||
@@ -183,6 +184,7 @@ public sealed class FormatsTests
|
||||
Formats.StoreVersion("steam", "20374416", detected: true).Should().Be("Steam build 20374416");
|
||||
Formats.StoreVersion("gog", "1.2.3", detected: true).Should().Be("GOG version 1.2.3");
|
||||
Formats.StoreVersion("epic", "++Fortnite+Release-31.10", detected: true).Should().Be("Epic version ++Fortnite+Release-31.10");
|
||||
Formats.StoreVersion("xbox", "1.3.5124.0", detected: true).Should().Be("Xbox version 1.3.5124.0", "the package version an import read");
|
||||
Formats.StoreVersion("itch", "0.9", detected: true).Should().Be("0.9", "itch has no store version to label");
|
||||
Formats.StoreVersion("steam", "1.04 (my patch)", detected: false).Should().Be("1.04 (my patch)", "the user's words are theirs");
|
||||
Formats.StoreVersion("steam", " ", detected: true).Should().BeNull();
|
||||
|
||||
@@ -80,6 +80,43 @@ public sealed class GameArtTests : IDisposable
|
||||
gone.Source.Should().Be(Strings.Art_Source_Steam);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AnXboxGamesSquareLogoIsItsCoverDrawnSquareAndItsSplashTheBanner()
|
||||
{
|
||||
// beta.33: what an Xbox game ships in its own package folder (spike-notes §25) — a 480x480 logo, a 1920x1080 splash.
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
string content = Path.Combine(_dir, "xbox", "Valor Mortis", "Content");
|
||||
GameRow game = await s.GameAsync("Valor Mortis", Path.Combine(content, "ValorMortis", "Binaries", "Win64", "ValorMortisMSG-Win64-Shipping.exe"));
|
||||
string logo = TestImages.Write(Path.Combine(content, "Resources", "Square480x480Logo.png"), TestImages.Png(48, 48, Color.FromRgb(30, 30, 160)));
|
||||
string splash = TestImages.Write(Path.Combine(content, "Resources", "SplashScreen.png"), TestImages.Png(96, 54, Color.FromRgb(160, 30, 30)));
|
||||
var store = new TestImages.Store("xbox", new StoreGame("xbox", "LyricalGamesLLC.ValorMortis_72fag5ekhk96y", "Valor Mortis", content, null, null));
|
||||
var cache = new TestImages.ArtCache("xbox", "LyricalGamesLLC.ValorMortis_72fag5ekhk96y", new GameArtFiles(null, splash, splash, logo));
|
||||
|
||||
GameArtView view = (await Art(new MemorySettings(), store, cache).ForAsync(game, Ct))!;
|
||||
|
||||
view.Cover.Should().NotBeNull();
|
||||
view.CoverIsSquare.Should().BeTrue("the logo is drawn whole in a square slot, never cropped to a portrait");
|
||||
view.CoverIsLandscape.Should().BeFalse("the splash is the banner; the square logo comes before the landscape header");
|
||||
view.Hero.Should().NotBeNull();
|
||||
view.Source.Should().Be(Strings.Art_Source_Xbox);
|
||||
view.Tint!.Value.B.Should().BeGreaterThan(view.Tint.Value.R, "the band takes the logo's colour, the cover slot's image");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AGogGamesArtIsSaidAsGalaxys()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
string install = Path.Combine(_dir, "gog", "A Space for the Unbound");
|
||||
GameRow game = await s.GameAsync("A Space for the Unbound", Path.Combine(install, "A Space for the Unbound.exe"));
|
||||
string cover = TestImages.Write(Path.Combine(_dir, "galaxy", "cover.png"), TestImages.Png(30, 45, Color.FromRgb(40, 160, 40)));
|
||||
var store = new TestImages.Store("gog", new StoreGame("gog", "1125815775", "A Space for the Unbound", install, null, null));
|
||||
|
||||
GameArtView view = (await Art(new MemorySettings(), store, new TestImages.ArtCache("gog", "1125815775", new GameArtFiles(cover, null, null))).ForAsync(game, Ct))!;
|
||||
|
||||
view.Source.Should().Be(Strings.Art_Source_Gog);
|
||||
view.CoverIsSquare.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("C:\\Windows\\Web\\Wallpaper\\img0.jpg")]
|
||||
[InlineData("\\\\server\\share\\x.png")]
|
||||
|
||||
@@ -261,6 +261,76 @@ public sealed class GamePlayerTests
|
||||
.SteamGame.Should().BeFalse("only Steam's games hand themselves to their store");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.33 (D80): a game the Xbox app installed starts through Windows — its package activated as its Start-menu tile
|
||||
/// does — in either mode, and from an App running as administrator too: the user's shell activates it, unelevated. The
|
||||
/// agent is never asked to start it by its path, which is never the game in its package (spike-notes §25).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task AnXboxGameStartsThroughWindowsInEitherModeAndFromAnAdministrator()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
const string content = @"D:\xbox\FINAL FANTASY\Content";
|
||||
const string family = "39EA002F.FF1DF_n746a19ndrrjg";
|
||||
var xbox = new Stores(new StoreGame("xbox", family, "FINAL FANTASY", content, null, "1.2.3.0", family + "!Game"));
|
||||
GameRow game = Game(content + @"\FINAL FANTASY.exe", family);
|
||||
var agent = new Agent();
|
||||
|
||||
var shell = new Shell();
|
||||
PlayResult result = await Player(s, shell, agent, xbox).PlayAsync(game, Ct);
|
||||
result.Should().Be(new PlayResult(PlayOutcome.HandedToStore, "xbox"));
|
||||
shell.Started.Should().ContainSingle().Which.Should().Be((StoreLaunches.ExplorerPath, @"shell:AppsFolder\" + family + "!Game", (string?)null));
|
||||
GamePlayer.Describe(result, "FINAL FANTASY").Should().Be(
|
||||
("Windows is starting FINAL FANTASY through its package, as its Start-menu tile does — a game from the Xbox app always starts this way. FrameLedger records it once it appears.", false));
|
||||
|
||||
var elevated = new Shell();
|
||||
(await Player(s, elevated, agent, xbox, elevated: true).PlayAsync(game, Ct)).Should().Be(new PlayResult(PlayOutcome.HandedToStore, "xbox"));
|
||||
elevated.Started.Should().ContainSingle();
|
||||
|
||||
await new RegisteredSettings(new SqliteSettingsStore(s.Db)).SetAsync(SettingsRegistry.UiPlayMode, PlayMode.Direct, Ct);
|
||||
var direct = new Shell();
|
||||
(await Player(s, direct, agent, xbox).PlayAsync(game, Ct)).Should().Be(new PlayResult(PlayOutcome.HandedToStore, "xbox"));
|
||||
direct.Started.Should().ContainSingle();
|
||||
agent.Sent.Should().BeEmpty("no mode starts an Xbox game by its path");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AnXboxGameWindowsDidNotStartSaysWhereToStartIt()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
const string content = @"D:\xbox\Valor Mortis\Content";
|
||||
const string family = "LyricalGamesLLC.ValorMortis_72fag5ekhk96y";
|
||||
GameRow game = Game(content + @"\ValorMortis\Binaries\Win64\ValorMortisMSG-Win64-Shipping.exe", family);
|
||||
var agent = new Agent();
|
||||
|
||||
PlayResult refused = await Player(s, new Shell(takes: false), agent,
|
||||
new Stores(new StoreGame("xbox", family, "Valor Mortis", content, null, null, family + "!AppValorMortisShipping"))).PlayAsync(game, Ct);
|
||||
refused.Should().Be(new PlayResult(PlayOutcome.Failed, "xbox"));
|
||||
(string text, bool warning) = GamePlayer.Describe(refused, "Valor Mortis");
|
||||
warning.Should().BeTrue();
|
||||
text.Should().Contain("Valor Mortis").And.Contain("Xbox app");
|
||||
|
||||
PlayResult nothing = await Player(s, new Shell(), agent, new Stores(new StoreGame("xbox", family, "Valor Mortis", content, null, null))).PlayAsync(game, Ct);
|
||||
nothing.Should().Be(new PlayResult(PlayOutcome.Failed, "xbox"), "a package that names no application has nothing to activate, and its path starts nothing");
|
||||
agent.Sent.Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>beta.33: the agent refuses to start a game in an Xbox package by its path, and says so — reached only when no record named it.</summary>
|
||||
[Fact]
|
||||
public async Task TheAgentsPackagedGameAnswerSaysWhereToStartIt()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
await new RegisteredSettings(new SqliteSettingsStore(s.Db)).SetAsync(SettingsRegistry.UiPlayMode, PlayMode.Direct, Ct);
|
||||
|
||||
PlayResult result = await Player(s, new Shell(), new Agent(outcome: "PackagedGame"), new Stores())
|
||||
.PlayAsync(Game(@"D:\xbox\inKONBINI\Content\inKONBINI.exe", null), Ct);
|
||||
|
||||
result.Should().Be(new PlayResult(PlayOutcome.PackagedGame));
|
||||
(string text, bool warning) = GamePlayer.Describe(result, "inKONBINI");
|
||||
warning.Should().BeTrue();
|
||||
text.Should().Contain("inKONBINI").And.Contain("Xbox app").And.NotContain("PackagedGame");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AStoreAppWindowsWillNotOpenIsAFailureNamedAsSuch()
|
||||
{
|
||||
|
||||
@@ -90,6 +90,17 @@ public sealed class ReasonTextTests
|
||||
return 0;
|
||||
});
|
||||
|
||||
/// <summary>beta.33 (D78): a game the Overlay cannot load into at all is said as that — never as a failure the user could fix.</summary>
|
||||
[Fact]
|
||||
public void AnAppContainerOrAProtectedGameIsSaidAsWhatItIs() => InEnglish(() =>
|
||||
{
|
||||
Formats.Tier2Reason("end=RefusedByGuard; tier2: attach=NotEvaluated; guard=TargetAppContainer||the target's token is an AppContainer's")
|
||||
.Should().Be("The anti-cheat guard did not hook this game: the game runs in an app container (a Microsoft Store app, not a desktop game), which FrameLedger does not load into.");
|
||||
Formats.Tier2Reason("end=RefusedByGuard; tier2: attach=NotEvaluated; guard=TargetMitigation||dynamic code policy: dynamic code prohibited")
|
||||
.Should().Be("The anti-cheat guard did not hook this game: Windows protects the game in a way FrameLedger's component can neither load into nor hook.");
|
||||
return 0;
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void ACrashNamesItsExceptionAndEndTasksCodeIsAnOrdinaryEnd() => InEnglish(() =>
|
||||
{
|
||||
|
||||
@@ -67,10 +67,11 @@ internal static class TestImages
|
||||
|
||||
public List<string> Asked { get; } = [];
|
||||
|
||||
public GameArtFiles Find(string id)
|
||||
public GameArtFiles Find(StoreGame record)
|
||||
{
|
||||
Asked.Add(id);
|
||||
return string.Equals(id, storeId, StringComparison.Ordinal) ? files : GameArtFiles.None;
|
||||
ArgumentNullException.ThrowIfNull(record);
|
||||
Asked.Add(record.StoreId);
|
||||
return string.Equals(record.StoreId, storeId, StringComparison.Ordinal) ? files : GameArtFiles.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,6 +63,47 @@ public sealed class StoreLaunchesTests
|
||||
.Should().Be("itch://install?game_id=5015466&launch");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.33 (D80): an Xbox game is activated through its package, as its Start-menu tile does — the command §25 ran on
|
||||
/// FINAL FANTASY, where the game came up in its package. Started by its path, a GDK game never is.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void XboxActivatesThePackageThroughTheUsersShell()
|
||||
{
|
||||
const string family = "39EA002F.FF1DF_n746a19ndrrjg";
|
||||
StoreGame record = Record("xbox", family, @"D:\xbox\FINAL FANTASY\Content") with { LaunchKey = family + "!Game" };
|
||||
|
||||
StoreLaunch? launch = StoreLaunches.For(record, _galaxy);
|
||||
|
||||
launch.Should().Be(new StoreLaunch("xbox", StoreLaunchKind.RunProgram, StoreLaunches.ExplorerPath, @"shell:AppsFolder\" + family + "!Game"));
|
||||
StoreLaunches.ExplorerPath.Should().EndWith(@"\explorer.exe").And.StartWith(Environment.GetFolderPath(Environment.SpecialFolder.Windows));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AnXboxKeyThatIsNotThisPackagesBuildsNothing()
|
||||
{
|
||||
StoreGame record = Record("xbox", "LyricalGamesLLC.ValorMortis_72fag5ekhk96y", @"D:\xbox\Valor Mortis\Content");
|
||||
|
||||
StoreLaunches.For(record with { LaunchKey = "LyricalGamesLLC.ValorMortis_72fag5ekhk96y!AppValorMortisShipping" }, null).Should().NotBeNull();
|
||||
StoreLaunches.For(record with { LaunchKey = "Another.Game_72fag5ekhk96y!AppValorMortisShipping" }, null).Should().BeNull("the key must activate this record's own package");
|
||||
StoreLaunches.For(record with { LaunchKey = null }, null).Should().BeNull("an entry with no application id has nothing to activate");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("LyricalGamesLLC.ValorMortis_72fag5ekhk96y!AppValorMortisShipping", true)]
|
||||
[InlineData("Microsoft.MicrosoftJewel_8wekyb3d8bbwe!Game", true)]
|
||||
[InlineData("Microsoft.MicrosoftJewel_8wekyb3d8bbwe", false)]
|
||||
[InlineData("Microsoft.MicrosoftJewel_8wekyb3d8bbw!Game", false)]
|
||||
[InlineData("Microsoft.MicrosoftJewel_8WEKYB3D8BBWE!Game", false)]
|
||||
[InlineData("Microsoft.MicrosoftJewel_8wekyb3d8bbwe!1Game", false)]
|
||||
[InlineData("Microsoft.MicrosoftJewel_8wekyb3d8bbwe!Game /x", false)]
|
||||
[InlineData("Microsoft.MicrosoftJewel_8wekyb3d8bbwe!Game\\..", false)]
|
||||
[InlineData("..\\Jewel_8wekyb3d8bbwe!Game", false)]
|
||||
[InlineData("MJ_8wekyb3d8bbwe!Game", false)]
|
||||
[InlineData("!Game", false)]
|
||||
public void AnAumidIsCheckedAgainstTheShapeWindowsGivesOne(string aumid, bool valid) =>
|
||||
StoreLaunches.IsAumid(aumid).Should().Be(valid);
|
||||
|
||||
[Theory]
|
||||
[InlineData("steam", "730&evil=1")]
|
||||
[InlineData("steam", "")]
|
||||
|
||||
@@ -146,6 +146,14 @@ internal sealed class FakeGameRepository : IGameRepository
|
||||
|
||||
public ValueTask<bool> ApplyStoreMetadataAsync(long gameId, StoreMetadata store, CancellationToken ct = default)
|
||||
{
|
||||
// The real repository's contract (beta.33): a store id that is not in games.platform's vocabulary throws there, so it
|
||||
// throws here too — an importer test must not pass with a platform the ledger would refuse.
|
||||
ArgumentNullException.ThrowIfNull(store);
|
||||
if (!GameMetadata.Platforms.Contains(store.Platform, StringComparer.Ordinal) || string.Equals(store.Platform, "none", StringComparison.Ordinal))
|
||||
{
|
||||
throw new ArgumentException($"'{store.Platform}' is not a store", nameof(store));
|
||||
}
|
||||
|
||||
Stores.Add((gameId, store));
|
||||
foreach ((string key, GameRow row) in Rows)
|
||||
{
|
||||
|
||||
@@ -310,6 +310,32 @@ public sealed class CaptureOrchestratorTests
|
||||
(await noLaunch.LaunchAsync(game.Id, "", ct).ConfigureAwait(true)).Outcome.Should().Be(LaunchOutcome.Unavailable);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.33 (D80): a game in an Xbox package is started by Windows through its package, never by its path — started
|
||||
/// that way it is not the game in its package (spike-notes §25) — so the agent answers <c>PackagedGame</c> and starts
|
||||
/// nothing. Reached only when the App found no package record for it; the watcher records it once Windows starts it.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task AGameInAnXboxPackageIsNeverStartedByItsPath()
|
||||
{
|
||||
CancellationToken ct = TestContext.Current.CancellationToken;
|
||||
var games = new FakeGameRepository();
|
||||
GameRow game = await games.EnsureAsync(new ExecutableFingerprint { ExePath = _game, SizeBytes = 1, MtimeUnixMs = 1 }, "Title", ct).ConfigureAwait(true);
|
||||
var launchRecorder = new FakeRecorder();
|
||||
using var launches = new FakeLaunches(launchRecorder);
|
||||
List<string> log = [];
|
||||
var o = new CaptureOrchestrator(new FakeRecorder(), games, new FakeSnapshots(), new FakeIdentity(),
|
||||
new OrchestratorOptions { PayloadPath = @"C:\FL\FrameLedger.Overlay.dll", IsPackaged = exe => string.Equals(exe, _game, StringComparison.OrdinalIgnoreCase) },
|
||||
log.Add, launches);
|
||||
|
||||
LaunchResult result = await o.LaunchAsync(game.Id, "", ct).ConfigureAwait(true);
|
||||
|
||||
result.Outcome.Should().Be(LaunchOutcome.PackagedGame);
|
||||
result.SessionGuid.Should().BeNull();
|
||||
launchRecorder.Requests.Should().BeEmpty("nothing is started by its path");
|
||||
log.Should().ContainSingle(l => l.Contains("starts through Windows", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RunAsyncPollsUntilCancelledAndThenReportsWhatWasRunning()
|
||||
{
|
||||
|
||||
@@ -128,6 +128,8 @@ public sealed class AntiCheatVerdictTests
|
||||
[InlineData(AntiCheatRefusalReason.PayloadNotOurs, false)]
|
||||
[InlineData(AntiCheatRefusalReason.KillSwitchEngaged, false)]
|
||||
[InlineData(AntiCheatRefusalReason.HookNotEnabled, false)]
|
||||
[InlineData(AntiCheatRefusalReason.TargetAppContainer, false)]
|
||||
[InlineData(AntiCheatRefusalReason.TargetMitigation, false)]
|
||||
public void AFindingAboutTheGameIsWhatTurnsItsHookingOff(AntiCheatRefusalReason reason, bool finding) =>
|
||||
AntiCheatVerdict.Refused(reason, "Easy Anti-Cheat", "EasyAntiCheat_EOS.dll").IsFindingAboutTheGame.Should().Be(finding);
|
||||
|
||||
|
||||
@@ -59,6 +59,32 @@ public sealed class RuleEvaluatorTests
|
||||
.Should().Be(SignalOutcome.NoMatch);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RootFile_IsDecidedByTheRootsOwnListing_EvenWhenTheDeepWalkRanShort()
|
||||
{
|
||||
// beta.33, the xbox platform: a GDK package root's two files. The deep walk stopped on a bound
|
||||
// (FileListingComplete false), which would make a sibling_glob miss Unknown; the root's own listing decides.
|
||||
GameFileSnapshot gdk = Snapshot(files: [], listingComplete: false) with
|
||||
{
|
||||
RootFiles = new HashSet<string>(["MicrosoftGame.Config", "appxmanifest.xml"], StringComparer.OrdinalIgnoreCase),
|
||||
};
|
||||
GameFileSnapshot steam = Snapshot(files: ["steam_api64.dll"], listingComplete: false) with
|
||||
{
|
||||
RootFiles = new HashSet<string>(["Game.exe", "steam_api64.dll"], StringComparer.OrdinalIgnoreCase),
|
||||
};
|
||||
|
||||
RuleEvaluator.Evaluate(Signal(DetectionSignalType.RootFile, "MicrosoftGame.config"), gdk).Should().Be(SignalOutcome.Match);
|
||||
RuleEvaluator.Evaluate(Signal(DetectionSignalType.RootFile, "MicrosoftGame.config"), steam).Should().Be(SignalOutcome.NoMatch,
|
||||
"a complete listing of the root is evidence of absence there, whatever the deep walk did");
|
||||
RuleEvaluator.Evaluate(Signal(DetectionSignalType.SiblingGlob, "MicrosoftGame.config"), steam).Should().Be(SignalOutcome.Unknown,
|
||||
"the contrast: a walk-based miss on an incomplete walk is Unknown");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RootFile_IsUnknownWhenTheRootWasNotListed() =>
|
||||
RuleEvaluator.Evaluate(Signal(DetectionSignalType.RootFile, "MicrosoftGame.config"), Snapshot(files: ["MicrosoftGame.config"]))
|
||||
.Should().Be(SignalOutcome.Unknown, "no listing of the root (RootFiles null) is not a miss");
|
||||
|
||||
[Fact]
|
||||
public void PathContains_IsCaseInsensitiveAndSeparatorAgnostic()
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using FluentAssertions;
|
||||
using FrameLedger.Application.Capture;
|
||||
using FrameLedger.Infrastructure.Capture;
|
||||
using FrameLedger.Infrastructure.Io;
|
||||
using FrameLedger.Infrastructure.Watch;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Tests.Capture;
|
||||
|
||||
@@ -162,6 +163,33 @@ public sealed class TargetResolverTests : IDisposable
|
||||
new TargetResolver(latest: new Application.Watch.LatestProcessSnapshot()).IsRunning(ExecutableIdentity.Normalise(_exe)).Should().BeTrue("no snapshot published yet");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.33: the path the watcher keys a game on is the path the resolver re-finds it by — one reader
|
||||
/// (<see cref="ProcessImagePath"/>), so a game started through a junction cannot come back spelled otherwise.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TheWatchersSpellingIsTheOneTheResolverFindsAGameBy()
|
||||
{
|
||||
Process only = Start("/c ping -n 30 127.0.0.1 > nul");
|
||||
WaitUntilAllVisible();
|
||||
|
||||
string? watched = new ToolhelpProcessSnapshotSource().Take().Single(s => s.Pid == only.Id).ImagePath;
|
||||
|
||||
watched.Should().Be(ProcessImagePath.Read(only.Id, ProcessImagePath.GuardRights, out _));
|
||||
watched.Should().Be(ExecutableIdentity.Normalise(_exe));
|
||||
new TargetResolver().Resolve(watched!, out SessionEndReason reason).Should().Be(only.Id);
|
||||
reason.Should().Be(SessionEndReason.Running);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ProcessImagePathCannotBeReadForAProcessThatIsNotThere()
|
||||
{
|
||||
ProcessImagePath.Read(0, ProcessImagePath.QueryLimited, out int none).Should().BeNull();
|
||||
none.Should().Be(0, "no process is opened for a pid that cannot name one");
|
||||
ProcessImagePath.Read(int.MaxValue - 3, ProcessImagePath.QueryLimited, out int error).Should().BeNull();
|
||||
error.Should().NotBe(0);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OneInstanceResolves()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Domain.Detection;
|
||||
using FrameLedger.Infrastructure.Detection;
|
||||
using FrameLedger.Infrastructure.Import;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Tests.Detection;
|
||||
|
||||
/// <summary>
|
||||
/// beta.33: what a <c>root_file</c> signal is answered from — the install root's own listing, files only, taken once —
|
||||
/// and a root that cannot be listed is no listing at all, never an empty one (an empty one would read every
|
||||
/// <c>root_file</c> as a miss).
|
||||
/// </summary>
|
||||
public sealed class GameFileProbeRootFilesTests : IDisposable
|
||||
{
|
||||
private static readonly DetectionRuleSet _rules = new()
|
||||
{
|
||||
SchemaVersion = 2,
|
||||
RulesVersion = "t",
|
||||
Engines = [],
|
||||
Platforms = [],
|
||||
Capabilities = [],
|
||||
};
|
||||
|
||||
private readonly string _root = Path.Combine(Path.GetTempPath(), "fl-rootfiles-" + Guid.NewGuid().ToString("N"));
|
||||
|
||||
public GameFileProbeRootFilesTests() => Directory.CreateDirectory(_root);
|
||||
|
||||
public void Dispose() => Directory.Delete(_root, recursive: true);
|
||||
|
||||
private static CancellationToken Ct => TestContext.Current.CancellationToken;
|
||||
|
||||
[Fact]
|
||||
public async Task ThePackageRootsOwnFilesAreListedAndNothingBelowIt()
|
||||
{
|
||||
string content = Path.Combine(_root, "Valor Mortis", "Content");
|
||||
string binaries = Path.Combine(content, "ValorMortis", "Binaries", "Win64");
|
||||
Directory.CreateDirectory(binaries);
|
||||
await File.WriteAllTextAsync(Path.Combine(content, GdkPackageFiles.ConfigFileName), "<Game />", Ct);
|
||||
await File.WriteAllTextAsync(Path.Combine(content, GdkPackageFiles.ManifestFileName), "<Package />", Ct);
|
||||
string exe = Path.Combine(binaries, "ValorMortisMSG-Win64-Shipping.exe");
|
||||
await File.WriteAllBytesAsync(exe, [0x4D, 0x5A], Ct);
|
||||
|
||||
GameFileSnapshot snapshot = await new GameFileProbe().SnapshotAsync(exe, _rules, Ct);
|
||||
|
||||
snapshot.GameDirectory.Should().Be(content.Replace('\\', '/'), "a GDK package root is the install root of an executable three levels down");
|
||||
snapshot.RootFiles.Should().BeEquivalentTo([GdkPackageFiles.ConfigFileName, GdkPackageFiles.ManifestFileName]);
|
||||
snapshot.RootFiles!.Contains("MICROSOFTGAME.CONFIG").Should().BeTrue("a file name is matched as NTFS matches it");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ARootThatCannotBeListedIsNoListing()
|
||||
{
|
||||
GameFileSnapshot snapshot = await new GameFileProbe().SnapshotAsync(Path.Combine(_root, "gone", "game.exe"), _rules, Ct);
|
||||
|
||||
snapshot.RootFiles.Should().BeNull("a folder that is not there answers Unknown, never \"no such file\"");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Infrastructure.Detection;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Tests.Detection;
|
||||
|
||||
/// <summary>
|
||||
/// The install-root cases both resolvers read (beta.33): <c>tests/fixtures/install-roots/cases.txt</c>, answered here by
|
||||
/// <see cref="InstallRoot.Resolve"/> and in <c>fl_guard_test</c> by the native <c>ResolveInstallRoot</c>. They had drifted:
|
||||
/// the managed list carried <c>GamesInstalled</c> from #17 and the native one never did. A GDK package root is marked by
|
||||
/// FILES (<c>MicrosoftGame.config</c> beside <c>appxmanifest.xml</c>, <c>spike-notes</c> §25), so each case builds its tree
|
||||
/// in a folder of its own under the temp directory.
|
||||
/// </summary>
|
||||
public sealed class InstallRootCasesTests : IDisposable
|
||||
{
|
||||
private readonly string _temp = Path.Combine(Path.GetTempPath(), "fl-install-roots-" + Guid.NewGuid().ToString("N"));
|
||||
|
||||
private static string RepoRoot()
|
||||
{
|
||||
var dir = new DirectoryInfo(AppContext.BaseDirectory);
|
||||
while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "FrameLedger.slnx")))
|
||||
{
|
||||
dir = dir.Parent;
|
||||
}
|
||||
|
||||
dir.Should().NotBeNull("the cases live in the repository");
|
||||
return dir!.FullName;
|
||||
}
|
||||
|
||||
public static TheoryData<string, string, string> Cases()
|
||||
{
|
||||
var data = new TheoryData<string, string, string>();
|
||||
foreach (string line in File.ReadAllLines(Path.Combine(RepoRoot(), "tests", "fixtures", "install-roots", "cases.txt")))
|
||||
{
|
||||
if (line.Length == 0 || line[0] == '#')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string[] fields = line.Split('|');
|
||||
fields.Should().HaveCount(3, $"'{line}' must be <files>|<exe>|<root>");
|
||||
data.Add(fields[0], fields[1], fields[2]);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheListIsNotEmpty() =>
|
||||
Cases().Should().HaveCountGreaterThanOrEqualTo(10, "an empty list is a green theory that compared nothing");
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(Cases))]
|
||||
public void EachSharedCaseResolvesToItsRoot(string files, string exe, string root)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(files);
|
||||
ArgumentNullException.ThrowIfNull(exe);
|
||||
ArgumentNullException.ThrowIfNull(root);
|
||||
Directory.CreateDirectory(_temp);
|
||||
foreach (string item in files.Split(';', StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
string path = Path.Combine(_temp, item);
|
||||
if (item.AsSpan().EndsWith('\\'))
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path)!);
|
||||
File.WriteAllBytes(path, []);
|
||||
}
|
||||
}
|
||||
|
||||
InstallRoot.Resolve(Path.Combine(_temp, exe)).Should().Be(Path.Combine(_temp, root), $"the case for {exe}");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Directory.Exists(_temp))
|
||||
{
|
||||
Directory.Delete(_temp, recursive: true);
|
||||
}
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
// A folder still in use is the OS's to clean; the case already answered.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,6 +68,39 @@ public sealed class ExecutableLocatorTests : IDisposable
|
||||
"the root executable of an Unreal package starts the shipping binary and exits; the shipping binary is the process that presents");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AGdkUnrealPackagePicksTheWinGdkShippingBinaryOverTheStubAndTheLaunchHelper()
|
||||
{
|
||||
// A Game About Digging A Hole from the Xbox app (spike-notes §25), its real sizes: the package launches the 233,984-byte
|
||||
// stub, the stub starts the shipping binary, and gamelaunchhelper.exe is the GDK's own launcher.
|
||||
string content = Sub("A Game About Digging A Hole", "Content");
|
||||
string bin = Sub("A Game About Digging A Hole", "Content", "DiggingGame", "Binaries", "WinGDK");
|
||||
await File.WriteAllBytesAsync(Path.Combine(content, "MicrosoftGame.config"), [], Ct);
|
||||
await File.WriteAllBytesAsync(Path.Combine(content, "appxmanifest.xml"), [], Ct);
|
||||
await File.WriteAllBytesAsync(Path.Combine(content, "DiggingGame.exe"), new byte[233_984], Ct);
|
||||
await File.WriteAllBytesAsync(Path.Combine(content, "gamelaunchhelper.exe"), new byte[113_096], Ct);
|
||||
await File.WriteAllBytesAsync(Path.Combine(bin, "DiggingGame-WinGDK-Shipping.exe"), new byte[2_000], Ct);
|
||||
|
||||
new ExecutableLocator().PickPrimary(content).Should().Be(Path.Combine(bin, "DiggingGame-WinGDK-Shipping.exe"),
|
||||
"the WinGDK shipping binary is the process that presents; the stub and the GDK's launcher are not the game");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheGdkLaunchHelperIsNeverTheGameEvenWhenItIsTheLargest()
|
||||
{
|
||||
// A GDK title of no engine the locator knows: only the name of the package's parent folder and the sizes say anything.
|
||||
string content = Sub("Microsoft Jewel", "Content");
|
||||
await File.WriteAllBytesAsync(Path.Combine(content, "MicrosoftGame.config"), [], Ct);
|
||||
await File.WriteAllBytesAsync(Path.Combine(content, "appxmanifest.xml"), [], Ct);
|
||||
await File.WriteAllBytesAsync(Path.Combine(content, "gamelaunchhelper.exe"), new byte[900_000], Ct);
|
||||
await File.WriteAllBytesAsync(Path.Combine(content, "ToolKit.exe"), new byte[800_000], Ct);
|
||||
await File.WriteAllBytesAsync(Path.Combine(content, "MicrosoftJewel.exe"), new byte[239_936], Ct);
|
||||
|
||||
new ExecutableLocator().PickPrimary(content).Should().Be(Path.Combine(content, "MicrosoftJewel.exe"),
|
||||
"a package root's name is the folder above Content, so the executable named after the game outranks a larger stranger; " +
|
||||
"the launcher is never the game");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AnExecutableNamedAfterTheInstallBeatsALargerStranger()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Text;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Infrastructure.Import;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Tests.Import;
|
||||
|
||||
/// <summary>
|
||||
/// beta.33: the drives' <c>.GamingRoot</c> files as the owner's are (<c>spike-notes</c> §25) — C: 28 bytes naming
|
||||
/// <c>XboxGames</c>, D: 18 bytes naming <c>xbox</c> — and every way one can fail to be one, costing that drive or that name
|
||||
/// only; and Windows' own package answers, which are the same on every PC for a given identity.
|
||||
/// </summary>
|
||||
public sealed class GamingRootsTests
|
||||
{
|
||||
private static byte[] Bytes(uint count, params string[] names)
|
||||
{
|
||||
List<byte> bytes = [.. "RGBX"u8.ToArray(), .. BitConverter.GetBytes(count)];
|
||||
foreach (string name in names)
|
||||
{
|
||||
bytes.AddRange(Encoding.Unicode.GetBytes(name + "\0"));
|
||||
}
|
||||
|
||||
return [.. bytes];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This PC's drives, read as the import reads them: whatever they name is a full path, and a PC with no
|
||||
/// <c>.GamingRoot</c> anywhere — the hosted runner — names none, without an error.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ThisPcsGamesFoldersAreFullPathsWhereverThereAreAny() =>
|
||||
// Not OnlyContain: it fails an empty list, which is exactly the hosted runner's answer (seen on #352's first CI run).
|
||||
GamingRoots.OnThisPc().Where(static root => !Path.IsPathFullyQualified(root)).Should().BeEmpty();
|
||||
|
||||
[Fact]
|
||||
public void TheOwnersTwoFilesNameTheirGamesFolders()
|
||||
{
|
||||
byte[] c = Bytes(1, "XboxGames");
|
||||
byte[] d = Bytes(1, "xbox");
|
||||
c.Should().HaveCount(28, "the C: file measured on the owner's PC");
|
||||
d.Should().HaveCount(18, "the D: file measured on the owner's PC");
|
||||
|
||||
GamingRoots.Parse(c, @"C:\").Should().Equal(@"C:\XboxGames");
|
||||
GamingRoots.Parse(d, @"D:\").Should().Equal(@"D:\xbox");
|
||||
GamingRoots.Parse(Bytes(2, "XboxGames", @"More\Games"), @"E:\").Should().Equal(@"E:\XboxGames", @"E:\More\Games");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AFileThatIsNotOneNamesNothing()
|
||||
{
|
||||
GamingRoots.Parse([], @"C:\").Should().BeEmpty();
|
||||
GamingRoots.Parse("XGBR\u0001\0\0\0x\0\0\0"u8.ToArray(), @"C:\").Should().BeEmpty("the magic is RGBX");
|
||||
GamingRoots.Parse(Bytes(0), @"C:\").Should().BeEmpty();
|
||||
GamingRoots.Parse(Bytes((uint)GamingRoots.MaxCount + 1, "x"), @"C:\").Should().BeEmpty("a count no install has is a file that is not one");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ATruncatedFileKeepsTheNamesItHoldsAndAStrangeNameCostsItself()
|
||||
{
|
||||
byte[] truncated = [.. Bytes(2, "XboxGames"), .. Encoding.Unicode.GetBytes("Cut")];
|
||||
GamingRoots.Parse(truncated, @"C:\").Should().Equal(@"C:\XboxGames");
|
||||
|
||||
GamingRoots.Parse(Bytes(5, @"..\Windows", @"C:\Elsewhere", "Fine", "a:b", "."), @"D:\").Should().ContainSingle().Which.Should().Be(@"D:\Fine",
|
||||
"only a plain folder on the file's own drive is a games folder");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WindowsComputesTheFamilyNameTheStartMenuLists()
|
||||
{
|
||||
// The identity Valor Mortis' MicrosoftGame.config states, and the family name Get-AppxPackage and Get-StartApps list
|
||||
// for it on the owner's PC; PackageFamilyNameFromId computes it the same way on any Windows.
|
||||
WindowsInstalledPackages.Instance.FamilyName("LyricalGamesLLC.ValorMortis", "CN=C32D4B9A-1AEC-416A-8124-789B35AD6753")
|
||||
.Should().Be("LyricalGamesLLC.ValorMortis_72fag5ekhk96y");
|
||||
WindowsInstalledPackages.Instance.IsInstalled("FrameLedger.NotAPackage_0000000000000").Should().BeFalse();
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Application.Art;
|
||||
using FrameLedger.Application.Import;
|
||||
using FrameLedger.Infrastructure.Art;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Tests.Import;
|
||||
@@ -20,6 +21,9 @@ public sealed class StoreArtCachesTests : IDisposable
|
||||
|
||||
public void Dispose() => Directory.Delete(_dir, recursive: true);
|
||||
|
||||
/// <summary>A store's record of a game with <paramref name="id"/> (beta.33: the caches take the whole record).</summary>
|
||||
private static StoreGame Record(string id) => new("steam", id, "Game", @"C:\Games\Game", ExePath: null, Version: null);
|
||||
|
||||
private string Touch(DateTime writtenUtc, params string[] parts)
|
||||
{
|
||||
string path = Path.Combine([_dir, .. parts]);
|
||||
@@ -40,7 +44,7 @@ public sealed class StoreArtCachesTests : IDisposable
|
||||
_ = Steam("374320", "library_hero_blur.jpg");
|
||||
_ = Steam("374320", "logo.png");
|
||||
|
||||
GameArtFiles files = new SteamArtCache(Path.Combine(_dir, "Steam")).Find("374320");
|
||||
GameArtFiles files = new SteamArtCache(Path.Combine(_dir, "Steam")).Find(Record("374320"));
|
||||
|
||||
files.Should().Be(new GameArtFiles(cover, hero, header));
|
||||
}
|
||||
@@ -54,14 +58,14 @@ public sealed class StoreArtCachesTests : IDisposable
|
||||
string capsule = Steam("1091500", "cccc", "library_capsule.jpg");
|
||||
string header = Steam("1091500", "dddd", "library_header.jpg");
|
||||
|
||||
GameArtFiles files = new SteamArtCache(Path.Combine(_dir, "Steam")).Find("1091500");
|
||||
GameArtFiles files = new SteamArtCache(Path.Combine(_dir, "Steam")).Find(Record("1091500"));
|
||||
|
||||
files.Cover.Should().Be(capsule);
|
||||
files.Hero.Should().Be(newerHero, "an asset Steam replaced has a newer copy in a new folder");
|
||||
files.Header.Should().Be(header);
|
||||
|
||||
string portrait = Steam("1091500", "library_600x900.jpg");
|
||||
new SteamArtCache(Path.Combine(_dir, "Steam")).Find("1091500").Cover.Should().Be(portrait, "the 600x900 portrait is preferred over the capsule");
|
||||
new SteamArtCache(Path.Combine(_dir, "Steam")).Find(Record("1091500")).Cover.Should().Be(portrait, "the 600x900 portrait is preferred over the capsule");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -73,17 +77,17 @@ public sealed class StoreArtCachesTests : IDisposable
|
||||
public void AnIdThatIsNotTheStoresOwnShapeNamesNoFolder(string id)
|
||||
{
|
||||
_ = Steam("374320", "library_600x900.jpg");
|
||||
new SteamArtCache(Path.Combine(_dir, "Steam")).Find(id).Should().Be(GameArtFiles.None);
|
||||
new GogArtCache(Path.Combine(_dir, "webcache")).Find(id).Should().Be(GameArtFiles.None);
|
||||
new SteamArtCache(Path.Combine(_dir, "Steam")).Find(Record(id)).Should().Be(GameArtFiles.None);
|
||||
new GogArtCache(Path.Combine(_dir, "webcache")).Find(Record(id)).Should().Be(GameArtFiles.None);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NothingThereIsNoneNeverAnError()
|
||||
{
|
||||
new SteamArtCache(Path.Combine(_dir, "no-steam")).Find("374320").Should().Be(GameArtFiles.None);
|
||||
new GogArtCache(Path.Combine(_dir, "no-galaxy")).Find("1125815775").Should().Be(GameArtFiles.None);
|
||||
new SteamArtCache(Path.Combine(_dir, "no-steam")).Find(Record("374320")).Should().Be(GameArtFiles.None);
|
||||
new GogArtCache(Path.Combine(_dir, "no-galaxy")).Find(Record("1125815775")).Should().Be(GameArtFiles.None);
|
||||
_ = Directory.CreateDirectory(Path.Combine(_dir, "Steam", "appcache", "librarycache", "220"));
|
||||
new SteamArtCache(Path.Combine(_dir, "Steam")).Find("220").IsEmpty.Should().BeTrue("Steam keeps a folder with no artwork in it for some apps");
|
||||
new SteamArtCache(Path.Combine(_dir, "Steam")).Find(Record("220")).IsEmpty.Should().BeTrue("Steam keeps a folder with no artwork in it for some apps");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -95,7 +99,7 @@ public sealed class StoreArtCachesTests : IDisposable
|
||||
_ = Touch(DateTime.UtcNow, "webcache", "222", "gog", "1125815775", "33dd_glx_square_icon_v2.webp");
|
||||
_ = Directory.CreateDirectory(Path.Combine(_dir, "webcache", "common"));
|
||||
|
||||
GameArtFiles files = new GogArtCache(Path.Combine(_dir, "webcache")).Find("1125815775");
|
||||
GameArtFiles files = new GogArtCache(Path.Combine(_dir, "webcache")).Find(Record("1125815775"));
|
||||
|
||||
files.Should().Be(new GameArtFiles(cover, banner, null), "the newest copy wins across users, and GOG keeps no header");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Application.Import;
|
||||
using FrameLedger.Infrastructure.Art;
|
||||
using FrameLedger.Infrastructure.Import;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Tests.Import;
|
||||
|
||||
/// <summary>
|
||||
/// beta.33 (owner decisions D78/D79, <c>spike-notes</c> §25): the Xbox app's games, read from a games folder laid out as the
|
||||
/// owner's are — <c><Game>\Content\</c> with <c>MicrosoftGame.config</c> and <c>appxmanifest.xml</c> in the shapes Valor
|
||||
/// Mortis and FINAL FANTASY ship — and Windows' package answers stubbed, so the source's own decisions are what is tested.
|
||||
/// </summary>
|
||||
public sealed class XboxLibrarySourceTests : IDisposable
|
||||
{
|
||||
private const string _valorConfig = """
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Game configVersion="1">
|
||||
<Identity Name="LyricalGamesLLC.ValorMortis" Publisher="CN=C32D4B9A-1AEC-416A-8124-789B35AD6753" Version="1.3.5124.0" />
|
||||
<ShellVisuals DefaultDisplayName="Valor Mortis" PublisherDisplayName="Lyrical Games LLC" StoreLogo="Resources\StoreLogo.png" Square150x150Logo="Resources\Logo.png" Square44x44Logo="Resources\SmallLogo.png" Square480x480Logo="Resources\Square480x480Logo.png" Description="ms-resource:AppDescription" ForegroundText="dark" BackgroundColor="#000040" SplashScreenImage="Resources\SplashScreen.png" />
|
||||
<ExecutableList>
|
||||
<Executable Name="ValorMortisMSG.exe" Id="AppValorMortisShipping" OverrideDisplayName="ms-resource:AppDisplayName" TargetDeviceFamily="PC" />
|
||||
</ExecutableList>
|
||||
<TitleId>76300F35</TitleId>
|
||||
<StoreId>9P861V1542BL</StoreId>
|
||||
</Game>
|
||||
""";
|
||||
|
||||
private const string _valorManifest = """
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10">
|
||||
<Identity Name="LyricalGamesLLC.ValorMortis" Publisher="CN=C32D4B9A-1AEC-416A-8124-789B35AD6753" Version="1.3.5124.0" ProcessorArchitecture="x64" />
|
||||
<Properties>
|
||||
<DisplayName>Valor Mortis</DisplayName>
|
||||
</Properties>
|
||||
<Applications>
|
||||
<Application Id="AppValorMortisShipping" Executable="GameLaunchHelper.exe" EntryPoint="Windows.FullTrustApplication" />
|
||||
</Applications>
|
||||
</Package>
|
||||
""";
|
||||
|
||||
private readonly string _root = Path.Combine(Path.GetTempPath(), "fl-xbox-" + Guid.NewGuid().ToString("N"));
|
||||
|
||||
public XboxLibrarySourceTests() => Directory.CreateDirectory(_root);
|
||||
|
||||
public void Dispose() => Directory.Delete(_root, recursive: true);
|
||||
|
||||
private static CancellationToken Ct => TestContext.Current.CancellationToken;
|
||||
|
||||
private string Game(string folder, string config, string manifest, string configName = GdkPackageFiles.ConfigFileName)
|
||||
{
|
||||
string content = Path.Combine(_root, folder, XboxLibrarySource.ContentFolder);
|
||||
Directory.CreateDirectory(content);
|
||||
File.WriteAllText(Path.Combine(content, configName), config);
|
||||
File.WriteAllText(Path.Combine(content, GdkPackageFiles.ManifestFileName), manifest);
|
||||
return content;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AnInstalledGdkPackageIsListedWithItsFamilyNameItsAumidAndItsContentFolder()
|
||||
{
|
||||
string content = Game("Valor Mortis", _valorConfig, _valorManifest);
|
||||
var packages = new Packages("LyricalGamesLLC.ValorMortis_72fag5ekhk96y");
|
||||
|
||||
IReadOnlyList<StoreGame> games = await new XboxLibrarySource([_root], packages).ListAsync(Ct);
|
||||
|
||||
games.Should().ContainSingle();
|
||||
StoreGame game = games[0];
|
||||
game.Platform.Should().Be("xbox");
|
||||
game.StoreId.Should().Be("LyricalGamesLLC.ValorMortis_72fag5ekhk96y", "the family name is stable across updates; the WindowsApps folder's name is not");
|
||||
game.Name.Should().Be("Valor Mortis");
|
||||
game.InstallDirectory.Should().Be(content, "the spelling the game's own process reports (§25), never the WindowsApps junction");
|
||||
game.ExePath.Should().BeNull("the package launches the stub; the locator picks the shipping executable that presents");
|
||||
game.Version.Should().Be("1.3.5124.0");
|
||||
game.LaunchKey.Should().Be("LyricalGamesLLC.ValorMortis_72fag5ekhk96y!AppValorMortisShipping", "the AUMID Windows' Start menu lists, which Play activates");
|
||||
packages.Asked.Should().Equal(("LyricalGamesLLC.ValorMortis", "CN=C32D4B9A-1AEC-416A-8124-789B35AD6753"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task APackageWindowsDoesNotHaveInstalledForThisUserIsNotOffered()
|
||||
{
|
||||
Game("Left Behind", _valorConfig, _valorManifest);
|
||||
|
||||
(await new XboxLibrarySource([_root], new Packages()).ListAsync(Ct)).Should().BeEmpty(
|
||||
"a folder the Xbox app left behind, or one installed for another user, is not a game this user can start");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task FoldersThatAreNotPackagesCostOnlyThemselves()
|
||||
{
|
||||
Game("Valor Mortis", _valorConfig, _valorManifest);
|
||||
Directory.CreateDirectory(Path.Combine(_root, "GameSave")); // the Xbox app's own folder, no Content
|
||||
Directory.CreateDirectory(Path.Combine(_root, "Half", "Content"));
|
||||
await File.WriteAllTextAsync(Path.Combine(_root, "Half", "Content", GdkPackageFiles.ConfigFileName), _valorConfig, Ct); // no manifest
|
||||
Game("Broken", "<Game><Identity", _valorManifest); // will not parse
|
||||
Game("Nameless", "<Game configVersion=\"1\"><Identity Version=\"1.0.0.0\" /></Game>", _valorManifest);
|
||||
|
||||
IReadOnlyList<StoreGame> games = await new XboxLibrarySource([_root, Path.Combine(_root, "no-such-folder")],
|
||||
new Packages("LyricalGamesLLC.ValorMortis_72fag5ekhk96y")).ListAsync(Ct);
|
||||
|
||||
games.Select(static g => g.Name).Should().Equal("Valor Mortis");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AResourceNameFallsBackToTheManifestsThenToTheFolders()
|
||||
{
|
||||
string config = _valorConfig.Replace("DefaultDisplayName=\"Valor Mortis\"", "DefaultDisplayName=\"ms-resource:AppDisplayName\"", StringComparison.Ordinal);
|
||||
Game("Valor Mortis", config, _valorManifest);
|
||||
Game("FINAL FANTASY", config.Replace("LyricalGamesLLC.ValorMortis", "39EA002F.FF1DF", StringComparison.Ordinal),
|
||||
_valorManifest.Replace("<DisplayName>Valor Mortis</DisplayName>", "<DisplayName>ms-resource:AppDisplayName</DisplayName>", StringComparison.Ordinal),
|
||||
configName: "MicrosoftGame.Config");
|
||||
|
||||
IReadOnlyList<StoreGame> games = await new XboxLibrarySource([_root], new Packages("LyricalGamesLLC.ValorMortis_72fag5ekhk96y", "39EA002F.FF1DF_n746a19ndrrjg")).ListAsync(Ct);
|
||||
|
||||
games.Select(static g => g.Name).Should().BeEquivalentTo(["Valor Mortis", "FINAL FANTASY"],
|
||||
"an ms-resource reference is not a name: the manifest's own DisplayName, else the game's folder (the FINAL FANTASY titles spell the config MicrosoftGame.Config)");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheApplicationThatRunsTheLaunchHelperIsTheOneActivated()
|
||||
{
|
||||
string manifest = _valorManifest.Replace(
|
||||
"<Application Id=\"AppValorMortisShipping\" Executable=\"GameLaunchHelper.exe\"",
|
||||
"<Application Id=\"Editor\" Executable=\"Editor.exe\" EntryPoint=\"Windows.FullTrustApplication\" /><Application Id=\"Game\" Executable=\"gamelaunchhelper.exe\"",
|
||||
StringComparison.Ordinal);
|
||||
Game("Valor Mortis", _valorConfig, manifest);
|
||||
|
||||
(await new XboxLibrarySource([_root], new Packages("LyricalGamesLLC.ValorMortis_72fag5ekhk96y")).ListAsync(Ct))
|
||||
.Single().LaunchKey.Should().Be("LyricalGamesLLC.ValorMortis_72fag5ekhk96y!Game");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AConfigWithADocumentTypeIsRefusedNotExpanded()
|
||||
{
|
||||
string withDtd = "<?xml version=\"1.0\"?><!DOCTYPE Game [<!ENTITY x \"Valor Mortis\">]>" + _valorConfig[(_valorConfig.IndexOf("<Game", StringComparison.Ordinal))..];
|
||||
Game("Valor Mortis", withDtd, _valorManifest);
|
||||
|
||||
(await new XboxLibrarySource([_root], new Packages("LyricalGamesLLC.ValorMortis_72fag5ekhk96y")).ListAsync(Ct)).Should().BeEmpty(
|
||||
"the reader prohibits DTDs: a publisher's file is data, never something to expand");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheArtCacheReadsTheSquareLogoAndTheSplashFromThePackageAndNothingOutsideIt()
|
||||
{
|
||||
string content = Game("Valor Mortis", _valorConfig, _valorManifest);
|
||||
Directory.CreateDirectory(Path.Combine(content, "Resources"));
|
||||
File.WriteAllBytes(Path.Combine(content, "Resources", "Square480x480Logo.png"), [1, 2, 3]);
|
||||
File.WriteAllBytes(Path.Combine(content, "Resources", "SplashScreen.scale-200.png"), [1, 2, 3, 4]);
|
||||
File.WriteAllBytes(Path.Combine(content, "Resources", "SplashScreen.scale-100.png"), [1, 2]);
|
||||
var record = new StoreGame("xbox", "LyricalGamesLLC.ValorMortis_72fag5ekhk96y", "Valor Mortis", content, ExePath: null, Version: null);
|
||||
|
||||
Application.Art.GameArtFiles files = new XboxArtCache().Find(record);
|
||||
|
||||
files.Square.Should().Be(Path.Combine(content, "Resources", "Square480x480Logo.png"));
|
||||
files.Hero.Should().Be(Path.Combine(content, "Resources", "SplashScreen.scale-200.png"), "the plain name is absent, so the largest scale variant beside it");
|
||||
files.Header.Should().Be(files.Hero);
|
||||
files.Cover.Should().BeNull("a GDK package ships no portrait cover");
|
||||
XboxArtCache.Image(content, @"..\..\outside.png").Should().BeNull("a name that escapes the package is not the package's picture");
|
||||
XboxArtCache.Image(content, @"C:\Windows\System32\shell32.dll").Should().BeNull();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.33 (D80): the agent's test before a <c>LaunchGame</c> — an executable whose install root is a GDK package root is
|
||||
/// a game Windows starts through its package, never by its path. The Unreal shipping executable three levels down is in
|
||||
/// its package; a Steam game's is not, even beside a stray package file.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AnExecutableAnywhereInAPackageIsInItAndAStoresGameIsNot()
|
||||
{
|
||||
string content = Game("Valor Mortis", _valorConfig, _valorManifest);
|
||||
string shipping = Path.Combine(content, "ValorMortis", "Binaries", "Win64", "ValorMortisMSG-Win64-Shipping.exe");
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(shipping)!);
|
||||
|
||||
GdkPackageFiles.IsInPackage(shipping).Should().BeTrue();
|
||||
GdkPackageFiles.IsInPackage(Path.Combine(content, "ValorMortisMSG.exe")).Should().BeTrue();
|
||||
|
||||
string steam = Path.Combine(_root, "steamapps", "common", "FINAL FANTASY");
|
||||
Directory.CreateDirectory(steam);
|
||||
File.WriteAllText(Path.Combine(steam, GdkPackageFiles.ManifestFileName), _valorManifest);
|
||||
GdkPackageFiles.IsInPackage(Path.Combine(steam, "FINAL FANTASY.exe")).Should().BeFalse("a Steam root is the boundary, and it holds no package config");
|
||||
GdkPackageFiles.IsInPackage(Path.Combine(_root, "Loose", "game.exe")).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhatIsNotAPackageCostsNothing()
|
||||
{
|
||||
GdkPackageFiles.IsPackageRoot(" ").Should().BeFalse();
|
||||
GdkPackageFiles.NearestPackageRoot(" ").Should().BeNull();
|
||||
GdkPackageFiles.NearestPackageRoot(_root).Should().BeNull("no folder at or above it holds a package's two files");
|
||||
GdkPackageFiles.IsInPackage(Path.Combine(_root, "a\0b", "game.exe")).Should().BeFalse("a path that is no path is in no package");
|
||||
|
||||
string big = Game("Big", _valorConfig + new string(' ', (int)GdkPackageFiles.MaxFileBytes), _valorManifest);
|
||||
GdkPackageFiles.Read(big).Should().BeNull("a description file over the cap is not read");
|
||||
|
||||
new XboxLibrarySource([_root], new Packages()).Platform.Should().Be("xbox");
|
||||
var art = new XboxArtCache();
|
||||
art.Platform.Should().Be("xbox");
|
||||
art.Find(new StoreGame("xbox", "Gone.Game_0000000000000", "Gone", Path.Combine(_root, "Gone", "Content"), null, null))
|
||||
.Should().Be(Application.Art.GameArtFiles.None, "a folder that is not a package has no pictures to show");
|
||||
XboxArtCache.Image(_root, " ").Should().BeNull();
|
||||
XboxArtCache.Image(_root, "a\0b.png").Should().BeNull();
|
||||
}
|
||||
|
||||
/// <summary>Windows' package answers, stubbed: the family name is the one listed whose name part matches; installed = listed.</summary>
|
||||
private sealed class Packages(params string[] installed) : IInstalledPackages
|
||||
{
|
||||
public List<(string Name, string Publisher)> Asked { get; } = [];
|
||||
|
||||
public string? FamilyName(string name, string publisher)
|
||||
{
|
||||
Asked.Add((name, publisher));
|
||||
return installed.FirstOrDefault(f => f.StartsWith(name + "_", StringComparison.Ordinal)) ?? name + "_0000000000000";
|
||||
}
|
||||
|
||||
public bool IsInstalled(string familyName) => installed.Contains(familyName, StringComparer.Ordinal);
|
||||
}
|
||||
}
|
||||
@@ -226,6 +226,27 @@ public sealed class SqliteGameRepositoryTests
|
||||
(await repo.ApplyStoreMetadataAsync(row.Id + 99, new StoreMetadata { Platform = "steam" }, Ct)).Should().BeFalse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.33 (D79): an Xbox game's import is a store write the REAL repository takes, and the user's Edit… keeps it — the
|
||||
/// fake used by the importer's tests validated nothing, so an "xbox" those tests accepted would have thrown here.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task AnXboxImportIsAStoreTheLedgerTakesAndEditKeeps()
|
||||
{
|
||||
await using LedgerFixture f = await LedgerFixture.OpenAsync();
|
||||
var repo = new SqliteGameRepository(f.Db);
|
||||
GameRow row = await repo.EnsureAsync(_exe, "Valor Mortis", Ct);
|
||||
|
||||
(await repo.ApplyStoreMetadataAsync(row.Id, new StoreMetadata { Platform = "xbox", StoreId = "LyricalGamesLLC.ValorMortis_72fag5ekhk96y", GameVersion = "1.3.5124.0" }, Ct))
|
||||
.Should().BeTrue();
|
||||
GameRow imported = (await repo.FindByIdAsync(row.Id, Ct))!;
|
||||
imported.Platform.Should().Be("xbox");
|
||||
imported.StoreId.Should().Be("LyricalGamesLLC.ValorMortis_72fag5ekhk96y");
|
||||
|
||||
(await repo.UpdateMetadataAsync(row.Id, GameMetadata.Of(imported) with { Notes = "a note" }, Ct)).Should().BeTrue("Edit… passes the row's platform through");
|
||||
(await repo.FindByIdAsync(row.Id, Ct))!.Platform.Should().Be("xbox");
|
||||
}
|
||||
|
||||
private static async Task<long> AddSessionAsync(LedgerFixture f, long gameId)
|
||||
{
|
||||
long snapshotId = await new SqliteHardwareSnapshotRepository(f.Db).EnsureAsync(new HardwareSnapshot { GpuName = "G" }, DateTimeOffset.UnixEpoch, Ct).ConfigureAwait(false);
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
# The install-root cases BOTH resolvers must answer the same way (beta.33): InstallRoot.Resolve in C#
|
||||
# (FrameLedger.Infrastructure.Tests, InstallRootCasesTests) and ResolveInstallRoot in C++ (fl_guard_test, "the shared
|
||||
# install-root cases ..."). They had drifted once already: the managed list carried `GamesInstalled` from #17 and the
|
||||
# native one never did, so detection and the guard's check 4 walked different folders for a game under one.
|
||||
#
|
||||
# Each test makes the listed files under a fresh temporary folder T, resolves the executable T\<exe>, and requires
|
||||
# T\<root>. One case per line, three fields split by '|':
|
||||
# <files to create, ';'-separated, may be empty; a trailing '\' makes a folder> | <the executable> | <the root>
|
||||
# Every path is relative to T. Lines starting with '#' and blank lines are ignored. ASCII only.
|
||||
|
||||
# Store boundaries (the layouts measured 2026-08-03; `GamesInstalled` native since beta.33).
|
||||
|SteamLibrary\steamapps\common\Lies of P\LiesofP\Binaries\Win64\LOP-Win64-Shipping.exe|SteamLibrary\steamapps\common\Lies of P
|
||||
|SteamLibrary\steamapps\common\Lies of P\LOP.exe|SteamLibrary\steamapps\common\Lies of P
|
||||
|SteamLibrary\steamapps\common\Deadly Heart Gambit\DeadlyHeartGambit.exe|SteamLibrary\steamapps\common\Deadly Heart Gambit
|
||||
|Epic Games\SomeTitle\Sub\game.exe|Epic Games\SomeTitle
|
||||
|GOG Galaxy\Games\SomeTitle\bin\game.exe|GOG Galaxy\Games\SomeTitle
|
||||
|GamesInstalled\SomeTitle\bin\game.exe|GamesInstalled\SomeTitle
|
||||
|
||||
# No boundary and no package root: the executable's own folder (Alan Wake 2 as installed).
|
||||
|another\epic\AlanWake2\AlanWake2.exe|another\epic\AlanWake2
|
||||
|
||||
# A GDK package root (spike-notes section 25): MicrosoftGame.config beside appxmanifest.xml marks it. The Unreal shipping
|
||||
# executable three levels below, its stub at the root, and the FINAL FANTASY spelling of the config's name.
|
||||
xbox\Digging\Content\MicrosoftGame.config;xbox\Digging\Content\appxmanifest.xml|xbox\Digging\Content\DiggingGame\Binaries\WinGDK\DiggingGame-WinGDK-Shipping.exe|xbox\Digging\Content
|
||||
xbox\Digging\Content\MicrosoftGame.config;xbox\Digging\Content\appxmanifest.xml|xbox\Digging\Content\DiggingGame.exe|xbox\Digging\Content
|
||||
xbox\Valor\Content\MicrosoftGame.config;xbox\Valor\Content\appxmanifest.xml|xbox\Valor\Content\ValorMortis\Binaries\Win64\ValorMortisMSG-Win64-Shipping.exe|xbox\Valor\Content
|
||||
xbox\FF\Content\MicrosoftGame.Config;xbox\FF\Content\appxmanifest.xml|xbox\FF\Content\FINAL FANTASY.exe|xbox\FF\Content
|
||||
|
||||
# Not a package root: one of the two files only, or a folder that carries the config's name.
|
||||
xbox\Half\Content\MicrosoftGame.config|xbox\Half\Content\Bin\x.exe|xbox\Half\Content\Bin
|
||||
xbox\Odd\Content\MicrosoftGame.config\;xbox\Odd\Content\appxmanifest.xml|xbox\Odd\Content\Bin\x.exe|xbox\Odd\Content\Bin
|
||||
|
||||
# A store boundary wins over package files below it: the rule only ever widens what is walked.
|
||||
SteamLibrary\steamapps\common\Both\Game\Binaries\WinGDK\MicrosoftGame.config;SteamLibrary\steamapps\common\Both\Game\Binaries\WinGDK\appxmanifest.xml|SteamLibrary\steamapps\common\Both\Game\Binaries\WinGDK\Both-WinGDK-Shipping.exe|SteamLibrary\steamapps\common\Both
|
||||
|
||||
# The nearest package root wins; eight levels up is the reach, nine is out of it.
|
||||
outer\MicrosoftGame.config;outer\appxmanifest.xml;outer\inner\Content\MicrosoftGame.config;outer\inner\Content\appxmanifest.xml|outer\inner\Content\bin\x.exe|outer\inner\Content
|
||||
deep8\Content\MicrosoftGame.config;deep8\Content\appxmanifest.xml|deep8\Content\a\b\c\d\e\f\g\h\x.exe|deep8\Content
|
||||
deep9\Content\MicrosoftGame.config;deep9\Content\appxmanifest.xml|deep9\Content\a\b\c\d\e\f\g\h\i\x.exe|deep9\Content\a\b\c\d\e\f\g\h\i
|
||||
Loaded 100 of 110 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user