Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
218d8b977f
|
||
|
|
7db645cba7
|
No files matched your search
@@ -51,6 +51,18 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
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
|
||||
|
||||
@@ -59,6 +71,11 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
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
|
||||
|
||||
|
||||
@@ -224,6 +224,14 @@ you accept the prompt. Turn it on only if you trust everything that runs under y
|
||||
- **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
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ Requirement IDs (`FR-x`, `NFR-x`) are referenced by other docs, commits, and tes
|
||||
- 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`)
|
||||
|
||||
@@ -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
|
||||
|
||||
+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.)* |
|
||||
|
||||
@@ -614,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.
|
||||
|
||||
@@ -475,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
|
||||
|
||||
@@ -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.
|
||||
|
||||
+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?
|
||||
|
||||
+2
-1
@@ -75,7 +75,8 @@ stopped, hooking turned off — each with one button that only says you have rea
|
||||
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.
|
||||
|
||||
@@ -50,7 +50,7 @@ The link under them, *Read what the hook does and does not do*, opens the safety
|
||||
|---|---|---|
|
||||
| **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. |
|
||||
|
||||
@@ -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>(),
|
||||
|
||||
@@ -518,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),
|
||||
};
|
||||
|
||||
@@ -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
+15
@@ -621,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),
|
||||
@@ -789,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),
|
||||
@@ -797,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),
|
||||
@@ -2372,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);
|
||||
@@ -2708,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);
|
||||
@@ -2724,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);
|
||||
|
||||
@@ -3333,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>
|
||||
@@ -4242,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">
|
||||
@@ -4277,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>
|
||||
@@ -4322,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">
|
||||
|
||||
@@ -2510,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>
|
||||
@@ -3192,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>
|
||||
@@ -3218,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>
|
||||
@@ -3252,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>
|
||||
|
||||
@@ -2505,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>
|
||||
@@ -3187,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>
|
||||
@@ -3213,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>
|
||||
@@ -3247,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>
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -95,6 +95,23 @@ public static class GdkPackageFiles
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <cstring>
|
||||
#include <cwchar>
|
||||
#include <fl_prescan.h>
|
||||
#include <string_view>
|
||||
|
||||
namespace fl::guard {
|
||||
namespace {
|
||||
@@ -276,17 +277,17 @@ Verdict PreScanGameWith(const wchar_t* exePath, const Sources& s, const char* to
|
||||
// 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 {
|
||||
static const wchar_t* const kFiles[] = {L"MicrosoftGame.config", L"appxmanifest.xml"};
|
||||
for (const wchar_t* file : kFiles) {
|
||||
wchar_t probe[kMaxPreScanPathLen] = {};
|
||||
const std::size_t fileLen = wcslen(file);
|
||||
if (len + 1 + fileLen + 1 > kMaxPreScanPathLen) {
|
||||
// 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, fileLen);
|
||||
probe[len + 1 + fileLen] = L'\0';
|
||||
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;
|
||||
|
||||
@@ -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
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -102,6 +102,21 @@ public sealed class GameArtTests : IDisposable
|
||||
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(() =>
|
||||
{
|
||||
|
||||
@@ -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", "")]
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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\"");
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public sealed class InstallRootCasesTests : IDisposable
|
||||
foreach (string item in files.Split(';', StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
string path = Path.Combine(_temp, item);
|
||||
if (item.EndsWith('\\'))
|
||||
if (item.AsSpan().EndsWith('\\'))
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,15 @@ public sealed class GamingRootsTests
|
||||
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()
|
||||
{
|
||||
|
||||
@@ -161,6 +161,48 @@ public sealed class XboxLibrarySourceTests : IDisposable
|
||||
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
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user