Compare commits

...
Author SHA1 Message Date
poli0981andClaude Opus 5.5 32fb222131 feat(rules): the anti-cheat blocklist names twenty-two families through more signals; the guard holds 256 entries
The owner asked for the anti-cheat set to be as large and as strict as possible (beta.8, PR-1).

- rules 2026.09.3: 11 families / 19 entries / 30 values become 22 / 74 / 142. New: EA AntiCheat, Activision
  Ricochet (19_SAFETY's "no data yet" row), NetEase Anti-Cheat, NetEase Yidun, Nexon Game Security, TenProtect,
  AhnLab HackShield, EQU8, Anybrain, FredaikisAntiCheat, Roblox Hyperion; existing families gain drivers, services,
  folders and files (BEDaisy.sys, FACEIT.sys, ESEADriver, HoYoKProtect.sys, xhunter1, denuvo-anti-cheat.sys...).
  Every new token is documented, not measured, and its note says so. Services that run outside play are left out
  (EAAntiCheatService, PnkBstrA, Denuvo's updater). New modules rows are appended (early_stop_family is an index).
- kMaxFamilies 64 -> 256 (2 x 74 worst case); schema maxItems follows. Rules is 541,736 bytes, so it is reset in
  place (ResetRules) rather than assigned from a stack temporary: the Vulkan layer parses on a game's own thread.
  Native tests hold Rules on the heap.
- A generated fixture requires every seed value to match its own family in its own group; Ricochet's "no data"
  test asserts its data now; VAC's asserts no family entry fakes it.
- Measured: the Overlay's MatchesFloorModule goes from ~20 ns to ~60 ns per miss over the larger floor.

Docs: 19_SAFETY Blocklist seed (regenerated table, expansion note), 14_TESTING, 20_OPEN_QUESTIONS S5, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 20:24:45 +07:00
13 changed files with 387 additions and 90 deletions

No files matched your search

+24 -1
View File
@@ -27,7 +27,30 @@ under a `## [x.y.z] - date` heading in the same commit that bumps `VERSION`, the
## [Unreleased]
_Nothing yet — entries continue here after `0.1.0-beta.7`._
### Changed
- **The anti-cheat blocklist names twenty-two families, twice as many, most through more than one signal.** New:
EA AntiCheat, Activision Ricochet (`randgrid.sys` and its `atvi-randgrid_*` services — the family 19_SAFETY carried
as "no data yet" since August), NetEase Anti-Cheat, NetEase Yidun, Nexon Game Security (BlackCipher), TenProtect,
AhnLab HackShield, EQU8, Anybrain, FredaikisAntiCheat and Roblox Hyperion. Existing families gained the groups they
lacked: BattlEye's driver `BEDaisy.sys` and its services, FACEIT's and ESEA's drivers and services, HoYoverse's
`HoYoKProtect.sys` (which the `mhyprot` prefix never matched), Xigncode3's driver and service, Denuvo Anti-Cheat's
driver, GameGuard's folder, files and service, EAC's `start_protected_game.exe` launcher and setup files. 19 entries
became 74 (rules `2026.09.3`). Every new name is documented — SteamDB's file-detection rules (MIT), the vendors'
support pages, LOLDrivers, DRML — and none is measured on a real title yet; each entry's `note` says which. Three
services are deliberately left out because they run outside play and would refuse every session on the machine:
`EAAntiCheatService`, PunkBuster's `PnkBstrA`, and Denuvo's update service.
- **The guard holds 256 blocklist entries instead of 64** (2 × 74 no longer fitted the worst case of the compiled-in
floor plus a drifted file). The parsed rules are ~530 KB, so they are now reset in place instead of being copied from
a temporary: the Vulkan layer parses them on whichever of a game's threads creates its Vulkan instance, and a
temporary that size on a small thread stack would crash the game. The native tests hold them on the heap.
### Fixed
- **19_SAFETY's fixture rule is enforced for every family, not eleven.** A generated test walks every value of the
shipped seed and requires it to match its own family in its own group — which also catches a later row that an
earlier prefix shadows. The rules file's note that called XIGNCODE3's `x3.xem` "not a loadable module" is corrected:
XIGNCODE3 loads it as its loader, so the modules group names it too.
## [0.1.0-beta.7] - 2026-09-23
+1 -1
View File
@@ -8,7 +8,7 @@ The anti-cheat guard is the one component where a bug can cost someone an accoun
**These are Catch2 tests, not xUnit.** `20_OPEN_QUESTIONS` §S13(a) settled the guard into the C++ `FrameLedger.Injector`, so the fail-closed matrix below lives in the native suite and the guard needs seams — injectable enumerator function pointers — before any of these failures can be forced at all. ~~Landing Catch2 is a prerequisite of the guard, not a later nicety (§S15).~~ **Landed long since** — `ctest` runs 31 native suites on every gate (`fl_guard` alone is ~100 s); the sentence was left in the future tense until 2026-09-21.
- Blocklist matching: exact, case-insensitive, prefix rules; every family in `19_SAFETY` §Blocklist seed has a fixture. Two families (Activision Ricochet, Valve VAC) have **no data yet**, so their fixtures must assert that absence explicitly rather than quietly passing on an empty rule set.
- Blocklist matching: exact, case-insensitive, prefix rules; every family in `19_SAFETY` §Blocklist seed has a fixture. Two families (Activision Ricochet, Valve VAC) have **no data yet**, so their fixtures must assert that absence explicitly rather than quietly passing on an empty rule set. **Since 2026-09-25** the fixture is generated from the shipped seed (`rules_budget_test.cpp`: every entry's every value matches its own family in its own group, which also catches a row an earlier prefix shadows), and Ricochet's fixture asserts its data; VAC's still asserts that no family entry fakes it.
- **A finding turns the game's hooking off (2026-09-22), and the proofs are about WHICH findings.** `AntiCheatVerdictTests` pins `IsFindingAboutTheGame` per reason (in the game: yes; machine-wide driver or service, heuristics, failed scans, the latch: no) and that a finding without a family is not one; `CaptureSessionTests` that a start-time `BlockedModule` writes the block, keeps the consent stamp and says `HookingTurnedOff`, that a `BlockedDriver` refuses the session and leaves the row alone, and that the 30 s re-scan's finding writes the same block; `RecordedSessionEventsTests` and `SafetyNoticesTests` that the flag travels to the notice. The override of 2026-09-21 had its own proofs for one day; they went with it, and `NoSecondMatcherTests` counts the port's four methods again.
- **Fail-closed proofs:** malformed `detection-rules.json`, missing `anticheat` block, unreadable target process, `EnumProcessModulesEx` failure, partial module list → **all must refuse injection**, never allow. Each is a named test.
- **Measured error paths that must be named tests** (`spike-notes.md` §1): `ERROR_PARTIAL_COPY (299)` from a suspended target, `ERROR_ACCESS_DENIED (5)` from a protected one, a driver-list parse whose paths are not native paths, and a service query returning `ACCESS_DENIED` — the last of which **cannot be produced on real services by a standard user**, so it exists only as a fake. Every one means REFUSE.
+99 -24
View File
@@ -465,32 +465,107 @@ earlier version of this table produced an entry that was matched *literally* and
therefore never fired. A silent hole in the blocklist, created by its own
normative documentation. Write tokens here exactly as the data must hold them.
| Family | Group | Match | Tokens |
|---|---|---|---|
| Easy Anti-Cheat | `modules` | prefix | `EasyAntiCheat`, `EasyAntiCheat_EOS` |
| Easy Anti-Cheat | `directories` | name | `EasyAntiCheat` |
| Easy Anti-Cheat | `services` | name | `EasyAntiCheat`, `EasyAntiCheat_EOS`, `EasyAntiCheat_EOSSys` |
| Easy Anti-Cheat | `drivers` | prefix | `EasyAntiCheat` — **machine-wide refusal** (check 2) |
| BattlEye | `modules` | prefix | `BEClient`, `BEService` |
| BattlEye | `directories` | name | `BattlEye` |
| Riot Vanguard | `drivers` | exact | `vgk.sys` — **machine-wide refusal** (check 2) |
| Riot Vanguard | `services` | name | `vgc` |
| Denuvo Anti-Cheat | `modules` | prefix | `denuvo` |
| nProtect GameGuard | `modules` | prefix | `GameGuard`, `npgg`, `GameMon` |
| Xigncode3 | `modules` | prefix | `xhunter` |
| Xigncode3 | `files` | name | `x3.xem` |
| mihoyo protect | `drivers` | prefix | `mhyprot` |
| FACEIT | `modules` | prefix | `faceit` |
| ESEA | `modules` | prefix | `esea` |
| PunkBuster | `modules` | prefix | `PnkBstr`, `pbcl`, `pbsv` |
| Anti-Cheat Expert | `drivers` | exact | `ACE-BASE.sys`, `ACE-ADVT.sys`, `ACE-GAME.sys` — **machine-wide refusal** (check 2) |
| Anti-Cheat Expert | `services` | name | `AntiCheatExpert Protection`, `AntiCheatExpert Service` |
| Anti-Cheat Expert | `files` | name | `PGameProtectDriver_X64.sys` |
| **Activision Ricochet** | — | — | **No data yet** — driver and service names unconfirmed (`20_OPEN_QUESTIONS` §S5) |
| **Valve VAC** | — | — | **No data yet** — needs `blockedStoreIds`, whose half of check 3 **cannot be called** (§S14; the executable half was wired in #52, but a renamed exe defeats it anyway, which is why this row reserves the store-id route). **Measured 2026-08-04: a real VAC title returns `Allow`** (`spike-notes.md` §13) |
| Family | Group | Match | Tokens | Added |
|---|---|---|---|---|
| Easy Anti-Cheat | `modules` | prefix | `EasyAntiCheat`, `EasyAntiCheat_EOS` | seed |
| Easy Anti-Cheat | `drivers` | prefix | `EasyAntiCheat` — **machine-wide refusal** (check 2) | seed |
| Easy Anti-Cheat | `directories` | name | `EasyAntiCheat`, `EasyAntiCheat_EOS` | seed; `EasyAntiCheat_EOS` 2026-09-25 |
| Easy Anti-Cheat | `services` | name | `EasyAntiCheat`, `EasyAntiCheat_EOS`, `EasyAntiCheat_EOSSys` | seed |
| Easy Anti-Cheat | `files` | name | `EasyAntiCheat_EOS_Setup.exe`, `EasyAntiCheat_Setup.exe`, `EasyAntiCheat_x64.dll`, `EasyAntiCheat_x86.dll`, `EasyAntiCheat_EOS.sys`, `start_protected_game.exe`, `eac_server64.dll` | 2026-09-25 |
| BattlEye | `modules` | prefix | `BEClient`, `BEService` | seed |
| BattlEye | `drivers` | exact | `BEDaisy.sys` — **machine-wide refusal** (check 2) | 2026-09-25 |
| BattlEye | `directories` | name | `BattlEye` | seed |
| BattlEye | `services` | name | `BEService`, `BEDaisy` | 2026-09-25 |
| BattlEye | `files` | name | `BEService.exe`, `BEService_x64.exe`, `BEClient.dll`, `BEClient_x64.dll`, `BEDaisy.sys` | 2026-09-25 |
| Denuvo Anti-Cheat | `modules` | prefix | `denuvo` | seed |
| Denuvo Anti-Cheat | `drivers` | exact | `denuvo-anti-cheat.sys` — **machine-wide refusal** (check 2) | 2026-09-25 |
| Denuvo Anti-Cheat | `services` | name | `denuvo-anti-cheat` | 2026-09-25 |
| Denuvo Anti-Cheat | `files` | name | `denuvo-anti-cheat.sys`, `denuvo-anti-cheat-runtime.dll`, `denuvo-anti-cheat-update-service.exe` | 2026-09-25 |
| nProtect GameGuard | `modules` | prefix | `GameGuard`, `npgg`, `GameMon` | seed |
| nProtect GameGuard | `directories` | name | `GameGuard` | 2026-09-25 |
| nProtect GameGuard | `services` | name | `npggsvc` | 2026-09-25 |
| nProtect GameGuard | `files` | name | `GameGuard.des`, `GameMon.des`, `GameMon64.des`, `npggNT.des`, `npggNT64.des`, `npsc.des` | 2026-09-25 |
| Xigncode3 | `modules` | prefix | `xhunter` | seed |
| Xigncode3 | `modules` | exact | `x3.xem` | 2026-09-25 |
| Xigncode3 | `drivers` | prefix | `xhunter` — **machine-wide refusal** (check 2) | 2026-09-25 |
| Xigncode3 | `directories` | name | `XIGNCODE`, `XIGNCODE3` | 2026-09-25 |
| Xigncode3 | `services` | name | `xhunter1` | 2026-09-25 |
| Xigncode3 | `files` | name | `x3.xem`, `xhunter1.sys` | seed; `xhunter1.sys` 2026-09-25 |
| PunkBuster | `modules` | prefix | `PnkBstr`, `pbcl`, `pbsv` | seed |
| PunkBuster | `drivers` | prefix | `PnkBstrK` — **machine-wide refusal** (check 2) | 2026-09-25 |
| PunkBuster | `directories` | name | `PunkBuster` | 2026-09-25 |
| PunkBuster | `files` | name | `pbsvc.exe`, `PnkBstrA.exe`, `PnkBstrB.exe`, `pbsv.dll`, `pbcl.dll`, `pbag.dll` | 2026-09-25 |
| FACEIT | `modules` | prefix | `faceit` | seed |
| FACEIT | `drivers` | exact | `FACEIT.sys` — **machine-wide refusal** (check 2) | 2026-09-25 |
| FACEIT | `services` | name | `FACEIT`, `FACEITService` | 2026-09-25 |
| ESEA | `modules` | prefix | `esea` | seed |
| ESEA | `drivers` | prefix | `ESEADriver` — **machine-wide refusal** (check 2) | 2026-09-25 |
| ESEA | `services` | name | `ESEADriver2` | 2026-09-25 |
| Riot Vanguard | `drivers` | exact | `vgk.sys` — **machine-wide refusal** (check 2) | seed |
| Riot Vanguard | `services` | name | `vgc`, `vgk` | seed; `vgk` 2026-09-25 |
| mihoyo protect | `modules` | prefix | `mhypbase` | 2026-09-25 |
| mihoyo protect | `drivers` | prefix | `mhyprot`, `HoYoKProtect` — **machine-wide refusal** (check 2) | seed; `HoYoKProtect` 2026-09-25 |
| mihoyo protect | `services` | name | `mhyprot2`, `mhyprot3`, `HoYoKProtect` | 2026-09-25 |
| mihoyo protect | `files` | name | `mhypbase.dll`, `mhyprot2.sys`, `mhyprot3.sys`, `HoYoKProtect.sys` | 2026-09-25 |
| Anti-Cheat Expert | `modules` | prefix | `SGuard`, `AntiCheatExpert` | 2026-09-25 |
| Anti-Cheat Expert | `drivers` | exact | `ACE-BASE.sys`, `ACE-ADVT.sys`, `ACE-GAME.sys` — **machine-wide refusal** (check 2) | seed |
| Anti-Cheat Expert | `directories` | name | `AntiCheatExpert`, `AceAntibotClient` | 2026-09-25 |
| Anti-Cheat Expert | `services` | name | `AntiCheatExpert Protection`, `AntiCheatExpert Service` | seed |
| Anti-Cheat Expert | `files` | name | `PGameProtectDriver_X64.sys`, `SGuard64.exe`, `SGuardSvc64.exe` | seed; `SGuard64.exe`, `SGuardSvc64.exe` 2026-09-25 |
| EA AntiCheat | `modules` | prefix | `EAAntiCheat` | 2026-09-25 |
| EA AntiCheat | `drivers` | exact | `EAAntiCheat.sys` — **machine-wide refusal** (check 2) | 2026-09-25 |
| EA AntiCheat | `files` | name | `EAAntiCheat.Installer.exe`, `EAAntiCheat.GameServiceLauncher.exe`, `EAAntiCheat.GameServiceLauncher.dll` | 2026-09-25 |
| NetEase Anti-Cheat | `modules` | prefix | `NeacSafe`, `NeacClient` | 2026-09-25 |
| NetEase Anti-Cheat | `drivers` | prefix | `NeacSafe` — **machine-wide refusal** (check 2) | 2026-09-25 |
| NetEase Anti-Cheat | `files` | name | `NeacSafe64.sys`, `NeacSafe64_ex.sys` | 2026-09-25 |
| NetEase Yidun | `modules` | exact | `NEP2.dll` | 2026-09-25 |
| NetEase Yidun | `files` | name | `NEP2.dll` | 2026-09-25 |
| Nexon Game Security | `modules` | prefix | `BlackCipher`, `BlackCall`, `BlackXchg` | 2026-09-25 |
| Nexon Game Security | `drivers` | exact | `BlackCat64.sys` — **machine-wide refusal** (check 2) | 2026-09-25 |
| Nexon Game Security | `directories` | name | `BlackCipher` | 2026-09-25 |
| Nexon Game Security | `files` | name | `BlackCipher.aes`, `BlackCipher64.aes`, `BlackCall.aes`, `BlackCall64.aes`, `BlackCat64.sys` | 2026-09-25 |
| TenProtect | `modules` | prefix | `TP3Helper`, `TenSafe` | 2026-09-25 |
| TenProtect | `drivers` | exact | `TesSafe.sys` — **machine-wide refusal** (check 2) | 2026-09-25 |
| TenProtect | `files` | name | `TP3Helper.exe` | 2026-09-25 |
| AhnLab HackShield | `modules` | prefix | `EhSvc`, `HShield`, `HSInst` | 2026-09-25 |
| AhnLab HackShield | `directories` | name | `HShield` | 2026-09-25 |
| AhnLab HackShield | `files` | name | `HSInst.dll`, `EhSvc.dll` | 2026-09-25 |
| Anybrain | `modules` | exact | `anybrainSDK.dll`, `Cerebro.dll` | 2026-09-25 |
| Anybrain | `files` | name | `anybrainSDK.dll`, `Cerebro.dll` | 2026-09-25 |
| Roblox Hyperion | `modules` | exact | `RobloxPlayerBeta.dll` | 2026-09-25 |
| Roblox Hyperion | `files` | name | `RobloxPlayerBeta.dll` | 2026-09-25 |
| EQU8 | `modules` | prefix | `equ8` | 2026-09-25 |
| EQU8 | `drivers` | prefix | `EQU8_HELPER` — **machine-wide refusal** (check 2) | 2026-09-25 |
| EQU8 | `files` | name | `equ8_conf.json` | 2026-09-25 |
| Activision Ricochet | `drivers` | exact | `randgrid.sys`, `brynhildr.sys`, `atvi-brynhildr.sys` — **machine-wide refusal** (check 2) | 2026-09-25 |
| Activision Ricochet | `services` | name | `atvi-randgrid_sr`, `atvi-randgrid_msstore` | 2026-09-25 |
| Activision Ricochet | `files` | name | `randgrid.sys` | 2026-09-25 |
| FredaikisAntiCheat | `directories` | name | `FredaikisAntiCheat` | 2026-09-25 |
| **Valve VAC** | — | — | **No data yet** — needs `blockedStoreIds`, whose half of check 3 **cannot be called** (§S14; the executable half was wired in #52, but a renamed exe defeats it anyway, which is why this row reserves the store-id route). **Measured 2026-08-04: a real VAC title returns `Allow`** (`spike-notes.md` §13) | — |
The "no data yet" rows are deliberately kept rather than deleted. An admitted
gap is reviewable; a deleted row is invisible.
gap is reviewable; a deleted row is invisible. ~~Activision Ricochet's was one of them~~ — it has data since
2026-09-25 (below); VAC's stays until its per-title route exists.
> **Expanded 2026-09-25 (owner: "as many anti-cheats and as strict as possible").** Eleven families became
> twenty-two and 19 entries became 74: EA AntiCheat, Activision Ricochet, NetEase Anti-Cheat, NetEase Yidun, Nexon
> Game Security, TenProtect, AhnLab HackShield, EQU8, Anybrain, FredaikisAntiCheat and Roblox Hyperion are new, and
> most existing families gained the groups they lacked — BattlEye's `BEDaisy.sys`, FACEIT's and ESEA's drivers,
> `HoYoKProtect.sys` (which the `mhyprot` prefix never matched), Xigncode3's driver and service, Denuvo's driver.
> **Every new token is DOCUMENTED, not measured**: the sources are SteamDB's `FileDetectionRuleSets` (MIT), the
> vendors' own support pages (Activision RICOCHET, EA, FACEIT, BattlEye), LOLDrivers and DRML, named per entry in
> the data's `note`. The ACE rule above still holds — a blocklist may over-cover and must never under-cover, and a
> wrong token fails closed by never firing — so an unmeasured token is admitted, labelled, and left for a real title
> to confirm. `kMaxFamilies` went 64 → 256 with it (2 × 74 no longer fitted).
>
> **Three services are deliberately absent**, and the reason is the RUNNING rule above: a service counts while it
> runs, and a service that runs outside play refuses every session on the machine. `EAAntiCheatService` can be set
> to start automatically; PunkBuster's `PnkBstrA` runs at every boot once installed; Denuvo's update service runs
> apart from the game. Each family is caught through its driver, its modules or its files instead.
>
> **New `modules` rows are appended, never inserted.** The Overlay's `LoadLibrary` detour reports a 1-based index
> into this group's order (`FlWriterState.earlyStopFamily` → `sessions.early_stop_family`), so a row inserted above
> an existing one would change what indexes already stored mean.
> **Anti-Cheat Expert was added 2026-08-04 from measurement, not from reading.**
> `ACE-BASE.sys` and `ACE-ADVT.sys` were found installed under `System32\drivers`
+3 -1
View File
@@ -1637,7 +1637,9 @@ a system DLL.
**Two families remain unrepresented in the data** — Activision Ricochet (driver
and service names unconfirmed) and Valve VAC (needs `blockedStoreIds`). Recorded
in the seed's own `$comment`. The `heuristic.trustedSigners` list is a guess and
in the seed's own `$comment`. ~~Ricochet~~ **has data since 2026-09-25** (`randgrid.sys`,
`atvi-randgrid_sr`/`_msstore`, from Activision's support pages — documented, unmeasured; `19_SAFETY`
§Blocklist seed). VAC still has none. The `heuristic.trustedSigners` list is a guess and
is marked UNVERIFIED.
### S13(c) · Is launch-mode injection salvageable?
+114 -14
View File
@@ -15,9 +15,10 @@
"compilability, case-insensitive duplicate values — stay imperative in",
"tools/rules-validate.ps1.",
"",
"STILL INCOMPLETE AS DATA: docs/19_SAFETY §Blocklist seed names two families",
"with no representation here at all — Activision Ricochet (driver/service",
"names not yet confirmed) and Valve VAC (needs blockedStoreIds entries).",
"STILL INCOMPLETE AS DATA: docs/19_SAFETY §Blocklist seed names one family",
"with no representation here at all — Valve VAC (needs blockedStoreIds",
"entries). Activision Ricochet was the other until 2026-09-25, when its",
"driver and services arrived from Activision's own support pages.",
"",
"PRE-INJECTION CHECK 3 MATCHES NOTHING, because `blockedExecutables` and",
"`blockedStoreIds` are both empty. That is a fact about THIS DATA, which is",
@@ -41,7 +42,7 @@
"level, which made it a check that could not fire."
],
"schemaVersion": 2,
"rulesVersion": "2026.09.2",
"rulesVersion": "2026.09.3",
"engines": [
{
@@ -198,30 +199,129 @@
{ "family": "Xigncode3", "match": "prefix", "values": [ "xhunter" ] },
{ "family": "PunkBuster", "match": "prefix", "values": [ "PnkBstr", "pbcl", "pbsv" ] },
{ "family": "FACEIT", "match": "prefix", "values": [ "faceit" ] },
{ "family": "ESEA", "match": "prefix", "values": [ "esea" ] }
{ "family": "ESEA", "match": "prefix", "values": [ "esea" ] },
{ "family": "Anti-Cheat Expert", "match": "prefix", "values": [ "SGuard", "AntiCheatExpert" ],
"note": "APPENDED 2026-09-25, as every row below: the Overlay reports a 1-based index into this array (sessions.early_stop_family), so a row inserted above shifts what stored indexes mean. SGuard64/SGuardSvc64 are ACE's guard processes (documented, file.net; unmeasured)." },
{ "family": "EA AntiCheat", "match": "prefix", "values": [ "EAAntiCheat" ],
"note": "EA Javelin: EAAntiCheat.GameServiceLauncher.dll / EAAntiCheat.GameService.exe (documented, EA forums). Unmeasured." },
{ "family": "NetEase Anti-Cheat", "match": "prefix", "values": [ "NeacSafe", "NeacClient" ],
"note": "NEAC (Naraka, Marvel Rivals, FragPunk). NeacSafe64 is documented (LOLDrivers, SteamDB NetEase_AntiCheatExperts); NeacClient unmeasured." },
{ "family": "NetEase Yidun", "match": "exact", "values": [ "NEP2.dll" ],
"note": "Documented (SteamDB FileDetectionRuleSets, NetEase_Yidun). Unmeasured." },
{ "family": "Nexon Game Security", "match": "prefix", "values": [ "BlackCipher", "BlackCall", "BlackXchg" ],
"note": "BlackCipher64.aes runs as its own process in the game's tree (The First Descendant, MapleStory). Documented (SteamDB BlackCipher). Unmeasured." },
{ "family": "mihoyo protect", "match": "prefix", "values": [ "mhypbase" ],
"note": "mhypbase.dll is the user-mode half HoYoverse titles load. Documented; unmeasured." },
{ "family": "TenProtect", "match": "prefix", "values": [ "TP3Helper", "TenSafe" ],
"note": "Tencent TenProtect. TP3Helper documented (SteamDB); TenSafe unmeasured." },
{ "family": "AhnLab HackShield", "match": "prefix", "values": [ "EhSvc", "HShield", "HSInst" ],
"note": "Documented (SteamDB HackShield: HShield/HSInst.dll). Unmeasured." },
{ "family": "Anybrain", "match": "exact", "values": [ "anybrainSDK.dll", "Cerebro.dll" ],
"note": "Behavioural, user-mode. Documented (SteamDB AnyBrain). Unmeasured." },
{ "family": "Roblox Hyperion", "match": "exact", "values": [ "RobloxPlayerBeta.dll" ],
"note": "Hyperion (Byfron) protects this module inside the Roblox player. Documented; unmeasured." },
{ "family": "EQU8", "match": "prefix", "values": [ "equ8" ],
"note": "Splitgate. Documented (SteamDB EQU8); module names unmeasured." },
{ "family": "Xigncode3", "match": "exact", "values": [ "x3.xem" ],
"note": "x3.xem is XIGNCODE3's loader, LoadLibrary'd as an ordinary module (documented). The files row names the same token in the install tree." }
],
"drivers": [
{ "family": "Riot Vanguard", "match": "exact", "values": [ "vgk.sys" ], "scope": "machine" },
{ "family": "mihoyo protect", "match": "prefix", "values": [ "mhyprot" ], "scope": "machine" },
{ "family": "mihoyo protect", "match": "prefix", "values": [ "mhyprot", "HoYoKProtect" ], "scope": "machine",
"note": "HoYoKProtect.sys (Genshin Impact's overseas client, 2025) is NOT matched by the mhyprot prefix, so it is named here (documented; unmeasured)." },
{ "family": "Easy Anti-Cheat", "match": "prefix", "values": [ "EasyAntiCheat" ], "scope": "machine",
"note": "MEASURED 2026-08-04: EasyAntiCheat_EOSSys was Running as a kernel driver while a real EAC title played, and matched NOTHING in this group — the refusal came from the service check instead. A family caught through only one of five groups is one rename away from being missed." },
{ "family": "Anti-Cheat Expert", "match": "exact", "values": [ "ACE-BASE.sys", "ACE-ADVT.sys", "ACE-GAME.sys" ], "scope": "machine",
"note": "ACE-BASE.sys and ACE-ADVT.sys MEASURED under System32\\drivers on the dev machine 2026-08-04. ACE-GAME.sys is a documented sibling and is UNMEASURED: a blocklist may over-cover, never under-cover. Exact not prefix — 'ACE-' is four characters over a namespace we do not own." }
"note": "ACE-BASE.sys and ACE-ADVT.sys MEASURED under System32\\drivers on the dev machine 2026-08-04. ACE-GAME.sys is a documented sibling and is UNMEASURED: a blocklist may over-cover, never under-cover. Exact not prefix — 'ACE-' is four characters over a namespace we do not own." },
{ "family": "BattlEye", "match": "exact", "values": [ "BEDaisy.sys" ], "scope": "machine",
"note": "BattlEye's kernel driver, loaded by BEService while a protected game runs and unloaded after (documented, BattlEye FAQ). Unmeasured." },
{ "family": "FACEIT", "match": "exact", "values": [ "FACEIT.sys" ], "scope": "machine",
"note": "Loaded while the FACEIT AC client runs (documented, FACEIT support). Unmeasured." },
{ "family": "ESEA", "match": "prefix", "values": [ "ESEADriver" ], "scope": "machine",
"note": "ESEADriver2.sys (documented). Unmeasured." },
{ "family": "EA AntiCheat", "match": "exact", "values": [ "EAAntiCheat.sys" ], "scope": "machine",
"note": "EA Javelin's kernel driver, loaded with the game (documented, EA forums). Unmeasured. Its user-mode EAAntiCheatService is deliberately NOT listed: it can be set to start automatically, and a service that is always running would refuse every session on the machine." },
{ "family": "Activision Ricochet", "match": "exact", "values": [ "randgrid.sys", "brynhildr.sys", "atvi-brynhildr.sys" ], "scope": "machine",
"note": "RICOCHET's kernel driver randgrid.sys (documented, Activision support; a kernel service pointing at the file in the game folder); brynhildr is its 2021 predecessor (Microsoft Q&A). Unmeasured." },
{ "family": "NetEase Anti-Cheat", "match": "prefix", "values": [ "NeacSafe" ], "scope": "machine",
"note": "NeacSafe64.sys, a minifilter loaded during play (documented, LOLDrivers). Unmeasured." },
{ "family": "Xigncode3", "match": "prefix", "values": [ "xhunter" ], "scope": "machine",
"note": "xhunter1.sys, XIGNCODE3's kernel driver (documented, LOLDrivers / Wellbia FAQ). Unmeasured." },
{ "family": "Denuvo Anti-Cheat", "match": "exact", "values": [ "denuvo-anti-cheat.sys" ], "scope": "machine",
"note": "Loaded only while a protected game runs (documented, Irdeto Q&A; file name from DRML). Unmeasured." },
{ "family": "EQU8", "match": "prefix", "values": [ "EQU8_HELPER" ], "scope": "machine",
"note": "EQU8_HELPER_<n>.sys (documented). Unmeasured." },
{ "family": "PunkBuster", "match": "prefix", "values": [ "PnkBstrK" ], "scope": "machine",
"note": "PnkBstrK.sys, PunkBuster's kernel component. Unmeasured." },
{ "family": "TenProtect", "match": "exact", "values": [ "TesSafe.sys" ], "scope": "machine",
"note": "Tencent game-protection driver (documented). Unmeasured." },
{ "family": "Nexon Game Security", "match": "exact", "values": [ "BlackCat64.sys" ], "scope": "machine",
"note": "Documented (SteamDB BlackCipher). Unmeasured." }
],
"directories": [
{ "family": "Easy Anti-Cheat", "values": [ "EasyAntiCheat" ] },
{ "family": "BattlEye", "values": [ "BattlEye" ] }
{ "family": "Easy Anti-Cheat", "values": [ "EasyAntiCheat", "EasyAntiCheat_EOS" ] },
{ "family": "BattlEye", "values": [ "BattlEye" ] },
{ "family": "Anti-Cheat Expert", "values": [ "AntiCheatExpert", "AceAntibotClient" ],
"note": "Documented (SteamDB FileDetectionRuleSets, AntiCheatExpert). Unmeasured." },
{ "family": "nProtect GameGuard", "values": [ "GameGuard" ] },
{ "family": "Xigncode3", "values": [ "XIGNCODE", "XIGNCODE3" ] },
{ "family": "AhnLab HackShield", "values": [ "HShield" ],
"note": "Documented (SteamDB HackShield). Unmeasured." },
{ "family": "Nexon Game Security", "values": [ "BlackCipher" ],
"note": "Measured by others at M1/Binaries/Win64/BlackCipher/ (The First Descendant, Steam community); unmeasured here." },
{ "family": "PunkBuster", "values": [ "PunkBuster" ],
"note": "Documented (SteamDB PunkBuster). The two-letter pb/ folder some titles use is deliberately NOT a token: too short to be a signal." },
{ "family": "FredaikisAntiCheat", "values": [ "FredaikisAntiCheat" ],
"note": "Documented (SteamDB FileDetectionRuleSets). Unmeasured." }
],
"services": [
{ "family": "Easy Anti-Cheat", "values": [ "EasyAntiCheat", "EasyAntiCheat_EOS", "EasyAntiCheat_EOSSys" ] },
{ "family": "Riot Vanguard", "values": [ "vgc" ] },
{ "family": "Riot Vanguard", "values": [ "vgc", "vgk" ],
"note": "vgk is the kernel driver's service, started at boot like vgk.sys itself." },
{ "family": "Anti-Cheat Expert", "values": [ "AntiCheatExpert Protection", "AntiCheatExpert Service" ],
"note": "'AntiCheatExpert Protection' MEASURED registered on the dev machine 2026-08-04 by Neverness To Everness. The sibling name is unmeasured." }
"note": "'AntiCheatExpert Protection' MEASURED registered on the dev machine 2026-08-04 by Neverness To Everness. The sibling name is unmeasured." },
{ "family": "BattlEye", "values": [ "BEService", "BEDaisy" ],
"note": "BEService is started by a protected game and stops after it; BEDaisy is the driver's service. A stopped service is absent (19_SAFETY). Unmeasured." },
{ "family": "FACEIT", "values": [ "FACEIT", "FACEITService" ],
"note": "Running while the FACEIT AC client runs (documented, FACEIT support). Unmeasured." },
{ "family": "ESEA", "values": [ "ESEADriver2" ] },
{ "family": "Activision Ricochet", "values": [ "atvi-randgrid_sr", "atvi-randgrid_msstore" ],
"note": "Kernel services pointing at randgrid.sys; running only while Call of Duty runs (documented, Activision support). Unmeasured." },
{ "family": "mihoyo protect", "values": [ "mhyprot2", "mhyprot3", "HoYoKProtect" ] },
{ "family": "Xigncode3", "values": [ "xhunter1" ] },
{ "family": "Denuvo Anti-Cheat", "values": [ "denuvo-anti-cheat" ],
"note": "The driver's service. The separate update service runs outside play and is deliberately NOT listed." },
{ "family": "nProtect GameGuard", "values": [ "npggsvc" ] }
],
"files": [
{ "family": "Xigncode3", "values": [ "x3.xem" ], "note": "Data file shipped beside the game, not a loadable module." },
{ "family": "Anti-Cheat Expert", "values": [ "PGameProtectDriver_X64.sys" ],
"note": "A KERNEL DRIVER shipped inside the game install. MEASURED at 'Neverness To Everness/NTEGlobal/driver/' 2026-08-04, where check 4 returned Allow: no group named it, and the fuzzy tier is modules-only — so a name containing 'protect' sat in the game's tree and the static scan walked past." }
{ "family": "Xigncode3", "values": [ "x3.xem", "xhunter1.sys" ],
"note": "Shipped beside the game. This note said 'not a loadable module' until 2026-09-25: XIGNCODE3 LoadLibrary's x3.xem as its loader (documented), which is why the modules group names it too." },
{ "family": "Anti-Cheat Expert", "values": [ "PGameProtectDriver_X64.sys", "SGuard64.exe", "SGuardSvc64.exe" ],
"note": "A KERNEL DRIVER shipped inside the game install. MEASURED at 'Neverness To Everness/NTEGlobal/driver/' 2026-08-04, where check 4 returned Allow: no group named it, and the fuzzy tier is modules-only — so a name containing 'protect' sat in the game's tree and the static scan walked past." },
{ "family": "Easy Anti-Cheat", "values": [ "EasyAntiCheat_EOS_Setup.exe", "EasyAntiCheat_Setup.exe", "EasyAntiCheat_x64.dll", "EasyAntiCheat_x86.dll", "EasyAntiCheat_EOS.sys", "start_protected_game.exe", "eac_server64.dll" ],
"note": "For a layout where the EasyAntiCheat folder sits deeper than the scan reaches. start_protected_game.exe is the EAC launcher FromSoftware titles ship (ELDEN RING's appeared in the owner's Windows Application log on 2026-09-21)." },
{ "family": "BattlEye", "values": [ "BEService.exe", "BEService_x64.exe", "BEClient.dll", "BEClient_x64.dll", "BEDaisy.sys" ],
"note": "Documented (SteamDB BattlEye). Unmeasured." },
{ "family": "EA AntiCheat", "values": [ "EAAntiCheat.Installer.exe", "EAAntiCheat.GameServiceLauncher.exe", "EAAntiCheat.GameServiceLauncher.dll" ],
"note": "Documented (SteamDB EA_AntiCheat; EA forums). Unmeasured." },
{ "family": "Activision Ricochet", "values": [ "randgrid.sys" ],
"note": "The driver ships inside the game folder (documented, Activision support). Unmeasured." },
{ "family": "mihoyo protect", "values": [ "mhypbase.dll", "mhyprot2.sys", "mhyprot3.sys", "HoYoKProtect.sys" ] },
{ "family": "NetEase Anti-Cheat", "values": [ "NeacSafe64.sys", "NeacSafe64_ex.sys" ],
"note": "Documented (SteamDB NetEase_AntiCheatExperts). Unmeasured." },
{ "family": "NetEase Yidun", "values": [ "NEP2.dll" ] },
{ "family": "Nexon Game Security", "values": [ "BlackCipher.aes", "BlackCipher64.aes", "BlackCall.aes", "BlackCall64.aes", "BlackCat64.sys" ] },
{ "family": "TenProtect", "values": [ "TP3Helper.exe" ] },
{ "family": "EQU8", "values": [ "equ8_conf.json" ] },
{ "family": "AhnLab HackShield", "values": [ "HSInst.dll", "EhSvc.dll" ] },
{ "family": "nProtect GameGuard", "values": [ "GameGuard.des", "GameMon.des", "GameMon64.des", "npggNT.des", "npggNT64.des", "npsc.des" ],
"note": "GameGuard's engine files (documented, file.net / SteamDB). Unmeasured." },
{ "family": "PunkBuster", "values": [ "pbsvc.exe", "PnkBstrA.exe", "PnkBstrB.exe", "pbsv.dll", "pbcl.dll", "pbag.dll" ],
"note": "Files in the install tree, not services: PnkBstrA runs at every boot once installed, so as a service it would refuse every session on the machine." },
{ "family": "Anybrain", "values": [ "anybrainSDK.dll", "Cerebro.dll" ] },
{ "family": "Denuvo Anti-Cheat", "values": [ "denuvo-anti-cheat.sys", "denuvo-anti-cheat-runtime.dll", "denuvo-anti-cheat-update-service.exe" ],
"note": "Documented (DRML). Unmeasured." },
{ "family": "Roblox Hyperion", "values": [ "RobloxPlayerBeta.dll" ] }
],
"heuristic": {
"$comment": [
+6 -6
View File
@@ -404,7 +404,7 @@
"$comment": "maxItems is fl::guard::kMaxFamilies, and it bounds the SUM of all five groups, not this one array - the parser fills a single families[kMaxFamilies] from all of them. A schema cannot express a cross-array total, so the per-array cap is set to the total (no single array can breach it alone) and tools/rules-validate.ps1 checks the sum imperatively. Exceeding it is ParseResult::kTooLarge for the whole file, i.e. the guard refuses every title.",
"type": "array",
"minItems": 1,
"maxItems": 64,
"maxItems": 256,
"items": { "$ref": "#/$defs/acMatchGroup" },
"allOf": [
{
@@ -420,7 +420,7 @@
"drivers": {
"type": "array",
"minItems": 1,
"maxItems": 64,
"maxItems": 256,
"items": { "$ref": "#/$defs/acDriverGroup" },
"allOf": [
{
@@ -429,14 +429,14 @@
]
},
"directories": { "type": "array", "minItems": 1, "maxItems": 64, "items": { "$ref": "#/$defs/acNameGroup" } },
"services": { "type": "array", "minItems": 1, "maxItems": 64, "items": { "$ref": "#/$defs/acNameGroup" } },
"directories": { "type": "array", "minItems": 1, "maxItems": 256, "items": { "$ref": "#/$defs/acNameGroup" } },
"services": { "type": "array", "minItems": 1, "maxItems": 256, "items": { "$ref": "#/$defs/acNameGroup" } },
"files": {
"$comment": "NEW in this schema. 19_SAFETY lists Xigncode3's `x3.xem`, which is a data file shipped beside the game rather than a loadable module - the previous seed had nowhere to put it. Also the home for the anti-cheat SDK payloads that 19_SAFETY check 4 (multiplayer heuristic) looks for during the static pre-scan.",
"$comment": "NEW in this schema. 19_SAFETY lists Xigncode3's `x3.xem`, which is a data file shipped beside the game rather than a loadable module - the previous seed had nowhere to put it (2026-09-25: XIGNCODE3 also LoadLibrary's it as its loader, so modules names it too). Also the home for the anti-cheat SDK payloads that 19_SAFETY check 4 (multiplayer heuristic) looks for during the static pre-scan.",
"type": "array",
"minItems": 1,
"maxItems": 64,
"maxItems": 256,
"items": { "$ref": "#/$defs/acNameGroup" }
},
@@ -32,7 +32,10 @@ enum class Group : std::uint8_t { kModules = 0, kDrivers, kDirectories, kService
//
// Note the off-by-one: CopyToken reserves a byte for the NUL and rejects at
// `len >= cap`, so kMaxValueLen 96 admits 95 characters, not 96.
inline constexpr std::size_t kMaxFamilies = 64;
// 64 until 2026-09-25, when the seed grew from 19 entries to 74 (eleven families became twenty-two, and most
// gained a driver, a service or a file) and 2 x 74 no longer fitted. Each slot is ~1.6 KB, so `Rules` is ~530 KB:
// every production instance is static or heap-allocated and reset with ResetRules, never a stack temporary.
inline constexpr std::size_t kMaxFamilies = 256;
inline constexpr std::size_t kMaxValuesPerFamily = 16;
// The floor is GENERATED from rules/detection-rules.json and occupies family
@@ -131,6 +134,14 @@ struct Rules {
std::size_t trustedSignerCount = 0;
};
// Returns `r` to the state of a value-initialised `Rules{}` WITHOUT materialising one.
//
// `r = Rules{}` builds a ~530 KB temporary on the stack before copying it, and ParseRules runs inside the Vulkan
// layer, on whatever thread of a game we do not own calls vkCreateInstance — a thread whose stack may be far smaller
// than that. The default state is all zero bytes (every count 0, every buffer empty, MatchKind::kExact and
// Group::kModules both 0; fl_ac_rules.cpp asserts it), so a memset over the object is the same value.
void ResetRules(Rules& r) noexcept;
enum class ParseResult : std::uint8_t {
kOk = 0,
kMalformed, // not JSON, or not the shape we require
@@ -12,6 +12,7 @@
#include <knownfolders.h>
#include <objbase.h>
#include <shlobj_core.h>
#include <type_traits>
// Its own block, below the sorted one, because it needs Family/Group/MatchKind
// from fl_ac_rules.h and clang-format sorts each block independently.
@@ -413,6 +414,17 @@ struct SuppliedFamilies {
} // namespace
// ResetRules is a memset, which is only the value of `Rules{}` while every member's default is zero bytes. These
// hold that premise to the types: a new member with a non-zero default, or an enum whose first value moves off 0,
// fails the build here rather than leaving stale-looking defaults behind.
static_assert(std::is_trivially_copyable_v<Rules>, "ResetRules zero-fills Rules in place");
static_assert(static_cast<int>(MatchKind::kExact) == 0 && static_cast<int>(Group::kModules) == 0,
"a zero-filled Family must read as an exact module entry, as Family{} does");
void ResetRules(Rules& r) noexcept {
std::memset(static_cast<void*>(&r), 0, sizeof(Rules));
}
const Family* FloorFamilies(std::size_t& count) noexcept {
count = sizeof(generated::kFloorFamilies) / sizeof(generated::kFloorFamilies[0]);
return generated::kFloorFamilies;
@@ -424,7 +436,7 @@ const char* const* FloorFragments(std::size_t& count) noexcept {
}
ParseResult ParseRules(const char* json, std::size_t length, Rules& out) noexcept {
out = Rules{};
ResetRules(out);
// §S21. The floor goes in FIRST, before a byte of the file is read, and
// nothing below ever rewrites or removes these entries — the file's families
@@ -598,7 +598,7 @@ Verdict EvaluateImpl(std::uint32_t targetPid, const Sources& sources) noexcept {
// on the stack. Cleared on every call: a stale blocklist from a previous
// evaluation would be a gate answering about the wrong data.
static Rules rules;
rules = Rules{};
ResetRules(rules);
if (Verdict v = LoadRules(sources, rules); !v.Allowed()) {
return v;
@@ -199,7 +199,7 @@ Verdict StaticPreScan(const wchar_t* gameDirectory) noexcept {
}
static Rules rules;
rules = Rules{};
ResetRules(rules);
switch (ParseRules(buffer, n, rules)) {
case ParseResult::kOk:
break;
@@ -226,7 +226,7 @@ Verdict StaticPreScanWithSources(const wchar_t* gameDirectory, const Sources& so
}
static Rules rules;
rules = Rules{};
ResetRules(rules);
switch (ParseRules(buffer, n, rules)) {
case ParseResult::kOk:
break;
+8 -4
View File
@@ -206,10 +206,14 @@ bool RunSelfScan() noexcept {
// Heap, not static. This runs once at init inside a process we do not own,
// and 17_HOOK_ENGINE budgets 8 MB resident for everything of ours in a
// game — so the ~1 MiB of rules text and ~155 KB of parsed rules are
// released the moment the verdict is known. Init is not a hook path, so
// allocating here breaks no rule; keeping it resident would waste budget
// on data we never look at again.
// game — so the ~1 MiB of rules text and the parsed rules are released the
// moment the verdict is known. Init is not a hook path, so allocating here
// breaks no rule; keeping it resident would waste budget on data we never
// look at again. The parsed rules were ~226 KB (this comment said ~155 KB,
// a figure from before the per-title lists were objects) and are 541,736
// bytes since kMaxFamilies became 256 on 2026-09-25 — ctest fl_rules_budget
// prints sizeof(Rules) on every run. ParseRules resets them in place
// (ResetRules), so no copy of that size ever lands on this thread's stack.
auto* text = static_cast<char*>(HeapAlloc(GetProcessHeap(), 0, kMaxRulesBytes));
if (text == nullptr) {
return true;
+31 -13
View File
@@ -23,6 +23,7 @@
#include <fl_guard.h>
#include <fl_prescan.h>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <utility>
@@ -409,7 +410,8 @@ TEST_CASE("a clean process on a clean machine is allowed", "[guard]") {
// each asserting a positive match, a case-flipped match, and a near miss.
// ===========================================================================
TEST_CASE("every seeded module family matches, case-insensitively", "[guard][blocklist]") {
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
REQUIRE(ParseRules(GoodRulesJson(), std::strlen(GoodRulesJson()), rules) == ParseResult::kOk);
struct Case {
@@ -444,7 +446,8 @@ TEST_CASE("every seeded module family matches, case-insensitively", "[guard][blo
}
TEST_CASE("Vanguard is matched as a DRIVER, on the path leaf", "[guard][blocklist]") {
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
REQUIRE(ParseRules(GoodRulesJson(), std::strlen(GoodRulesJson()), rules) == ParseResult::kOk);
// Drivers arrive as native paths.
@@ -458,16 +461,27 @@ TEST_CASE("Vanguard is matched as a DRIVER, on the path leaf", "[guard][blocklis
CHECK(MatchName(rules, Group::kModules, "vgk.sys") == nullptr);
}
TEST_CASE("Ricochet and VAC have no data, and the fixture says so explicitly", "[guard][blocklist]") {
Rules rules;
TEST_CASE("Ricochet has data in three groups, and VAC is not a family entry", "[guard][blocklist]") {
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
REQUIRE(ParseRules(GoodRulesJson(), std::strlen(GoodRulesJson()), rules) == ParseResult::kOk);
// 19_SAFETY lists both families with "no data yet". A fixture that quietly
// passed on an empty rule set would report coverage the gate does not have,
// so assert the ABSENCE deliberately — this test should start failing the
// day someone adds the data, which is exactly when it should be revisited.
// Until 2026-09-25 this asserted that NEITHER family had data, and said it should start failing the day someone
// added it. Ricochet's arrived from Activision's own support pages (19_SAFETY §Blocklist seed), through the floor
// — GoodRulesJson names none of it, so these matches prove the generated floor carries the seed's new rows.
const Family* driver = MatchName(rules, Group::kDrivers, "\\SystemRoot\\System32\\drivers\\randgrid.sys");
REQUIRE(driver != nullptr);
CHECK(std::strcmp(driver->name, "Activision Ricochet") == 0);
const Family* service = MatchName(rules, Group::kServices, "atvi-randgrid_sr");
REQUIRE(service != nullptr);
CHECK(std::strcmp(service->name, "Activision Ricochet") == 0);
const Family* file = MatchName(rules, Group::kFiles, "randgrid.sys");
REQUIRE(file != nullptr);
CHECK(std::strcmp(file->name, "Activision Ricochet") == 0);
// VAC runs inside Steam, not in the game's own tree, so there is no module, driver or file of the game's to name:
// it is expressed through the per-title lists (check 3) and must never be faked as a family entry here.
for (std::size_t i = 0; i < rules.familyCount; ++i) {
CHECK(std::strcmp(rules.families[i].name, "Activision Ricochet") != 0);
CHECK(std::strcmp(rules.families[i].name, "Valve VAC") != 0);
}
}
@@ -919,7 +933,8 @@ TEST_CASE("a rules file that names the required families but disarms their value
SECTION("the document is still ACCEPTED — the refusal comes from the floor, not from ParseRules") {
// If this ever became kRulesMalformed/kIncomplete the sections below
// would pass for the wrong reason, and the floor would be untested.
Rules parsed;
auto parsedOwner = std::make_unique<Rules>();
Rules& parsed = *parsedOwner;
const std::string json = DisarmedRulesJson();
CHECK(ParseRules(json.c_str(), json.size(), parsed) == ParseResult::kOk);
}
@@ -1106,7 +1121,8 @@ TEST_CASE("a default-constructed Verdict is a refusal", "[guard][failclosed]") {
// The heuristic. 19_SAFETY: fragment AND not signed by a known vendor.
// ===========================================================================
TEST_CASE("signer comparison is against O=, exact, and untrusted-by-default", "[guard][heuristic]") {
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
REQUIRE(ParseRules(GoodRulesJson(), std::strlen(GoodRulesJson()), rules) == ParseResult::kOk);
CHECK(IsTrustedSigner(rules, "Microsoft Corporation"));
@@ -1146,7 +1162,8 @@ TEST_CASE("a suspicious module name refuses when the signer seam cannot vouch fo
// ===========================================================================
TEST_CASE("§S19(b) — the compiled-in bound: the rules file may only INTERSECT it", "[guard][heuristic][S19]") {
ResetFake();
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
REQUIRE(ParseRules(g.rulesJson.data(), g.rulesJson.size(), rules) == ParseResult::kOk);
// On both lists: trusted.
@@ -1165,7 +1182,8 @@ TEST_CASE("§S19(b) — the compiled-in bound: the rules file may only INTERSECT
const std::size_t at = widened.find(needle);
REQUIRE(at != std::string::npos);
widened.replace(at, needle.size(), "\"Valve Corp.\", \"Evil Corp\"");
Rules wide;
auto wideOwner = std::make_unique<Rules>();
Rules& wide = *wideOwner;
REQUIRE(ParseRules(widened.data(), widened.size(), wide) == ParseResult::kOk);
CHECK_FALSE(IsCompiledTrustedSigner("Evil Corp"));
CHECK_FALSE(IsTrustedSigner(wide, "Evil Corp"));
+73 -21
View File
@@ -24,6 +24,7 @@
#include <cstdio>
#include <fl_ac_rules.h>
#include <jsmn.h>
#include <memory>
#include <string>
#include <vector>
@@ -140,7 +141,8 @@ std::string FamilyWithValues(std::size_t n) {
TEST_CASE("the rules file that SHIPS parses in the guard", "[rules][seed]") {
const std::string seed = ReadSeed();
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
const ParseResult r = ParseRules(seed.c_str(), seed.size(), rules);
// Not just "not malformed": kIncomplete would mean the seed lost a required
@@ -149,7 +151,10 @@ TEST_CASE("the rules file that SHIPS parses in the guard", "[rules][seed]") {
CHECK(rules.familyCount > 0);
CHECK(rules.familyCount <= kMaxFamilies);
std::printf("[seed] %zu bytes, %zu families of %zu\n", seed.size(), rules.familyCount, kMaxFamilies);
// sizeof(Rules) is printed because the Vulkan layer heap-allocates one inside a game's process at init
// (layer.cpp RunSelfScan), and its comment quotes the figure.
std::printf("[seed] %zu bytes, %zu families of %zu, sizeof(Rules) %zu\n", seed.size(), rules.familyCount,
kMaxFamilies, sizeof(Rules));
}
// §S21. The floor is generated from rules/detection-rules.json, so it cannot be
@@ -165,7 +170,8 @@ TEST_CASE("the rules file that SHIPS parses in the guard", "[rules][seed]") {
TEST_CASE("the generated floor reproduces the shipped seed exactly", "[rules][seed][floor]") {
const std::string seed = ReadSeed();
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
REQUIRE(ParseRules(seed.c_str(), seed.size(), rules) == ParseResult::kOk);
std::size_t floorCount = 0;
@@ -187,6 +193,40 @@ TEST_CASE("the generated floor reproduces the shipped seed exactly", "[rules][se
std::printf("[floor] %zu families, %zu fragments — generated from the seed\n", floorCount, fragCount);
}
// 14_TESTING: "every family in 19_SAFETY §Blocklist seed has a fixture". Hand-written cases covered the first eleven
// families; the seed has twenty-two since 2026-09-25, so the fixture is GENERATED from the seed itself: every entry's
// every value must reach its own family through MatchName, in its own group. That also catches a row an earlier row
// shadows — a prefix that swallows a later token reports the wrong family — which no hand-picked case would notice.
TEST_CASE("every entry of the shipped seed matches its own family, in its own group", "[rules][seed][fixture]") {
const std::string seed = ReadSeed();
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
REQUIRE(ParseRules(seed.c_str(), seed.size(), rules) == ParseResult::kOk);
std::size_t checked = 0;
for (std::size_t i = 0; i < rules.familyCount; ++i) {
const Family& f = rules.families[i];
for (std::size_t v = 0; v < f.valueCount; ++v) {
// A prefix entry is exercised with a suffix, so the prefix semantics are what is tested; a driver arrives
// as a native path and is matched on its leaf.
std::string observed = f.values[v];
if (f.match == MatchKind::kPrefix) {
observed += "64.dll";
}
if (f.group == Group::kDrivers) {
observed = "\\SystemRoot\\System32\\drivers\\" + observed;
}
const Family* hit = MatchName(rules, f.group, observed.c_str());
INFO("'" << observed << "' in group " << static_cast<int>(f.group) << " should match " << f.name);
REQUIRE(hit != nullptr);
CHECK(std::string(hit->name) == f.name);
++checked;
}
}
CHECK(checked > 100);
std::printf("[fixture] %zu seed values each matched their own family\n", checked);
}
// The property the floor exists for, asserted against the gate rather than
// against the generator: a rules file that names the three required families and
// nothing else must still block everything the shipped seed blocks.
@@ -206,7 +246,8 @@ TEST_CASE("a minimal rules file cannot shrink the blocklist", "[rules][floor][fa
"blockedExecutables": [], "blockedStoreIds": []
}})";
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
REQUIRE(ParseRules(minimal.c_str(), minimal.size(), rules) == ParseResult::kOk);
struct Case {
@@ -265,8 +306,9 @@ TEST_CASE("the shipped seed is inside the guard's parse budget", "[rules][seed][
// would pass against a parser that rejects everything.
// ===========================================================================
TEST_CASE("a family holds exactly kMaxValuesPerFamily values, and not one more", "[rules][bounds]") {
Rules rules;
Doc ok;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
Doc ok;
ok.extraModules = FamilyWithValues(kMaxValuesPerFamily);
CHECK(ParseDoc(Build(ok), rules) == ParseResult::kOk);
@@ -279,7 +321,8 @@ TEST_CASE("a value holds kMaxValueLen-1 characters, and not kMaxValueLen", "[rul
// CopyToken reserves a byte for the NUL and rejects at `len >= cap`, so the
// schema's maxLength must be kMaxValueLen - 1. It said 128 against a cap of
// 96, which is where this off-by-one was hiding.
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
Doc ok;
ok.extraModules = ",\n { \"family\": \"Long\", \"match\": \"exact\", \"values\": [\"" +
@@ -293,7 +336,8 @@ TEST_CASE("a value holds kMaxValueLen-1 characters, and not kMaxValueLen", "[rul
}
TEST_CASE("a family name holds kMaxFamilyNameLen-1 characters, and not kMaxFamilyNameLen", "[rules][bounds]") {
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
Doc ok;
ok.extraModules = ",\n { \"family\": \"" + Repeat('F', kMaxFamilyNameLen - 1) +
@@ -325,8 +369,9 @@ TEST_CASE("the file holds exactly kMaxFamilies families, and not one more", "[ru
// deduplicated rather than stored. Arithmetic over kFixtureFamilies would
// have to model both and would go stale the next time the seed changes — so
// the baseline is taken from the parser itself.
Rules rules;
Doc baseline;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
Doc baseline;
REQUIRE(ParseDoc(Build(baseline), rules) == ParseResult::kOk);
const std::size_t used = rules.familyCount;
REQUIRE(used < kMaxFamilies);
@@ -346,7 +391,8 @@ TEST_CASE("the file holds exactly kMaxFamilies families, and not one more", "[ru
}
TEST_CASE("a prefix holds kMinPrefixLen characters, and not one fewer", "[rules][bounds]") {
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
Doc ok;
ok.extraModules = ",\n { \"family\": \"Short\", \"match\": \"prefix\", \"values\": [\"" +
@@ -362,7 +408,8 @@ TEST_CASE("a prefix holds kMinPrefixLen characters, and not one fewer", "[rules]
}
TEST_CASE("a heuristic array holds its cap, and not one more", "[rules][bounds]") {
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
auto list = [](const char* stem, std::size_t n) {
std::string s = "[";
@@ -405,8 +452,9 @@ TEST_CASE("a heuristic array holds its cap, and not one more", "[rules][bounds]"
// because nothing ever put an entry in either array.
// ===========================================================================
TEST_CASE("blockedExecutables entries are objects, and carry family and reason", "[rules][shape]") {
Rules rules;
Doc d;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
Doc d;
d.blockedExecutables =
R"([{ "family": "Example Online", "match": "exact", "values": ["ranked.exe"], "reason": "competitive online title" }])";
REQUIRE(ParseDoc(Build(d), rules) == ParseResult::kOk);
@@ -427,14 +475,16 @@ TEST_CASE("a bare string in blockedExecutables is REFUSED, not silently stored",
// This is the shape the parser used to accept. It matched nothing, because
// an exe name is not a rule — so had anyone ever populated the array, the
// check would have looked configured and blocked nothing.
Rules rules;
Doc d;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
Doc d;
d.blockedExecutables = R"(["ranked.exe"])";
CHECK(ParseDoc(Build(d), rules) == ParseResult::kMalformed);
}
TEST_CASE("a blockedExecutables entry holds kMaxValuesPerTitleRule values, and not one more", "[rules][bounds]") {
Rules rules;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
auto entry = [](std::size_t n) {
std::string s = R"([{ "family": "Example", "match": "exact", "reason": "why", "values": [)";
@@ -455,8 +505,9 @@ TEST_CASE("a blockedExecutables entry holds kMaxValuesPerTitleRule values, and n
}
TEST_CASE("blockedStoreIds compose store and id into the joined form", "[rules][shape]") {
Rules rules;
Doc d;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
Doc d;
d.blockedStoreIds =
R"([{ "store": "steam", "id": "730", "family": "Valve VAC", "reason": "VAC-protected online title" }])";
REQUIRE(ParseDoc(Build(d), rules) == ParseResult::kOk);
@@ -478,8 +529,9 @@ TEST_CASE("blockedStoreIds compose store and id into the joined form", "[rules][
TEST_CASE("a per-title entry missing its reason is REFUSED", "[rules][shape][failclosed]") {
// 19_SAFETY requires the refusal to name the check that fired and why, and
// check 3's signal — an executable name — explains nothing on its own.
Rules rules;
Doc d;
auto rulesOwner = std::make_unique<Rules>();
Rules& rules = *rulesOwner;
Doc d;
d.blockedExecutables = R"([{ "family": "Example", "match": "exact", "values": ["ranked.exe"] }])";
CHECK(ParseDoc(Build(d), rules) == ParseResult::kMalformed);
}