Skip to content

Pointer chain checks#311

Draft
Krilliac wants to merge 3 commits intomangoszero:masterfrom
Krilliac:claude/add-custom-pointer-check-XcR4N
Draft

Pointer chain checks#311
Krilliac wants to merge 3 commits intomangoszero:masterfrom
Krilliac:claude/add-custom-pointer-check-XcR4N

Conversation

@Krilliac
Copy link
Copy Markdown
Contributor

@Krilliac Krilliac commented May 5, 2026

This change is Reviewable

claude added 2 commits May 5, 2026 15:58
Introduces a server-only check type CUSTOM_CHECK = 0xF4 that piggybacks
on the existing MEM_CHECK (0xF3) wire format so the unmodified client
module accepts it, but routes responses through a separate handler that
walks a multi-hop pointer dereference chain and validates the final
target bytes. Keeps MEM_CHECK validation logic untouched.

- Warden.h: add CUSTOM_CHECK enum value
- WardenCheckMgr: load Address/Length/Str/Result for CUSTOM_CHECK rows;
  group with MEM_CHECK in the mem-check id list
- WardenWin: per-session chain state (single chain in flight), chain
  offset parser, hop scheduler in RequestData (emits MEM_CHECK on the
  wire), separate CUSTOM_CHECK case in HandleData that advances the
  chain on intermediate hops and memcmp-validates on the terminal hop
Renames the type-244 check across enum, struct, members, helpers, and log
strings to reflect what it actually does. Adds contrib/warden/pointer_
chain_examples.sql with four annotated INSERTs demonstrating the feature
against vanilla 1.12.1 (build 5875): vtable-hook detection on the Client
Object Manager, IAT-detour detection on kernel32!GetTickCount, an object-
type spoof check, and a zero-hop smoke test against the SFileOpenFile
prologue. Addresses are templates calibrated against publicly documented
disassemblies and the addresses already used in WardenWin's module-init
block; expected `result` bytes are TODO placeholders to be filled from a
clean client capture before deployment.
@Krilliac Krilliac marked this pull request as draft May 5, 2026 16:13
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 5, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Inspired by Krilliac/AdvancedWarden's MEM2_CHECK pattern (fail when
bytes match a known cheat signature) and its GAGARIN_CHECK_ID pair
(carry a runtime-discovered dynamic address across two checks). Their
C++ doesn't drop in (different fork: TrinityCore + boost + different DB
schema), but the inverted-match capability is a small generic addition
that lets one POINTER_CHAIN_CHECK row express either:

  - verify-clean       — fail when terminal bytes don't match expected
  - signature detect   — fail when terminal bytes DO match expected

Encoded as an optional leading '!' on the chain string: '!0x2,0x4'
means "2-hop chain in signature-detect mode". '!' is consumed before
offset parsing, leaving the rest of the chain syntax unchanged. Result
column carries the signature bytes when in detect mode.

Adds a fifth example (id 10005) to contrib/warden/pointer_chain_
examples.sql modeling the AdvancedWarden 3rd-party-allocation scan
case. Updates the schema-reminder comment block to document the '!'
prefix.
@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants