Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
863281ac30 |
No files matched your search
@@ -38,6 +38,22 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
and `PagesLoadTests.EveryTextIsReadableInBothThemes` (every surface hosted as the App hosts it, ≥ 3:1 in both themes)
|
||||
went red on the unfixed pages first; the theme-switch check now hosts pages in the Frame too, and its harness derives the
|
||||
accent for each theme as the App does (`docs/08_UI.md` §Contrast, `docs/16_WPFUI_SYNTAX.md` §Gotchas, `docs/14_TESTING.md`).
|
||||
- **Every notice says what happened in words.** With *Disable all hooking* on, a game's notice read "kill switch was
|
||||
detected in this game (the global 'disable all hooking' switch is on (FR-2.4); …)" — it reads "All hooking is switched
|
||||
off in Settings, so nothing was measured." now, and a game blocked before reads as that, not as a finding. A refusal no
|
||||
anti-cheat names read "… reason RefusedByGuard." and is said in the guard's words ("the game is 32-bit, and the hook
|
||||
runs in 64-bit games only"); the agent sends the guard's reason for every refusal (`docs/07_IPC.md`). A safety re-scan
|
||||
that could not look while the game ran read "Access is denied. was detected" and says the check could not be made. And
|
||||
*Measurement stopped* printed "The hook stopped (WriterSelfDisabled); the session continues without measuring." — it
|
||||
says why in a sentence, and no longer that the session went on: a stop ends it. `NoticesFromTheAgentTests` builds the
|
||||
agent's own events for every refusal and every stop and went red with each text above (`docs/08_UI.md` §Notifications policy).
|
||||
- **Disable all hooking says when it applies.** Turning it on said "The capture agent reads it at the next session start";
|
||||
a game being measured stops at its next safety scan, within 30 seconds, and the message says so.
|
||||
- **Turning hooking off with no agent says nothing changed** — Settings' *Turn off*, the game page's switch and a
|
||||
withdrawn exception said "Nothing was enabled.", the enabling path's words.
|
||||
- **A viewer over a copy leaves every agent setting alone.** The user-mode exception option, the three Recording numbers
|
||||
and the update channel stayed live in `--data-dir`, where no agent reads them (`ViewerModeTests`).
|
||||
- `docs/08_UI.md` listed a "PawnIO missing" banner that was never built; struck, with the banners that do exist.
|
||||
|
||||
## [0.1.0-beta.17] - 2026-10-07
|
||||
|
||||
|
||||
+2
-2
@@ -406,8 +406,8 @@ Unchanged in spirit from v1, bumped to `v2` for the new message set.
|
||||
| `SessionHeld` | A→UI | **Added 2026-09-23.** 1 Hz while a client listens, for a session held unhooked only: `{ sessionGuid, elapsedS, gpuTempC?, cpuTempC?, gpuLoadPct?, cpuLoadPct?, gameVramDedicatedMb?, gameRamPrivateMb? }` — how long it has run and the machine's sensors (and since beta.12 the game process's own memory, read from outside it — optional, an older client ignores them). **Never `SessionProgress`**: its `presents5s`, `presentedQualifier` and `fgMode` are required, and zeros there would put measured-looking numbers on the wire for a session that measures nothing (rule 6 has nothing to show and shows nothing) |
|
||||
| `SessionProgress` | A→UI | 1 Hz: `{ sessionGuid, elapsedS, presents5s, presentedFps5s?, presentedQualifier, nativeFps5s?, displayedFps5s?, fgFactor?, fgMode, upscaler?, upscalerQuality?, upscalerDriverReported?, renderW/H?, outputW/H?, rtActive?, gpuTempC?, cpuTempC?, cpuLoadPct?, vramProcMb?, latencyUs?, fgRefusal?, fgRuntimeCensus?, gameVramDedicatedMb?, gameRamPrivateMb? }` (the last two added 2026-10-03, beta.12, optional: the game process's dedicated GPU memory and private working set, MiB, from the newest telemetry tick; `vramProcMb` stays reserved for the in-process figure and has no producer) — a 5 s rolling window over the ring through the SAME Domain calculators the row uses (`SessionProgressCalculator`, D13). **`upscalerDriverReported` added 2026-09-21, optional:** `dlss` when the NVIDIA driver reports an NGX super-resolution feature created and evaluated in the target (`03_METRICS` §The driver-reported rung), so the live card says `DLSS (driver-reported)` where no hook can name the upscaler; identity only. **`cpuLoadPct` added 2026-09-21, optional** (CPU time busy over the last telemetry tick, 0–100; `cpuTempC` has a producer from the same date, present only when the Agent is elevated with PawnIO). **Two fields added 2026-09-14, both optional (an older client ignores them, §C):** `fgRefusal` is the row's `fg_refusal` (schema 0003) — present when `fgMode` names a technology and `fgFactor` is absent, so the live card can say "DLSS-G active — factor not counted" rather than N/A; `fgRuntimeCensus` is the raw census so the `fg_runtime_loaded` chip can name the module. **Rule 6 at the wire (2026-09-13):** `nativeFps5s` / `displayedFps5s` / `fgFactor` are present only when frame generation was measured in the window; otherwise `presentedFps5s` stands alone with `presentedQualifier` (`census_not_run` · `no_fg_runtime` · `fg_runtime_loaded` · `none_withheld`, the row's `presented_qualifier` from the same function). Every unmeasured field is absent, never 0. Suppressed when no client is connected |
|
||||
| `SessionCompleted` | A→UI | `{ sessionGuid, sessionId?, exitStatus, tier, finalize, reason, gameId?, gameName? }` — UI loads the full row from SQLite; `sessionId` is null and `finalize` is `discarded` when the row was not stored (under the minimum length), or `game_removed` when its entry was removed with its sessions while it ran (2026-09-23), or **`faulted` when the session's task threw before it could finalize** (2026-09-23: it follows the `CaptureError SessionFaulted`, with `exitStatus` `interrupted` and `reason` `SessionFaulted`, so the live card and the tray let go of a session that no longer runs; the `.partial` stays for recovery); `exitStatus` is the row's vocabulary (`normal` · `crashed` · `unhooked_safety` · `degraded`); `reason` is the loop's `SessionEndReason`. **`gameId` / `gameName` added 2026-09-23, optional:** the entry the session was stored under — the finalizer's owner when it re-keyed a session whose entry was removed, else the one it started under — so the notice names the session that completed, not whatever the live card last showed |
|
||||
| `CaptureRefused` | A→UI | `{ gameId, gameName, reason, family?, signal?, hookingTurnedOff, guardReason? }` — **`guardReason` (beta.13, optional)** is the guard's own reason when it named a family; `BlockedService` / `BlockedDriver` is a finding on the PC, not in the game, and the notice says so (§S23-3); `reason` stays the session's end reason — **guard fired**; `hookingTurnedOff` (2026-09-22) is true when the finding turned the game's hooking off (`19_SAFETY` §What a finding does to the game); UI shows the plain-language explanation — ~~and the Tier-2 offer~~; there is no alternative measurement to offer, only the option to record the session unmeasured (`08_UI` §Safety events). *(Built: for `RefusedByGuard`, `RefusedPreviouslyBlocked`, `RefusedKillSwitch`, `PreScanCouldNotVerify` and, since 2026-09-21 (beta.4), `TargetUnreadable` — a protected process the Agent could not open (added 2026-10-04) — `PreScanCouldNotVerify` with no family, because "could not verify" is neither a hit nor a pass; `family`/`signal` are the verdict's. A game merely not enabled or not consented raises nothing: that is an ordinary Tier-2 row, not a refusal to explain.)* |
|
||||
| `CaptureDegraded` | A→UI | `{ sessionGuid, from: 1, to: 2, reason }` — Tier 1 → Tier 2 mid-flight, or overlay self-disabled. **Under a two-rung ladder this means measurement STOPPED**, not that it continued at lower fidelity, and the notice must say so. *(Built: `SupervisionLost`, `WriterSelfDisabled`, `WriterStoppedBlocklisted`, `WriterNeverInstalledHooks`, `SupervisionFaulted`, `KillSwitchEngaged` — `RecordedSessionEvents.Classify` is the table.)* |
|
||||
| `CaptureRefused` | A→UI | `{ gameId, gameName, reason, family?, signal?, hookingTurnedOff, guardReason? }` — **`guardReason` (beta.13, optional)** is the guard's own reason ~~when it named a family~~ **whenever it refused (beta.18; beside a family only until then)**: `BlockedService` / `BlockedDriver` is a finding on the PC, not in the game, and the notice says so (§S23-3), and a refusal no family names is said in the guard's words (`Formats.GuardSentence`) — it printed the end's name, "reason RefusedByGuard"; `reason` stays the session's end reason — **guard fired**; `hookingTurnedOff` (2026-09-22) is true when the finding turned the game's hooking off (`19_SAFETY` §What a finding does to the game); UI shows the plain-language explanation — ~~and the Tier-2 offer~~; there is no alternative measurement to offer, only the option to record the session unmeasured (`08_UI` §Safety events). *(Built: for `RefusedByGuard`, `RefusedPreviouslyBlocked`, `RefusedKillSwitch`, `PreScanCouldNotVerify` and, since 2026-09-21 (beta.4), `TargetUnreadable` — a protected process the Agent could not open (added 2026-10-04) — `PreScanCouldNotVerify` with no family, because "could not verify" is neither a hit nor a pass; `family`/`signal` are the verdict's. A game merely not enabled or not consented raises nothing: that is an ordinary Tier-2 row, not a refusal to explain.)* |
|
||||
| `CaptureDegraded` | A→UI | `{ sessionGuid, from: 1, to: 2, reason }` — Tier 1 → Tier 2 mid-flight, or overlay self-disabled. **Under a two-rung ladder this means measurement STOPPED**, not that it continued at lower fidelity, and the notice must say so. *(Since beta.18 it says the end in words, `Formats.EndReasonText`; it printed `reason` raw — "The hook stopped (WriterSelfDisabled); the session continues without measuring" — and a stop ends the session, it does not continue it.)* *(Built: `SupervisionLost`, `WriterSelfDisabled`, `WriterStoppedBlocklisted`, `WriterNeverInstalledHooks`, `SupervisionFaulted`, `KillSwitchEngaged` — `RecordedSessionEvents.Classify` is the table.)* |
|
||||
| `SafetyUnhook` | A→UI | `{ sessionGuid, family?, signal?, hookingTurnedOff, guardReason? }` — `guardReason` as on `CaptureRefused` (beta.13) — anti-cheat appeared mid-session; prominent UI notice; `hookingTurnedOff` as on `CaptureRefused`. *(Built: the verdict that FIRED, not the pass that started the session — `CaptureOutcome.Verdict` carries the supervisor's last verdict on this reason since 2026-09-13.)* |
|
||||
| `HookingTurnedOff` | A→UI | `{ gameId, gameName?, reason, family?, signal? }` — **since 2026-09-25 (beta.8):** the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) found anti-cheat in a game whose hooking the user had turned on, and turned it off. Not a session event — no session is running — so the UI's notice carries no "record without measuring" action, only Dismiss (`SafetyNoticeKind.HookingOff`). A finding on a game whose hooking was already off sends nothing: its page and its library card change, nothing the user switched on did. Additive: a client that does not know the type ignores it (§Versioning). |
|
||||
| `CaptureError` | A→UI | `{ sessionGuid?, code, message }` — `InjectFailed`, `RingVersionMismatch`, `AttachRefused`, ~~`EtwAccessDenied`~~ (struck 2026-09-13 with the tier), ~~`PresentMonMissing`~~ (retired with the tool, 2026-08-27 — a code naming an implementation nobody chose), `TelemetryUnavailable`, `DbWriteFailed`, `SessionFaulted` (the session's task threw before finalize; the `.partial` stays for recovery, and ~~no `SessionCompleted` follows~~ a `SessionCompleted` with `finalize: faulted` follows since 2026-09-23). *(Built: `RingVersionMismatch` for a layout / record-size / build-id refusal — the "restart the game after an update" case — `AttachRefused` for the rest of the ring's refusals, `InjectFailed` for a target that could not be started, pinned, read or singled out.)* |
|
||||
|
||||
+27
-3
@@ -27,7 +27,10 @@ WPF + **WPF UI (Wpf.Ui, Fluent)**. Shell = `ui:FluentWindow` with custom `ui:Tit
|
||||
> `ViewerModeTests`); the pill reads *Viewer — no Agent*, a persistent InfoBar names the folder, and every control that
|
||||
> would ask the Agent or change the PC is disabled — hooking, the exception's grant and withdrawal, re-enabling, Delete
|
||||
> all sessions, the kill switch, the admin mode, the logon task, the Vulkan layer, Start with Windows, the automatic
|
||||
> update check, Help ▸ Check for updates, Tools ▸ Update detection rules and the tray's Pause. The profile's own folder
|
||||
> update check, Help ▸ Check for updates, Tools ▸ Update detection rules and the tray's Pause — and, since beta.18,
|
||||
> every setting the Agent reads (the user-mode exception option and the three Recording numbers had been missed, and a
|
||||
> change said the capture agent would read it) and the update channel beside the update check
|
||||
> (`ViewerModeTests.EverySettingTheAgentReadsIsOffInAViewer`). The profile's own folder
|
||||
> is refused however it is spelled (case, separators, a relative path, a junction), as is a folder that does not exist;
|
||||
> a refusal is a message box and exit 2. The viewer's folder is its own single-instance key, so it runs beside the
|
||||
> profile's App. D6 is unchanged: the Agent's `--data-dir` stays under `--console`.
|
||||
@@ -128,7 +131,7 @@ The Menu sits in its own row **below** the TitleBar (never inside the drag regio
|
||||
## Notifications policy
|
||||
|
||||
- **In-app, transient** (rules updated, export done, non-fatal capture warning): `ISnackbarService` snackbar, 4 s.
|
||||
- **In-app, persistent** (Agent offline, PawnIO missing, update downloaded): `ui:InfoBar` banner pinned above content with action button.
|
||||
- **In-app, persistent** (Agent offline, ~~PawnIO missing,~~ update downloaded, a viewer's folder, the safety notices): `ui:InfoBar` banner pinned above content with action button. *(Corrected 2026-10-07: no PawnIO banner was ever built — CPU temperature reads N/A, and Settings ▸ System says it needs the admin mode and PawnIO; the viewer's banner (D52) and the safety notices were missing from the list.)*
|
||||
- **System-level, app possibly minimized** (session saved with "View" action, capture error while in tray, update available): tray balloon/toast via H.NotifyIcon.
|
||||
- One event → exactly one channel; never duplicate the same event across snackbar *and* tray.
|
||||
|
||||
@@ -167,6 +170,26 @@ The Menu sits in its own row **below** the TitleBar (never inside the drag regio
|
||||
> reads as before. Tests: `SafetyNoticesTests.AServiceOrDriverIsOnThisPcAndAModuleIsInThisGame`,
|
||||
> `…AnUnhookSaysWhereTheFindingWasAndPromisesNoReEnable`, `Tier2ReasonTests`.
|
||||
>
|
||||
> **Every notice in words — beta.18** (found while writing the guide, beta.17). Three texts printed what only the code
|
||||
> knows. The gate's own refusals — *Disable all hooking*, a game blocked before — carry the gate's label where a finding
|
||||
> carries its family, and the kill switch's notice read *"kill switch was detected in this game (the global 'disable all
|
||||
> hooking' switch is on (FR-2.4); …). FrameLedger will not inject into it, and nothing overrides that."* They are said as
|
||||
> the session's end now (`Formats.EndReasonText`: "All hooking is switched off in Settings, so nothing was measured."),
|
||||
> never as a finding. A refusal no family names read *"The anti-cheat guard did not hook this game: reason
|
||||
> RefusedByGuard."*: the events carry the guard's own reason for every refusal since (`07_IPC`), and the sentence is its
|
||||
> words — "… the game is 32-bit, and the hook runs in 64-bit games only."; an older Agent's reads `End_RefusedByGuard`.
|
||||
> A 30 s re-scan that could not look while the game still ran read *"Capture stopped: Access is denied. was detected while
|
||||
> the game was running"*; it reads `Safety_Unhooked_Unnamed_Format` ("Capture stopped while the game was running — the
|
||||
> game's process could not be opened — and FrameLedger unhooked."). And `CaptureDegraded` printed its reason raw and said
|
||||
> the session went on — *"The hook stopped (WriterSelfDisabled); the session continues without measuring."* — where a stop
|
||||
> ends it: the notice is the end's own sentence ("The measuring hook turned itself off after repeated faults, so measuring
|
||||
> stopped."), and `Notice_Degraded_Unknown_Format` names only a reason this build has no words for. Tests:
|
||||
> `NoticesFromTheAgentTests` builds each event as the Agent does — the gate's verdicts, the native facade's
|
||||
> (`AntiCheatVerdict.FromNative`), `RecordedSessionEvents.PublishReason`, the wire's codec — walks every refusal and every
|
||||
> stop, and refuses an enum's name, a requirement's id or "reason X" in any notice; it went red on the unfixed code with
|
||||
> exactly the texts above. Until then the notices' tests raised events written by hand ("GuardBlocked", "HookFaulted", a
|
||||
> guard reason sent as the end), which no Agent sends.
|
||||
>
|
||||
> **Corrected 2026-09-14, after the owner saw a red bar with no way out.** WPF UI 4.3.0's `InfoBar` template has
|
||||
> **no `ContentPresenter`**, so the action button above — placed as the InfoBar's Content, the only dismissal once
|
||||
> `IsClosable="False"` removed the X — was never rendered. The view model was right and the screen was wrong.
|
||||
@@ -649,7 +672,8 @@ Agent section: elevation state with a plain explanation of what elevation *optio
|
||||
> **Built 2026-09-14 (P3 PR-8a), with three rows deferred to PR-8b and one to PR-9.** `SettingsViewModel` over
|
||||
> `Application.Settings.RegisteredSettings` (the registry of `06_DATA_MODEL` §Settings registry — every write is
|
||||
> one `settings` row, and a key the Agent reads gets the 4 s "Applied. The capture agent reads it at the next
|
||||
> session start" line, D16). **Capture, first:** the kill switch as a `CardExpander` whose header is the toggle
|
||||
> session start" line, D16 — but for turning the kill switch on, which says a game being measured stops at its next
|
||||
> safety scan, within 30 seconds: beta.18; until then it said the next session start). **Capture, first:** the kill switch as a `CardExpander` whose header is the toggle
|
||||
> and whose state line says "All hooking is off" / "Per-game settings decide" — it is `hooking.kill_switch`, the
|
||||
> gate's fourth input (`CaptureSession` consults it at every 30 s re-scan, so a running measured session stops at
|
||||
> its next scan; nothing else needs pushing); the hook-enabled list is `games.hook_enabled` as the ledger has it,
|
||||
|
||||
+5
-3
@@ -2072,11 +2072,13 @@ release.*
|
||||
- **A fresh worktree cannot run the full gate** (the native configure, `CONTRIBUTING`): the stack's tip was gated in the
|
||||
main checkout on a detached HEAD, and each PR's own CI ran on its branch.
|
||||
- **Found while writing the guide, not fixed** (a task each): two notices can print an internal name — *"The hook
|
||||
stopped (WriterSelfDisabled)…"*, and a refusal no anti-cheat names reads *"The anti-cheat guard did not hook this
|
||||
game: reason RefusedKillSwitch."*; the kill switch's *Applied* strip says "at the next session start" (it applies
|
||||
stopped (WriterSelfDisabled)…"*, and a refusal no anti-cheat names reads ~~*"The anti-cheat guard did not hook this
|
||||
game: reason RefusedKillSwitch."*~~ *"…: reason RefusedByGuard."* *(corrected 2026-10-07 by beta.18's tests, which
|
||||
build the Agent's own events: the kill switch's refusal carries the gate's label where a family goes, and read "kill
|
||||
switch was detected in this game (… (FR-2.4) …)"; a re-scan that could not look read "Access is denied. was detected")*; the kill switch's *Applied* strip says "at the next session start" (it applies
|
||||
within 30 s); *Turn off* failing says "Nothing was enabled."; in the viewer, the exception switch, the Recording numbers and the Channel stay enabled;
|
||||
`08_UI` lists a "PawnIO missing" banner that does not exist; and a release's Overlay build id reads `-dirty` (§0.1.0-beta.4,
|
||||
"Found and NOT fixed", still open).
|
||||
"Found and NOT fixed", still open). *(All but the build id fixed by beta.18 PR-2, 2026-10-07; the build id is PR-3's.)*
|
||||
|
||||
**Owner-only, added to the list below:** item 13.
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
Text="{x:Static res:Strings.Settings_Exceptions_Body}" />
|
||||
</StackPanel>
|
||||
<ui:ToggleSwitch Grid.Column="1" Margin="12,0" AutomationProperties.Name="{x:Static res:Strings.Settings_Exceptions_Label}"
|
||||
IsChecked="{Binding ViewModel.UserModeExceptions, Mode=TwoWay}" />
|
||||
IsChecked="{Binding ViewModel.UserModeExceptions, Mode=TwoWay}" IsEnabled="{Binding ViewModel.ActsOnThisPc}" />
|
||||
</Grid>
|
||||
</ui:CardExpander.Header>
|
||||
<StackPanel>
|
||||
@@ -165,7 +165,8 @@
|
||||
Content="{x:Static res:Strings.Settings_SafetyDocs}"
|
||||
Icon="{ui:SymbolIcon Open24}" />
|
||||
|
||||
<!-- Recording policy: the three numbers and background capture (D16: the Agent reads them at session start). -->
|
||||
<!-- Recording policy: the three numbers and background capture (D16: the Agent reads them at session start) — off in a
|
||||
viewer, which has no Agent (beta.18; every setting the Agent reads is, ViewerModeTests). -->
|
||||
<ui:TextBlock FontTypography="Subtitle" Margin="0,20,0,8" Text="{x:Static res:Strings.Settings_Policy_Header}" />
|
||||
<ui:CardControl Margin="0,4,0,0" Icon="{ui:SymbolIcon Timer24}">
|
||||
<ui:CardControl.Header>
|
||||
@@ -176,6 +177,7 @@
|
||||
</ui:CardControl.Header>
|
||||
<ui:NumberBox MinWidth="140"
|
||||
AutomationProperties.Name="{x:Static res:Strings.Settings_MinSession_Label}"
|
||||
IsEnabled="{Binding ViewModel.ActsOnThisPc}"
|
||||
Maximum="{x:Static vm:SettingsViewModel.MinSessionMaximum}"
|
||||
Minimum="{x:Static vm:SettingsViewModel.MinSessionMinimum}"
|
||||
SpinButtonPlacementMode="Inline"
|
||||
@@ -190,6 +192,7 @@
|
||||
</ui:CardControl.Header>
|
||||
<ui:NumberBox MinWidth="140"
|
||||
AutomationProperties.Name="{x:Static res:Strings.Settings_Interval_Label}"
|
||||
IsEnabled="{Binding ViewModel.ActsOnThisPc}"
|
||||
Maximum="{x:Static vm:SettingsViewModel.IntervalMaximum}"
|
||||
Minimum="{x:Static vm:SettingsViewModel.IntervalMinimum}"
|
||||
SpinButtonPlacementMode="Inline"
|
||||
@@ -204,6 +207,7 @@
|
||||
</ui:CardControl.Header>
|
||||
<ui:NumberBox MinWidth="140"
|
||||
AutomationProperties.Name="{x:Static res:Strings.Settings_Retention_Label}"
|
||||
IsEnabled="{Binding ViewModel.ActsOnThisPc}"
|
||||
Maximum="{x:Static vm:SettingsViewModel.RetentionMaximum}"
|
||||
Minimum="0"
|
||||
SpinButtonPlacementMode="Inline"
|
||||
@@ -342,6 +346,7 @@
|
||||
<ComboBox MinWidth="140"
|
||||
AutomationProperties.Name="{x:Static res:Strings.Settings_UpdateChannel_Label}"
|
||||
DisplayMemberPath="Label"
|
||||
IsEnabled="{Binding ViewModel.ActsOnThisPc}"
|
||||
ItemsSource="{Binding ViewModel.UpdateChannels}"
|
||||
SelectedValue="{Binding ViewModel.UpdateChannel, Mode=TwoWay}"
|
||||
SelectedValuePath="Value" />
|
||||
|
||||
@@ -24,7 +24,8 @@ public sealed record AntiCheatExceptionResult(AntiCheatExceptionOutcome Outcome,
|
||||
RefusalText() ?? Detail ?? Strings.Common_NotAvailable),
|
||||
AntiCheatExceptionOutcome.VersionMismatch => Shared.Strings.Safety_Exception_VersionMismatch,
|
||||
AntiCheatExceptionOutcome.OptionOff => Shared.Strings.Safety_Exception_OptionOff,
|
||||
AntiCheatExceptionOutcome.AgentUnavailable => Shared.Strings.Safety_Consent_AgentUnavailable,
|
||||
// A grant and a withdrawal alike (beta.18): "Nothing was enabled." was the hooking consent's words, untrue for a withdrawal.
|
||||
AntiCheatExceptionOutcome.AgentUnavailable => Strings.Agent_NotConnected_NothingChanged,
|
||||
AntiCheatExceptionOutcome.Failed => Detail ?? Strings.Common_NotAvailable,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
@@ -55,13 +55,16 @@ public sealed class SafetyNotices : IDisposable
|
||||
return new SafetyNotice(SafetyNoticeKind.Unhooked, Strings.Notice_Unhooked_Title, TurnedOff(UnhookText(unhooked), unhooked.HookingTurnedOff), now);
|
||||
// The Agent's pre-scan of the library turned hooking off for a game the user had turned it on for (2026-09-25):
|
||||
// not a session event, so none of a refusal's "this run is still recorded" — no run is going on.
|
||||
// Its reason is the guard's own, and it is sent only for a finding about the game, which names its family.
|
||||
case IpcMessageType.HookingTurnedOff when IpcCodec.Payload<HookingTurnedOffEvent>(envelope) is { } off:
|
||||
return new SafetyNotice(SafetyNoticeKind.HookingOff,
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Notice_HookingOff_Title_Format, off.GameName ?? Strings.Common_NotAvailable),
|
||||
TurnedOff(RefusalText(off.Reason, off.Reason, off.Family, off.Signal), turnedOff: true), now);
|
||||
TurnedOff(GuardText(off.Reason, off.Family, off.Signal) ?? Shared.Strings.Safety_Refused_Unnamed, turnedOff: true), now);
|
||||
// The session's end in words (beta.18): it printed the enum's name — "The hook stopped (WriterSelfDisabled)" —
|
||||
// and said the session continued without measuring, while a stop ends it (07_IPC: measurement STOPPED).
|
||||
case IpcMessageType.CaptureDegraded when IpcCodec.Payload<CaptureDegradedEvent>(envelope) is { } degraded:
|
||||
return new SafetyNotice(SafetyNoticeKind.Degraded, Strings.Notice_Degraded_Title,
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Notice_Degraded_Body_Format, degraded.Reason), now);
|
||||
Formats.EndReasonText(degraded.Reason) ?? string.Format(CultureInfo.CurrentCulture, Strings.Notice_Degraded_Unknown_Format, degraded.Reason), now);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -73,35 +76,45 @@ public sealed class SafetyNotices : IDisposable
|
||||
/// <summary>
|
||||
/// A driver or service that started on the PC mid-session is said as that (beta.13, §S23-3) — not "detected while the
|
||||
/// game was running … until you enable it again", which was untrue twice: such a finding turns no hooking off, and a
|
||||
/// finding about the game turns it off for good (the turned-off sentence follows).
|
||||
/// finding about the game turns it off for good (the turned-off sentence follows). A re-scan that could not look while
|
||||
/// the game still ran is said as that too (beta.18): it named its signal as a finding, "Access is denied was detected".
|
||||
/// </summary>
|
||||
private static string UnhookText(SafetyUnhookEvent unhooked) =>
|
||||
Formats.IsMachineWide(unhooked.GuardReason) && unhooked.Family is { } family
|
||||
? string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_MachineWide_Format, family, unhooked.Signal ?? Strings.Common_NotAvailable)
|
||||
: string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_Format, unhooked.Family ?? unhooked.Signal ?? Strings.Common_NotAvailable);
|
||||
|
||||
/// <summary><paramref name="reason"/> is the session's end reason; <paramref name="guardReason"/> the guard's own, when it named a family.</summary>
|
||||
private static string RefusalText(string reason, string? guardReason, string? family, string? signal)
|
||||
private static string UnhookText(SafetyUnhookEvent unhooked) => unhooked switch
|
||||
{
|
||||
if (string.Equals(reason, "PreScanCouldNotVerify", StringComparison.Ordinal))
|
||||
{
|
||||
return Shared.Strings.Safety_Refused_CouldNotVerify;
|
||||
}
|
||||
{ Family: { } family } when Formats.IsMachineWide(unhooked.GuardReason) =>
|
||||
string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_MachineWide_Format, family, unhooked.Signal ?? Strings.Common_NotAvailable),
|
||||
{ Family: null, GuardReason: { Length: > 0 } guardReason } =>
|
||||
string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_Unnamed_Format, Formats.GuardReasonText(guardReason)),
|
||||
_ => string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_Format, unhooked.Family ?? unhooked.Signal ?? Strings.Common_NotAvailable),
|
||||
};
|
||||
|
||||
if (string.Equals(reason, "TargetUnreadable", StringComparison.Ordinal))
|
||||
{
|
||||
return Shared.Strings.Safety_Refused_TargetUnreadable;
|
||||
}
|
||||
/// <summary>
|
||||
/// A refusal in words. <paramref name="reason"/> is the session's end; <paramref name="guardReason"/> the guard's own,
|
||||
/// sent for every refusal it gave since beta.18 (beside a family only, before).
|
||||
/// </summary>
|
||||
private static string RefusalText(string reason, string? guardReason, string? family, string? signal) => reason switch
|
||||
{
|
||||
"PreScanCouldNotVerify" => Shared.Strings.Safety_Refused_CouldNotVerify,
|
||||
"TargetUnreadable" => Shared.Strings.Safety_Refused_TargetUnreadable,
|
||||
// What the guard found, or could not do; from an agent that sent no reason beside no family, the end's own words.
|
||||
"RefusedByGuard" => GuardText(guardReason, family, signal) ?? Strings.End_RefusedByGuard,
|
||||
// The gate's own refusals (beta.18) — Disable all hooking, a game blocked before — are the user's switch or the row's,
|
||||
// never a finding. The gate labels them in the family's place, and the kill switch's notice read "kill switch was
|
||||
// detected in this game (the global 'disable all hooking' switch is on (FR-2.4); …)".
|
||||
// A name this build has no words for (a newer agent's) is named as it is, never as something detected.
|
||||
_ => Formats.EndReasonText(reason) ?? GuardText(guardReason, family, signal)
|
||||
?? (string.IsNullOrEmpty(reason) ? Shared.Strings.Safety_Refused_Unnamed : Formats.GuardSentence(reason)),
|
||||
};
|
||||
|
||||
// A refusal no anti-cheat family names (beta.8) — the guard could not look, the game is 32-bit — is said as what it
|
||||
// is. It used to name its SIGNAL as the family, and the notice read "Access is denied was detected in this game".
|
||||
if (family is null)
|
||||
{
|
||||
return string.IsNullOrEmpty(reason) ? Shared.Strings.Safety_Refused_Unnamed : Formats.GuardSentence(reason);
|
||||
}
|
||||
|
||||
return Formats.NamedRefusal(guardReason, family, signal ?? reason);
|
||||
}
|
||||
/// <summary>
|
||||
/// What the guard said, as a sentence: an anti-cheat it named, found in this game or on this PC; a refusal no family names
|
||||
/// (beta.8) in its own words — never its signal as the family, which read "Access is denied was detected in this game".
|
||||
/// Null when it said nothing.
|
||||
/// </summary>
|
||||
private static string? GuardText(string? guardReason, string? family, string? signal) =>
|
||||
family is { Length: > 0 }
|
||||
? Formats.NamedRefusal(guardReason, family, signal ?? Strings.Common_NotAvailable)
|
||||
: guardReason is { Length: > 0 } ? Formats.GuardSentence(guardReason) : null;
|
||||
|
||||
private void OnEvent(object? sender, AgentEventArgs e)
|
||||
{
|
||||
|
||||
Generated
+9
-3
@@ -62,6 +62,7 @@ public static class Strings
|
||||
nameof(Agent_Banner_Offline_Body),
|
||||
nameof(Agent_Banner_Offline_Title),
|
||||
nameof(Agent_Banner_Retry),
|
||||
nameof(Agent_NotConnected_NothingChanged),
|
||||
nameof(Agent_State_Connected),
|
||||
nameof(Agent_State_Connecting),
|
||||
nameof(Agent_State_Elevating),
|
||||
@@ -645,8 +646,8 @@ public static class Strings
|
||||
nameof(Nav_Games),
|
||||
nameof(Nav_Logs),
|
||||
nameof(Nav_Settings),
|
||||
nameof(Notice_Degraded_Body_Format),
|
||||
nameof(Notice_Degraded_Title),
|
||||
nameof(Notice_Degraded_Unknown_Format),
|
||||
nameof(Notice_Dismiss),
|
||||
nameof(Notice_Error_Title),
|
||||
nameof(Notice_HookingOff_Title_Format),
|
||||
@@ -810,6 +811,7 @@ public static class Strings
|
||||
nameof(Settings_Interval_Body),
|
||||
nameof(Settings_Interval_Label),
|
||||
nameof(Settings_Invalid_Format),
|
||||
nameof(Settings_KillSwitch_Applied_On),
|
||||
nameof(Settings_KillSwitch_Body),
|
||||
nameof(Settings_KillSwitch_Label),
|
||||
nameof(Settings_KillSwitch_Off),
|
||||
@@ -1124,6 +1126,8 @@ public static class Strings
|
||||
|
||||
public static string Agent_Banner_Retry => ResourceManager.GetString(nameof(Agent_Banner_Retry), Culture) ?? nameof(Agent_Banner_Retry);
|
||||
|
||||
public static string Agent_NotConnected_NothingChanged => ResourceManager.GetString(nameof(Agent_NotConnected_NothingChanged), Culture) ?? nameof(Agent_NotConnected_NothingChanged);
|
||||
|
||||
public static string Agent_State_Connected => ResourceManager.GetString(nameof(Agent_State_Connected), Culture) ?? nameof(Agent_State_Connected);
|
||||
|
||||
public static string Agent_State_Connecting => ResourceManager.GetString(nameof(Agent_State_Connecting), Culture) ?? nameof(Agent_State_Connecting);
|
||||
@@ -2290,10 +2294,10 @@ public static class Strings
|
||||
|
||||
public static string Nav_Settings => ResourceManager.GetString(nameof(Nav_Settings), Culture) ?? nameof(Nav_Settings);
|
||||
|
||||
public static string Notice_Degraded_Body_Format => ResourceManager.GetString(nameof(Notice_Degraded_Body_Format), Culture) ?? nameof(Notice_Degraded_Body_Format);
|
||||
|
||||
public static string Notice_Degraded_Title => ResourceManager.GetString(nameof(Notice_Degraded_Title), Culture) ?? nameof(Notice_Degraded_Title);
|
||||
|
||||
public static string Notice_Degraded_Unknown_Format => ResourceManager.GetString(nameof(Notice_Degraded_Unknown_Format), Culture) ?? nameof(Notice_Degraded_Unknown_Format);
|
||||
|
||||
public static string Notice_Dismiss => ResourceManager.GetString(nameof(Notice_Dismiss), Culture) ?? nameof(Notice_Dismiss);
|
||||
|
||||
public static string Notice_Error_Title => ResourceManager.GetString(nameof(Notice_Error_Title), Culture) ?? nameof(Notice_Error_Title);
|
||||
@@ -2620,6 +2624,8 @@ public static class Strings
|
||||
|
||||
public static string Settings_Invalid_Format => ResourceManager.GetString(nameof(Settings_Invalid_Format), Culture) ?? nameof(Settings_Invalid_Format);
|
||||
|
||||
public static string Settings_KillSwitch_Applied_On => ResourceManager.GetString(nameof(Settings_KillSwitch_Applied_On), Culture) ?? nameof(Settings_KillSwitch_Applied_On);
|
||||
|
||||
public static string Settings_KillSwitch_Body => ResourceManager.GetString(nameof(Settings_KillSwitch_Body), Culture) ?? nameof(Settings_KillSwitch_Body);
|
||||
|
||||
public static string Settings_KillSwitch_Label => ResourceManager.GetString(nameof(Settings_KillSwitch_Label), Culture) ?? nameof(Settings_KillSwitch_Label);
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
<value>キャプチャエージェントがオフライン</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Agent_NotConnected_NothingChanged" xml:space="preserve">
|
||||
<value>キャプチャエージェントに接続されていません。何も変更されていません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Agent_Banner_Retry" xml:space="preserve">
|
||||
<value>再試行</value>
|
||||
<comment>review</comment>
|
||||
@@ -1833,8 +1837,8 @@
|
||||
<value>アプリ</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Body_Format" xml:space="preserve">
|
||||
<value>フックが停止しました ({0})。セッションは実測なしで続行します。</value>
|
||||
<data name="Notice_Degraded_Unknown_Format" xml:space="preserve">
|
||||
<value>計測を停止しました ({0})。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Title" xml:space="preserve">
|
||||
@@ -1921,6 +1925,10 @@
|
||||
<value>適用しました。キャプチャエージェントは次回のセッション開始時に読み込みます。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_KillSwitch_Applied_On" xml:space="preserve">
|
||||
<value>すべてのフックを無効にしました。実測中のゲームは次回の安全スキャン (30 秒以内) で実測を停止します。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Capture_Header" xml:space="preserve">
|
||||
<value>キャプチャ</value>
|
||||
<comment>review</comment>
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
<data name="Agent_Banner_Offline_Title" xml:space="preserve">
|
||||
<value>Capture agent offline</value>
|
||||
</data>
|
||||
<data name="Agent_NotConnected_NothingChanged" xml:space="preserve">
|
||||
<value>The capture agent is not connected. Nothing was changed.</value>
|
||||
</data>
|
||||
<data name="Agent_Banner_Retry" xml:space="preserve">
|
||||
<value>Retry</value>
|
||||
</data>
|
||||
@@ -1380,8 +1383,8 @@
|
||||
<data name="Logs_Source_Ui" xml:space="preserve">
|
||||
<value>App</value>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Body_Format" xml:space="preserve">
|
||||
<value>The hook stopped ({0}); the session continues without measuring.</value>
|
||||
<data name="Notice_Degraded_Unknown_Format" xml:space="preserve">
|
||||
<value>Measuring stopped ({0}).</value>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Title" xml:space="preserve">
|
||||
<value>Measurement stopped</value>
|
||||
@@ -1446,6 +1449,9 @@
|
||||
<data name="Settings_Applied" xml:space="preserve">
|
||||
<value>Applied. The capture agent reads it at the next session start.</value>
|
||||
</data>
|
||||
<data name="Settings_KillSwitch_Applied_On" xml:space="preserve">
|
||||
<value>All hooking is off. A game being measured stops being measured at its next safety scan, within 30 seconds.</value>
|
||||
</data>
|
||||
<data name="Settings_Capture_Header" xml:space="preserve">
|
||||
<value>Capture</value>
|
||||
</data>
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
<data name="Agent_Banner_Offline_Title" xml:space="preserve">
|
||||
<value>Capture agent ngoại tuyến</value>
|
||||
</data>
|
||||
<data name="Agent_NotConnected_NothingChanged" xml:space="preserve">
|
||||
<value>Capture agent chưa kết nối. Không có gì thay đổi.</value>
|
||||
</data>
|
||||
<data name="Agent_Banner_Retry" xml:space="preserve">
|
||||
<value>Thử lại</value>
|
||||
</data>
|
||||
@@ -1375,8 +1378,8 @@
|
||||
<data name="Logs_Source_Ui" xml:space="preserve">
|
||||
<value>Ứng dụng</value>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Body_Format" xml:space="preserve">
|
||||
<value>Hook đã dừng ({0}); phiên tiếp tục mà không đo.</value>
|
||||
<data name="Notice_Degraded_Unknown_Format" xml:space="preserve">
|
||||
<value>Việc đo đã dừng ({0}).</value>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Title" xml:space="preserve">
|
||||
<value>Đã dừng đo</value>
|
||||
@@ -1441,6 +1444,9 @@
|
||||
<data name="Settings_Applied" xml:space="preserve">
|
||||
<value>Đã áp dụng. Capture agent đọc ở lần bắt đầu phiên kế tiếp.</value>
|
||||
</data>
|
||||
<data name="Settings_KillSwitch_Applied_On" xml:space="preserve">
|
||||
<value>Đã tắt toàn bộ hooking. Game đang được đo sẽ dừng đo ở lần quét an toàn kế tiếp, trong vòng 30 giây.</value>
|
||||
</data>
|
||||
<data name="Settings_Capture_Header" xml:space="preserve">
|
||||
<value>Thu thập</value>
|
||||
</data>
|
||||
|
||||
@@ -755,7 +755,7 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
try
|
||||
{
|
||||
HookingConsentResult result = await _consent.DisableAsync(Game.Id).ConfigureAwait(true);
|
||||
Notice(result);
|
||||
Notice(result, turningOff: true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -940,14 +940,17 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
OnPropertyChanged(nameof(NoticeVisible));
|
||||
}
|
||||
|
||||
/// <summary>A refusal, a mismatch or a failure is a persistent notice on the page; a success clears it.</summary>
|
||||
private void Notice(HookingConsentResult result)
|
||||
/// <summary>
|
||||
/// A refusal, a mismatch or a failure is a persistent notice on the page; a success clears it. With no Agent, turning
|
||||
/// hooking off changed nothing — not "Nothing was enabled.", the enable path's words, which it said until beta.18.
|
||||
/// </summary>
|
||||
private void Notice(HookingConsentResult result, bool turningOff = false)
|
||||
{
|
||||
(NoticeText, NoticeSeverity) = result.Outcome switch
|
||||
{
|
||||
HookingConsentOutcome.Refused => (result.RefusalText(), InfoBarSeverity.Error),
|
||||
HookingConsentOutcome.VersionMismatch => (Shared.Strings.Safety_Consent_VersionMismatch, InfoBarSeverity.Warning),
|
||||
HookingConsentOutcome.AgentUnavailable => (Shared.Strings.Safety_Consent_AgentUnavailable, InfoBarSeverity.Warning),
|
||||
HookingConsentOutcome.AgentUnavailable => (turningOff ? Strings.Agent_NotConnected_NothingChanged : Shared.Strings.Safety_Consent_AgentUnavailable, InfoBarSeverity.Warning),
|
||||
// The Agent could not read the executable (beta.8): say whether its drive or the file is missing, not the IPC code.
|
||||
HookingConsentOutcome.Failed when string.Equals(result.Detail, Shared.Ipc.IpcErrorCode.ExecutableUnreadable, StringComparison.Ordinal) && Game is not null
|
||||
=> (Formats.ExecutableMissingText(Game.Fingerprint.ExePath), InfoBarSeverity.Warning),
|
||||
|
||||
@@ -712,7 +712,8 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
return;
|
||||
}
|
||||
|
||||
string body = result.Outcome == HookingConsentOutcome.AgentUnavailable ? Shared.Strings.Safety_Consent_AgentUnavailable : result.Detail ?? Strings.Common_NotAvailable;
|
||||
// Turning off with no Agent changed nothing (beta.18): it said the enable path's "Nothing was enabled."
|
||||
string body = result.Outcome == HookingConsentOutcome.AgentUnavailable ? Strings.Agent_NotConnected_NothingChanged : result.Detail ?? Strings.Common_NotAvailable;
|
||||
_strip.Warn(game.Name, body);
|
||||
}
|
||||
|
||||
@@ -765,7 +766,9 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
await _settings.SetAsync(definition, value).ConfigureAwait(true);
|
||||
if (definition.AgentReads)
|
||||
{
|
||||
_strip.Info(Strings.Settings_Header, Strings.Settings_Applied);
|
||||
// Disable all hooking does not wait for a session to start (beta.18): a measured one stops at its next safety scan.
|
||||
bool killSwitchOn = ReferenceEquals(definition, SettingsRegistry.HookingKillSwitch) && string.Equals(value, "1", StringComparison.Ordinal);
|
||||
_strip.Info(Strings.Settings_Header, killSwitchOn ? Strings.Settings_KillSwitch_Applied_On : Strings.Settings_Applied);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,8 +161,12 @@ public static class RecordedSessionEvents
|
||||
private static string? NullIfEmpty(string? value) => string.IsNullOrEmpty(value) ? null : value;
|
||||
|
||||
/// <summary>
|
||||
/// The guard's own reason when it named a family (beta.13, §S23-3): the App says a <c>BlockedService</c> or
|
||||
/// <c>BlockedDriver</c> was found on the PC, not in the game. Null when the guard named nothing.
|
||||
/// The guard's own reason whenever it refused: the App says a <c>BlockedService</c> or <c>BlockedDriver</c> was found on
|
||||
/// the PC, not in the game (beta.13, §S23-3), and a refusal no family names in the guard's words — "the game is 32-bit…",
|
||||
/// "the game's loaded modules could not be listed" — rather than by the session's end reason, which printed as
|
||||
/// <c>reason RefusedByGuard</c> (beta.18). Until beta.18 it was sent only beside a family. Null for an allow, and for a
|
||||
/// verdict nobody produced.
|
||||
/// </summary>
|
||||
private static string? GuardReasonOf(AntiCheatVerdict verdict) => string.IsNullOrEmpty(verdict.Family) ? null : verdict.Reason.ToString();
|
||||
private static string? GuardReasonOf(AntiCheatVerdict verdict) =>
|
||||
verdict.Reason is AntiCheatRefusalReason.Allow or AntiCheatRefusalReason.AllowedUnderUserModeException ? null : verdict.Reason.ToString();
|
||||
}
|
||||
+3
@@ -76,6 +76,7 @@ public static class Strings
|
||||
nameof(Safety_Refused_Unnamed),
|
||||
nameof(Safety_Unhooked_Format),
|
||||
nameof(Safety_Unhooked_MachineWide_Format),
|
||||
nameof(Safety_Unhooked_Unnamed_Format),
|
||||
];
|
||||
|
||||
public static string Safety_AdminMode_Accept => ResourceManager.GetString(nameof(Safety_AdminMode_Accept), Culture) ?? nameof(Safety_AdminMode_Accept);
|
||||
@@ -171,4 +172,6 @@ public static class Strings
|
||||
public static string Safety_Unhooked_Format => ResourceManager.GetString(nameof(Safety_Unhooked_Format), Culture) ?? nameof(Safety_Unhooked_Format);
|
||||
|
||||
public static string Safety_Unhooked_MachineWide_Format => ResourceManager.GetString(nameof(Safety_Unhooked_MachineWide_Format), Culture) ?? nameof(Safety_Unhooked_MachineWide_Format);
|
||||
|
||||
public static string Safety_Unhooked_Unnamed_Format => ResourceManager.GetString(nameof(Safety_Unhooked_Unnamed_Format), Culture) ?? nameof(Safety_Unhooked_Unnamed_Format);
|
||||
}
|
||||
@@ -33,6 +33,7 @@
|
||||
<data name="Safety_HookingTurnedOff" xml:space="preserve"><value>Hooking has been turned off for this game; its page says what was found.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Capture stopped: {0} was detected while the game was running, and FrameLedger unhooked.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Unhooked_MachineWide_Format" xml:space="preserve"><value>Capture stopped: {0} started on this PC while the game was running ({1}) — a driver or service, which may belong to another game or program — and FrameLedger unhooked. The game's next session is measured again once it is no longer running.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Unhooked_Unnamed_Format" xml:space="preserve"><value>Capture stopped while the game was running — {0} — and FrameLedger unhooked.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Refused_TargetUnreadable" xml:space="preserve"><value>The game is running, but Windows would not let FrameLedger open its process: it is protected by an anti-cheat driver, or it runs as administrator while FrameLedger does not. Nothing was injected and this run was not measured. FrameLedger will not work around another product's protection. If the game itself runs as administrator, the agent's admin mode in Settings lets FrameLedger open it; a protected process stays closed.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Title_Format" xml:space="preserve"><value>Make a user-mode exception for {0}?</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Intro_Format" xml:space="preserve"><value>FrameLedger found {0} in this game ({1}) and turned its hooking off. This dialog asks whether to make an exception for this game only. It recommends neither choice.</value><comment>safety: human review required</comment></data>
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<data name="Safety_HookingTurnedOff" xml:space="preserve"><value>Hooking has been turned off for this game; its page says what was found.</value></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Capture stopped: {0} was detected while the game was running, and FrameLedger unhooked.</value></data>
|
||||
<data name="Safety_Unhooked_MachineWide_Format" xml:space="preserve"><value>Capture stopped: {0} started on this PC while the game was running ({1}) — a driver or service, which may belong to another game or program — and FrameLedger unhooked. The game's next session is measured again once it is no longer running.</value></data>
|
||||
<data name="Safety_Unhooked_Unnamed_Format" xml:space="preserve"><value>Capture stopped while the game was running — {0} — and FrameLedger unhooked.</value></data>
|
||||
<data name="Safety_Refused_TargetUnreadable" xml:space="preserve"><value>The game is running, but Windows would not let FrameLedger open its process: it is protected by an anti-cheat driver, or it runs as administrator while FrameLedger does not. Nothing was injected and this run was not measured. FrameLedger will not work around another product's protection. If the game itself runs as administrator, the agent's admin mode in Settings lets FrameLedger open it; a protected process stays closed.</value></data>
|
||||
<data name="Safety_Exception_Title_Format" xml:space="preserve"><value>Make a user-mode exception for {0}?</value></data>
|
||||
<data name="Safety_Exception_Intro_Format" xml:space="preserve"><value>FrameLedger found {0} in this game ({1}) and turned its hooking off. This dialog asks whether to make an exception for this game only. It recommends neither choice.</value></data>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<data name="Safety_HookingTurnedOff" xml:space="preserve"><value>Hooking đã được tắt cho game này; trang của game ghi rõ đã phát hiện gì.</value></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Đã dừng thu thập: phát hiện {0} khi game đang chạy, và FrameLedger đã gỡ hook.</value></data>
|
||||
<data name="Safety_Unhooked_MachineWide_Format" xml:space="preserve"><value>Đã dừng thu thập: {0} khởi động trên máy này khi game đang chạy ({1}) — một driver hoặc service, có thể thuộc về game hay chương trình khác — và FrameLedger đã gỡ hook. Phiên sau của game sẽ được đo lại khi nó không còn chạy.</value></data>
|
||||
<data name="Safety_Unhooked_Unnamed_Format" xml:space="preserve"><value>Đã dừng thu thập khi game đang chạy — {0} — và FrameLedger đã gỡ hook.</value></data>
|
||||
<data name="Safety_Refused_TargetUnreadable" xml:space="preserve"><value>Game đang chạy, nhưng Windows không cho FrameLedger mở tiến trình của nó: tiến trình được driver anti-cheat bảo vệ, hoặc game chạy với quyền quản trị còn FrameLedger thì không. Không có gì được inject và lần chạy này không được đo. FrameLedger sẽ không tìm cách vượt qua cơ chế bảo vệ của sản phẩm khác. Nếu chính game chạy với quyền quản trị, chế độ quản trị của agent trong Cài đặt cho phép FrameLedger mở nó; tiến trình được bảo vệ vẫn đóng.</value></data>
|
||||
<data name="Safety_Exception_Title_Format" xml:space="preserve"><value>Tạo ngoại lệ user-mode cho {0}?</value></data>
|
||||
<data name="Safety_Exception_Intro_Format" xml:space="preserve"><value>FrameLedger đã phát hiện {0} trong game này ({1}) và đã tắt hooking cho nó. Hộp thoại này hỏi bạn có muốn tạo ngoại lệ cho riêng game này không. Nó không khuyến nghị lựa chọn nào.</value></data>
|
||||
|
||||
@@ -0,0 +1,228 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.Application.AntiCheat;
|
||||
using FrameLedger.Application.Capture;
|
||||
using FrameLedger.Application.Ipc;
|
||||
using FrameLedger.Application.Recording;
|
||||
using FrameLedger.Domain.AntiCheat;
|
||||
using FrameLedger.Domain.Consent;
|
||||
using FrameLedger.Domain.Sessions;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// beta.18: a notice is made from what the Agent sends, so these are made from what the Agent sends — the gate's own
|
||||
/// verdicts, the verdicts the native guard's facade builds (<see cref="AntiCheatVerdict.FromNative"/>), published by
|
||||
/// <see cref="RecordedSessionEvents.PublishReason"/> through the wire's codec — never an event written by hand. Hand-written
|
||||
/// events had been the notices' only tests ("GuardBlocked", "HookFaulted", a guard reason sent as the end) while the Agent's
|
||||
/// own read "The hook stopped (WriterSelfDisabled)…", "kill switch was detected in this game (… (FR-2.4) …)" and "Access is
|
||||
/// denied was detected while the game was running".
|
||||
/// </summary>
|
||||
[Collection(StringsCultureCollection.Name)]
|
||||
public sealed class NoticesFromTheAgentTests
|
||||
{
|
||||
private static readonly ExecutableFingerprint _onDisk = new() { ExePath = @"C:\Games\Title\game.exe", SizeBytes = 90_000, MtimeUnixMs = 1_700_000_000_000 };
|
||||
|
||||
/// <summary>The gate's refusal of a game blocked before, labelled as <c>HookedCaptureGate</c> labels it.</summary>
|
||||
private static readonly AntiCheatVerdict _blockedBefore =
|
||||
AntiCheatVerdict.Refused(AntiCheatRefusalReason.PreviouslyBlocked, "previously blocked", "AntiCheatFile|NetEase Yidun|NEP2.dll");
|
||||
|
||||
/// <summary>What a user must never read in a notice: the enums' names, a requirement's id, the fallback's "reason X".</summary>
|
||||
private static readonly Regex[] _internal =
|
||||
[
|
||||
.. Enum.GetNames<SessionEndReason>().Concat(Enum.GetNames<AntiCheatRefusalReason>()).Select(static n => Pattern(@"\b" + n + @"\b")),
|
||||
Pattern(@"FR-\d"),
|
||||
Pattern(@"\breason [A-Z]"),
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// "kill switch was detected in this game (the global 'disable all hooking' switch is on (FR-2.4); …)" until beta.18. The
|
||||
/// switch is checked before anything else, so the gate refuses even a record nobody stored, and its guard is never asked.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task DisableAllHookingIsTheUsersSwitchNeverAFinding()
|
||||
{
|
||||
AntiCheatVerdict gate = await new HookedCaptureGate(new UnaskedGuard())
|
||||
.StartAsync(HookRequest.FromConsent(default, _onDisk, targetPid: 4242, @"C:\FrameLedger\FrameLedger.Overlay.dll", killSwitchEngaged: true),
|
||||
TestContext.Current.CancellationToken);
|
||||
|
||||
SafetyNotice notice = InEnglish(() => Notice(new CaptureOutcome { Reason = SessionEndReason.RefusedKillSwitch, Verdict = gate }));
|
||||
|
||||
gate.Family.Should().Be("kill switch", "the gate labels its own refusal in the family's place — which is what the notice printed");
|
||||
notice.Body.Should().Be("All hooking is switched off in Settings, so nothing was measured. " + Strings.Notice_Refused_Recording);
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A game with its user-mode exception granted and the option since turned off (D33): hooking is on, the row is blocked,
|
||||
/// no family is tolerated. The verdict is the gate's as <c>HookedCaptureGate</c> labels it — a stored record is not a
|
||||
/// test's to make (Domain's InternalsVisibleTo).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AGameBlockedBeforeIsSaidAsThatNeverAsAFindingNamedPreviouslyBlocked()
|
||||
{
|
||||
SafetyNotice notice = InEnglish(() => Notice(new CaptureOutcome { Reason = SessionEndReason.RefusedPreviouslyBlocked, Verdict = _blockedBefore }));
|
||||
|
||||
notice.Body.Should().StartWith("Anti-cheat was found in this game before, so it is never hooked.").And.NotContain("previously blocked was detected");
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AGuardRefusalThatNamesNoFamilyIsSaidInTheGuardsWords()
|
||||
{
|
||||
AntiCheatVerdict wow64 = AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.TargetIsWow64, string.Empty, "target is a WOW64 process");
|
||||
|
||||
SafetyNotice notice = InEnglish(() => Notice(new CaptureOutcome { Reason = SessionEndReason.RefusedByGuard, Verdict = wow64 }));
|
||||
|
||||
notice.Body.Should().StartWith("The anti-cheat guard did not hook this game: the game is 32-bit, and the hook runs in 64-bit games only.");
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>An agent from before beta.18 sent no guard reason beside no family: the end's own words, not its name.</summary>
|
||||
[Fact]
|
||||
public void AnOlderAgentsFamilylessRefusalIsStillWords()
|
||||
{
|
||||
SafetyNotice notice = InEnglish(() => new SafetyNotices(new FakeAgentLink(), new RecordingStrip()).Translate(
|
||||
FakeAgentLink.Envelope(IpcMessageType.CaptureRefused, new CaptureRefusedEvent(7, "Title", "RefusedByGuard", null, "target is a WOW64 process")))!);
|
||||
|
||||
notice.Body.Should().StartWith("The anti-cheat guard refused to hook this game.");
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>The control: a finding is still said as one, by its family and signal.</summary>
|
||||
[Fact]
|
||||
public void AFindingIsStillNamed()
|
||||
{
|
||||
AntiCheatVerdict found = AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.BlockedModule, "BattlEye", "BEClient_x64.dll");
|
||||
|
||||
SafetyNotice notice = InEnglish(() => Notice(new CaptureOutcome { Reason = SessionEndReason.RefusedByGuard, Verdict = found, HookingTurnedOff = true }));
|
||||
|
||||
notice.Body.Should().StartWith("BattlEye was detected in this game (BEClient_x64.dll).");
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>The 30 s re-scan could not read the game's process while it still ran (an exit is relabelled, D48(b)).</summary>
|
||||
[Fact]
|
||||
public void AReScanThatCouldNotLookIsNotAFinding()
|
||||
{
|
||||
AntiCheatVerdict unreadable = AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.ProcessUnreadable, string.Empty, "Access is denied.");
|
||||
|
||||
SafetyNotice notice = InEnglish(() => Notice(new CaptureOutcome { Reason = ExitScanRelabel.EndOf(unreadable, targetExited: false), Verdict = unreadable }));
|
||||
|
||||
notice.Kind.Should().Be(SafetyNoticeKind.Unhooked);
|
||||
notice.Body.Should().Be("Capture stopped while the game was running — the game's process could not be opened — and FrameLedger unhooked.");
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Every end that stops measuring mid-session is said in its own sentence, and never as continuing.</summary>
|
||||
[Fact]
|
||||
public void EveryStopMidSessionIsItsOwnSentence()
|
||||
{
|
||||
List<SessionEndReason> stops = [.. Enum.GetValues<SessionEndReason>().Where(static r => RecordedSessionEvents.Classify(r) == RecordedSessionEvents.Kind.Degraded)];
|
||||
|
||||
List<string> wrong = InEnglish(() => stops
|
||||
.Select(r => (Reason: r, Notice: Notice(new CaptureOutcome { Reason = r, Verdict = AntiCheatVerdict.Allowed() })))
|
||||
.Where(static x => !string.Equals(x.Notice.Body, Formats.EndReasonText(x.Reason.ToString()), StringComparison.Ordinal) || Leaks(x.Notice).Count > 0
|
||||
|| x.Notice.Body.Contains("continues", StringComparison.Ordinal))
|
||||
.Select(static x => $"{x.Reason}: \"{x.Notice.Body}\"")
|
||||
.ToList());
|
||||
|
||||
stops.Should().Contain([SessionEndReason.WriterSelfDisabled, SessionEndReason.KillSwitchEngaged]);
|
||||
string.Join(Environment.NewLine, wrong).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Every refusal the Agent publishes, each with the verdict it comes with, reads without an internal name.</summary>
|
||||
[Fact]
|
||||
public async Task EveryRefusalReadsAsWords()
|
||||
{
|
||||
AntiCheatVerdict killSwitch = await new HookedCaptureGate(new UnaskedGuard())
|
||||
.StartAsync(HookRequest.FromConsent(default, _onDisk, targetPid: 4242, @"C:\FrameLedger\FrameLedger.Overlay.dll", killSwitchEngaged: true),
|
||||
TestContext.Current.CancellationToken);
|
||||
List<SessionEndReason> refusals = [.. Enum.GetValues<SessionEndReason>().Where(static r => RecordedSessionEvents.Classify(r) == RecordedSessionEvents.Kind.Refused)];
|
||||
|
||||
List<string> wrong = InEnglish(() => refusals
|
||||
.Select(r => (Reason: r, Notice: Notice(new CaptureOutcome
|
||||
{
|
||||
Reason = r,
|
||||
Verdict = r switch
|
||||
{
|
||||
SessionEndReason.RefusedKillSwitch => killSwitch,
|
||||
SessionEndReason.RefusedPreviouslyBlocked => _blockedBefore,
|
||||
SessionEndReason.RefusedByGuard => AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.ModuleScanFailed, string.Empty, "Only part of a ReadProcessMemory request was completed."),
|
||||
_ => default,
|
||||
},
|
||||
})))
|
||||
.Where(static x => Leaks(x.Notice).Count > 0)
|
||||
.Select(static x => $"{x.Reason}: \"{x.Notice.Body}\" ({string.Join(", ", Leaks(x.Notice))})")
|
||||
.ToList());
|
||||
|
||||
refusals.Should().HaveCountGreaterThanOrEqualTo(5);
|
||||
string.Join(Environment.NewLine, wrong).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>The one safety event <paramref name="outcome"/> publishes, over the wire's codec, as the App's notice.</summary>
|
||||
private static SafetyNotice Notice(CaptureOutcome outcome)
|
||||
{
|
||||
var pipe = new Pipe();
|
||||
RecordedSessionEvents.PublishReason(pipe, Guid.NewGuid(), outcome,
|
||||
new SessionStartedInfo(Guid.NewGuid(), 7, "Title", _onDisk.ExePath, CaptureMode.Attach, DateTimeOffset.UnixEpoch, 10_000_000));
|
||||
IpcEnvelope sent = pipe.Sent.Should().ContainSingle($"{outcome.Reason} publishes one event").Subject;
|
||||
using var notices = new SafetyNotices(new FakeAgentLink(), new RecordingStrip());
|
||||
return notices.Translate(sent) ?? throw new InvalidOperationException($"{sent.Type} made no notice");
|
||||
}
|
||||
|
||||
private static List<string> Leaks(SafetyNotice notice) => [.. _internal.Select(r => r.Match(notice.Body)).Where(static m => m.Success).Select(static m => m.Value)];
|
||||
|
||||
private static Regex Pattern(string pattern) => new(pattern, RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture, TimeSpan.FromSeconds(1));
|
||||
|
||||
private static T InEnglish<T>(Func<T> f)
|
||||
{
|
||||
CultureInfo? app = Strings.Culture;
|
||||
CultureInfo? shared = Shared.Strings.Culture;
|
||||
CultureInfo current = CultureInfo.CurrentCulture;
|
||||
try
|
||||
{
|
||||
Strings.Culture = CultureInfo.GetCultureInfo("en");
|
||||
Shared.Strings.Culture = CultureInfo.GetCultureInfo("en");
|
||||
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en");
|
||||
return f();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Strings.Culture = app;
|
||||
Shared.Strings.Culture = shared;
|
||||
CultureInfo.CurrentCulture = current;
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class Pipe : IIpcEventPublisher
|
||||
{
|
||||
public List<IpcEnvelope> Sent { get; } = [];
|
||||
|
||||
public bool HasClients => true;
|
||||
|
||||
public void Publish<T>(string type, T payload)
|
||||
where T : class => Sent.Add(IpcCodec.Decode(IpcCodec.Encode(type, null, payload)));
|
||||
}
|
||||
|
||||
/// <summary>A guard that must not be reached: every refusal these tests take from the gate is the gate's own.</summary>
|
||||
private sealed class UnaskedGuard : IAntiCheatGuard
|
||||
{
|
||||
public ValueTask<AntiCheatVerdict> EvaluateAsync(int targetPid, string? toleratedFamily, CancellationToken ct = default) => throw Asked();
|
||||
|
||||
public ValueTask<AntiCheatVerdict> GuardedInjectAsync(int targetPid, string payloadPath, string? toleratedFamily, CancellationToken ct = default) => throw Asked();
|
||||
|
||||
public ValueTask<AntiCheatVerdict> GuardedInjectWhenReadyAsync(int targetPid, string payloadPath, int timeoutMs, string? toleratedFamily,
|
||||
CancellationToken ct = default) => throw Asked();
|
||||
|
||||
public ValueTask<AntiCheatVerdict> PreScanGameAsync(string executablePath, string? toleratedFamily, CancellationToken ct = default) => throw Asked();
|
||||
|
||||
private static InvalidOperationException Asked() => new("the gate asked the guard");
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public sealed class ReasonTextTests
|
||||
|
||||
var link = new FakeAgentLink();
|
||||
using var notices = new SafetyNotices(link, new RecordingStrip());
|
||||
link.Raise(IpcMessageType.CaptureRefused, new CaptureRefusedEvent(7, "Title", "PreScanFailed", null, "the folder could not be listed"));
|
||||
link.Raise(IpcMessageType.CaptureRefused, new CaptureRefusedEvent(7, "Title", "RefusedByGuard", null, "the folder could not be listed", GuardReason: "PreScanFailed"));
|
||||
notices.Items.Should().ContainSingle().Which.Body.Should().StartWith("The anti-cheat guard did not hook this game: the game's folder could not be scanned.")
|
||||
.And.NotContain("detected");
|
||||
new HookingConsentResult(HookingConsentOutcome.Refused, Refusal: new RefusedAck(7, "ProcessUnreadable", null, "Access is denied")).RefusalText()
|
||||
|
||||
@@ -300,8 +300,12 @@ public sealed class SettingsViewModelTests
|
||||
h.Vm.ExceptionsSuspended.Should().BeTrue();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The strip says when it applies (beta.18): turned on, a measured session stops at its next safety scan — not "at the next
|
||||
/// session start", which it said until then — and turned off, per-game settings decide from the next session start.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheKillSwitchIsOneSettingsRowAndTheAgentIsToldWhenItReadsIt()
|
||||
public async Task TheKillSwitchIsOneSettingsRowAndTheStripSaysWhenItApplies()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
Harness h = await OpenAsync(s);
|
||||
@@ -312,7 +316,14 @@ public sealed class SettingsViewModelTests
|
||||
|
||||
(await h.Settings.GetBooleanAsync(SettingsRegistry.HookingKillSwitch, Ct)).Should().BeTrue();
|
||||
h.Vm.KillSwitchState.Should().Be(Strings.Settings_KillSwitch_On);
|
||||
h.Strip.Shown.Should().ContainSingle().Which.Body.Should().Be(Strings.Settings_Applied, "hooking.kill_switch is an Agent-read key (D16)");
|
||||
h.Strip.Shown.Should().ContainSingle().Which.Body.Should().Be(Strings.Settings_KillSwitch_Applied_On, "a measured session stops at its next safety scan");
|
||||
new Application.Capture.CaptureOptions().ScanInterval.Should().Be(TimeSpan.FromSeconds(30), "the strip says within 30 seconds");
|
||||
|
||||
h.Vm.KillSwitch = false;
|
||||
Task off = h.Vm.Pending;
|
||||
await off;
|
||||
|
||||
h.Strip.Shown.Should().HaveCount(2).And.Subject.Last().Body.Should().Be(Strings.Settings_Applied, "hooking.kill_switch is an Agent-read key (D16)");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -458,7 +469,7 @@ public sealed class SettingsViewModelTests
|
||||
await h.Vm.HookedGames[0].RevokeCommand.ExecuteAsync(null);
|
||||
|
||||
h.Vm.HookedGames.Should().ContainSingle();
|
||||
h.Strip.Shown.Should().ContainSingle().Which.Body.Should().Be(Shared.Strings.Safety_Consent_AgentUnavailable);
|
||||
h.Strip.Shown.Should().ContainSingle().Which.Body.Should().Be(Strings.Agent_NotConnected_NothingChanged, "turning off changed nothing; \"Nothing was enabled.\" was the enable path's words");
|
||||
h.Vm.ElevationText.Should().Be(Strings.Settings_VkLayer_Unknown, "no HelloAck, no claim");
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Xml.Linq;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.App.Update;
|
||||
using FrameLedger.Application.Settings;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
using FrameLedger.Shared.Safety;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -111,6 +112,7 @@ public sealed class ViewerModeTests
|
||||
[InlineData("Pages/SettingsPage.xaml", "IsChecked", "RunElevated, Mode=TwoWay")]
|
||||
[InlineData("Pages/SettingsPage.xaml", "IsChecked", "StartWithWindows, Mode=TwoWay")]
|
||||
[InlineData("Pages/SettingsPage.xaml", "IsChecked", "AutoCheckUpdates, Mode=TwoWay")]
|
||||
[InlineData("Pages/SettingsPage.xaml", "SelectedValue", "UpdateChannel, Mode=TwoWay")]
|
||||
[InlineData("Pages/SettingsPage.xaml", "ItemsSource", "ExceptionGames")]
|
||||
public void EveryControlThatAsksTheAgentOrChangesThisPcIsOffInAViewer(string file, string attribute, string binding)
|
||||
{
|
||||
@@ -122,4 +124,32 @@ public sealed class ViewerModeTests
|
||||
|
||||
((string?)control.Attribute("IsEnabled")).Should().Be("{Binding ViewModel.ActsOnThisPc}", $"{file}: {binding}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.18: every setting the Agent reads is off in a viewer, which has no Agent — the exception option and the three
|
||||
/// Recording numbers stayed live, and a change said "Applied. The capture agent reads it at the next session start." The
|
||||
/// registry says which settings the Agent reads, so a new one without its control here turns this red.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EverySettingTheAgentReadsIsOffInAViewer()
|
||||
{
|
||||
Dictionary<string, (string Attribute, string Binding)> controls = new(StringComparer.Ordinal)
|
||||
{
|
||||
[SettingsRegistry.HookingKillSwitch.Key] = ("IsChecked", "KillSwitch, Mode=TwoWay"),
|
||||
[SettingsRegistry.HookingUserModeExceptions.Key] = ("IsChecked", "UserModeExceptions, Mode=TwoWay"),
|
||||
[SettingsRegistry.CaptureRunElevated.Key] = ("IsChecked", "RunElevated, Mode=TwoWay"),
|
||||
[SettingsRegistry.CaptureMinSessionSeconds.Key] = ("Value", "MinSessionSeconds, Mode=TwoWay"),
|
||||
[SettingsRegistry.TelemetryIntervalMs.Key] = ("Value", "TelemetryIntervalMs, Mode=TwoWay"),
|
||||
[SettingsRegistry.RetentionRawSessionsPerGame.Key] = ("Value", "RetentionRawSessions, Mode=TwoWay"),
|
||||
};
|
||||
XDocument xaml = AccessibilityTests.AppXaml().Single(static x => string.Equals(x.File, Path.Combine("Pages", "SettingsPage.xaml"), StringComparison.Ordinal)).Xaml;
|
||||
|
||||
List<string> live = [.. controls
|
||||
.Select(c => (Key: c.Key, Control: xaml.Descendants().Single(e => string.Equals((string?)e.Attribute(c.Value.Attribute), "{Binding ViewModel." + c.Value.Binding + "}", StringComparison.Ordinal))))
|
||||
.Where(static c => !string.Equals((string?)c.Control.Attribute("IsEnabled"), "{Binding ViewModel.ActsOnThisPc}", StringComparison.Ordinal))
|
||||
.Select(static c => c.Key)];
|
||||
|
||||
SettingsRegistry.All.Where(static d => d.AgentReads).Select(static d => d.Key).Should().BeEquivalentTo(controls.Keys, "every setting the Agent reads has its control named here");
|
||||
string.Join(", ", live).Should().BeEmpty("a viewer has no Agent to read them");
|
||||
}
|
||||
}
|
||||
@@ -162,26 +162,33 @@ public sealed class RecordedSessionEventsTests
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// §S23-3 (beta.13): the events carry the guard's own reason when it named a family, so the App can say a service or a
|
||||
/// driver was found on the PC — and nothing when the guard named nothing (the kill switch, a block already on the row).
|
||||
/// The events carry the guard's own reason whenever it refused: beside a family since §S23-3 (beta.13), so the App can say
|
||||
/// a service or a driver was found on the PC, and beside none since beta.18, so a refusal no family names is said in the
|
||||
/// guard's words — not as the end's name, "reason RefusedByGuard", nor its signal as a finding. Nothing when no verdict
|
||||
/// refused (a process that could not be opened is the loop's, not the guard's).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BothSafetyEventsCarryTheGuardsReasonWhenItNamedAFamily()
|
||||
public void BothSafetyEventsCarryTheGuardsReasonWheneverItRefused()
|
||||
{
|
||||
var pipe = new RecordingPublisher();
|
||||
RecordedSession service = Session(SessionEndReason.RefusedByGuard, ExitStatus.Normal, new FinalizeOutcome(FinalizeStatus.Discarded, null, 0),
|
||||
verdict: AntiCheatVerdict.Refused(AntiCheatRefusalReason.BlockedService, "Easy Anti-Cheat", "EasyAntiCheat_EOS"), tier: CaptureTier.NotHooked);
|
||||
RecordedSession wow64 = Session(SessionEndReason.RefusedByGuard, ExitStatus.Normal, new FinalizeOutcome(FinalizeStatus.Discarded, null, 0),
|
||||
verdict: AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.TargetIsWow64, string.Empty, "target is a WOW64 process"), tier: CaptureTier.NotHooked);
|
||||
RecordedSession unreadable = Session(SessionEndReason.TargetUnreadable, ExitStatus.Normal, new FinalizeOutcome(FinalizeStatus.Discarded, null, 0),
|
||||
tier: CaptureTier.NotHooked);
|
||||
RecordedSession driver = Session(SessionEndReason.SafetyUnhook, ExitStatus.UnhookedSafety, new FinalizeOutcome(FinalizeStatus.Saved, 9, 0),
|
||||
verdict: AntiCheatVerdict.Refused(AntiCheatRefusalReason.BlockedDriver, "Riot Vanguard", "vgk.sys"));
|
||||
RecordedSession killSwitch = Session(SessionEndReason.RefusedKillSwitch, ExitStatus.Normal, new FinalizeOutcome(FinalizeStatus.Discarded, null, 0),
|
||||
tier: CaptureTier.NotHooked);
|
||||
RecordedSession rescan = Session(SessionEndReason.SafetyUnhook, ExitStatus.UnhookedSafety, new FinalizeOutcome(FinalizeStatus.Saved, 10, 0),
|
||||
verdict: AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.ProcessUnreadable, string.Empty, "Access is denied."));
|
||||
|
||||
RecordedSessionEvents.PublishAll(pipe, service, _info);
|
||||
RecordedSessionEvents.PublishAll(pipe, driver, _info);
|
||||
RecordedSessionEvents.PublishAll(pipe, killSwitch, _info);
|
||||
foreach (RecordedSession session in new[] { service, wow64, unreadable, driver, rescan })
|
||||
{
|
||||
RecordedSessionEvents.PublishAll(pipe, session, _info);
|
||||
}
|
||||
|
||||
pipe.Of<CaptureRefusedEvent>().Select(static e => e.GuardReason).Should().Equal("BlockedService", null);
|
||||
pipe.Of<SafetyUnhookEvent>().Single().GuardReason.Should().Be("BlockedDriver");
|
||||
pipe.Of<CaptureRefusedEvent>().Select(static e => e.GuardReason).Should().Equal("BlockedService", "TargetIsWow64", null);
|
||||
pipe.Of<SafetyUnhookEvent>().Select(static e => e.GuardReason).Should().Equal("BlockedDriver", "ProcessUnreadable");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in new issue
Block a user