DMA Attack Techniques
Overview
This skill covers DMA threat models, device isolation, and physical-memory acquisition evidence. It separates the component that accesses memory from the transport, analysis software, and optional input path. Classify capabilities and protection boundaries before reasoning about a particular device or product.
Classify the Acquisition Path First
For USB transfer cables, two-computer setups, LeechCore, or WinPmem, read
Memory acquisition and transport.
Use it to distinguish hardware bus access from host-mediated software capture
and to evaluate US516/90212 implementation claims against primary sources.
- Identify the memory source: PCIe requester, host kernel component, hypervisor
interface, or offline image. A library name or second computer does not settle it.
- Record source access requirements, transport endpoints, analysis location,
write capability, and input functionality separately; leave unknowns explicit.
- Map controls to the actual boundary: device DMA remapping, driver/interface
security, authenticated transport, or server-side information exposure.
- Report available artifacts, benign uses, missing visibility, and confidence.
A clean process module list or absent FPGA is not a clean-host finding.
Use research-rigor for disputed implementation,
performance, compatibility, or detectability claims. This classification does
not establish that a particular commercial setup uses the components it advertises.
For certainty claims about firmware classes, EPT, HVCI, containment, or TPM
proof, read assurance boundaries. It
separates mechanism, deployed policy, evidence coverage, and attribution.
README Coverage
Cheat > DMA
Anti Cheat > Detection:DMA
Anti Cheat > Detection: Hacked Hypervisor
Anti Cheat > Detection:Virtual Environments
Anti Cheat > Detection:HWID
Windows Security Features
Threat Model
External DMA Cheat Architecture
A modern external DMA cheat consists of three components:
1. Cheat PC — runs the cheat application, signature databases,
aim assistance, ESP rendering, and a network/USB link to the gaming PC.
2. DMA Card — an FPGA-based PCIe endpoint installed in the gaming PC
(typically M.2 NVMe slot). Exposes a memory-read/write interface to
the cheat PC. Uses Bus Master capability to issue Memory Read TLPs
against the gaming PC's RAM.
3. Actuator (optional) — a USB HID emulator (microcontroller-based) that
injects keyboard/mouse input on the gaming PC according to commands
from the cheat PC, closing the loop.
This hardware-only model need not use a host memory-acquisition process.
The device initiates memory transactions subject to platform routing and
IOMMU mappings. Host agents and mixed hardware/software designs are separate
cases. Visibility depends on the observer and platform; device presence,
configuration, policy state, and available fault telemetry are different
observations, none of which alone establishes malicious intent.
Three Defense Layers
| Layer |
Property evaluated |
Limits |
| PCIe identity and behavior |
Consistency with an identified device and matched baseline |
A mismatch needs version, topology, driver, workload, and benign-device context; an identifier is not proof of intent |
| IOMMU enforcement |
Device requests permitted by the active remapping policy |
Verify actual path, mappings, lifecycle, and available fault evidence; enforcement and observation are separate |
| External attestation |
Authenticity and policy appraisal of selected measurements |
Boot evidence does not automatically cover current device behavior or runtime mapping state |
Use the assurance reference for the
underlying platform contracts and the evidence required at each layer.
PCIe Protocol Stack
Three Protocol Layers
Layer Unit Function
────────────────────────────────────────────────────────────────
Transaction TLP Memory/IO/Config reads & writes,
completions, messages
Data Link DLLP Acknowledgements, flow control
credits, power management
Physical Ordered Sets Link training, equalization,
clock recovery
A real device's behavior is shaped by all three layers.
Many FPGA designs primarily customize Transaction-Layer behavior; Physical and
Data Link behavior may retain implementation fingerprints unless the selected
IP, configuration, and surrounding behavior closely match the claimed device.
Whether a fingerprint is usable must be validated on the actual link.
TLP (Transaction Layer Packet) Format
Every TLP contains a 3 DW (12-byte) or 4 DW (16-byte) base header; optional
TLP Prefixes may precede it. 4 DW headers are used for 64-bit addresses and
certain message types.
First DWord (DW0) encoding:
Bits Field Notes
[31:29] Fmt[2:0] Header format + data presence
[28:24] Type[4:0] TLP type (combined with Fmt)
[22:20] TC[2:0] Traffic Class (default 0)
[18] Attr[2] ID-Based Ordering (IDO)
[15] TD TLP Digest (ECRC trailer)
[14] EP Poisoned data
[13:12] Attr[1:0] Relaxed Ordering, No Snoop
[11:10] AT[1:0] Address Type (critical for ATS bypass)
[9:0] Length[9:0] Payload length in DWords (0x000 = 1024 DW = 4 KB)
Fmt[2:0] encoding:
000 = 3 DW header, no data
001 = 4 DW header, no data
010 = 3 DW header, with data
011 = 4 DW header, with data
100 = TLP Prefix
Key TLP types (Fmt + Type combinations):
Fmt Type TLP
000 0_0000 MRd (Memory Read, 3DW / 32-bit addr)
001 0_0000 MRd (Memory Read, 4DW / 64-bit addr)
010 0_0000 MWr (Memory Write, 3DW)
011 0_0000 MWr (Memory Write, 4DW)
000 0_0100 CfgRd0 (Config read — terminate at this device)
010 0_0100 CfgWr0
000 0_0101 CfgRd1 (Config read — forwarded by bridges)
010 0_0101 CfgWr1
000 0_1010 Cpl (Completion without data)
010 0_1010 CplD (Completion with data)
001 1_0rrr Msg (Message, no data)
011 1_0rrr MsgD (Message with data)
Detection-Relevant DW0 Fields
TC[2:0] — Traffic Class. Default traffic commonly uses TC0, but non-zero TC is
valid when platform and device policy configure it. Compare usage with the
claimed device, driver, and workload rather than flagging it in isolation.
Attr[2:0] — RO/NS/IDO. A device emulating a NIC must follow that NIC's
typical NS/RO usage pattern; mismatches are visible.
AT[1:0] — Address Type:
00 = Untranslated (IOMMU will translate)
01 = Translation Request (ATS only)
10 = Translated (device claims it has already translated via ATS)
This field is the basis of ATS bypass attacks.
TD — TLP Digest. If set, an ECRC trailer is present.
EP — Poisoned. Indicates data is known-bad.
TLP Routing and Requester ID
Three routing modes:
- Address routing — Memory and IO TLPs, matched against bridge apertures
- ID routing — Config TLPs and Completions, by BDF
- Implicit routing — Some Messages (broadcast, terminate at root)
DW1 carries the Requester ID (16 bits = Bus:Device:Function, "BDF")
and an 8-bit Tag for matching completions to requests.
Requester ID is a key input to IOMMU lookup, ACS source validation, AER source
identification, and interrupt-remapping policy. If spoofed IDs are accepted
without topology or source validation, per-function isolation can be
undermined; the exact effect depends on the platform and remapping path.
Transaction categories:
- Posted (P) — fire-and-forget (Memory Writes, Messages)
- Non-Posted (NP) — requires completion (Memory Reads, IO/Config R/W)
- Completion (Cpl/CplD) — response to Non-Posted requests
Completion Status codes:
000 = Successful Completion (SC)
001 = Unsupported Request (UR)
010 = Configuration Request Retry Status (CRS)
100 = Completer Abort (CA)
UR vs CA distinction matters for spoofing detection — real silicon
responds differently to malformed config accesses vs accesses to
unimplemented offsets. Many spoofed firmwares hard-code one or the other.
Memory Read Completion Splitting
A single Memory Read TLP returns up to Max_Read_Request_Size (MRRS) bytes.
The completer splits the payload at any boundary >= RCB
(Read Completion Boundary, 64 or 128 bytes).
Each fragment cannot exceed Max_Payload_Size (MPS).
Each Completion carries:
- Lower Address[6:0] — lowest 7 bits of first byte address
- Byte Count[11:0] — bytes remaining (last fragment's Byte Count
equals its own payload length)
- BCM — PCI-X compatibility (typically 0)
- Tag — matches originating MRd's Tag
The split pattern (fragment count, boundary positions) is a
strong fingerprint: real memory controllers produce characteristic
distributions of fragment sizes and inter-fragment gaps.
BRAM-backed emulators producing perfectly uniform 64-byte fragments
at constant cadence are anomalous.
Tag Space and Fingerprinting
- 5-bit Tag (original): 32 outstanding non-posted requests per Requester ID
- Extended Tag (PCIe 1.1+, Device Control[8]): 8-bit / 256 outstanding
- 10-Bit Tag (PCIe 4.0+, Device Control 2[12]): 1024 outstanding
Tag turnover discipline — which tags get reissued and how quickly —
reflects the device's internal request tracking pipeline.
Firmware that issues reads with no tag turnover (same tag, or monotonic
beyond negotiated limit) is observably distinct from real silicon.
MPS and MRRS as Fingerprints
Record current MPS/MRRS configuration and the responsible platform software;
do not infer the active values solely from advertised link capability.
- Device Capabilities[2:0]: Max_Payload_Size_Supported
(0=128, 1=256, 2=512, 3=1024, 4=2048, 5=4096 bytes)
- Device Control[7:5]: current MPS (must be <= Supported,
set to minimum of all devices in hierarchy)
- Device Control[14:12]: Max_Read_Request_Size (same encoding)
The discriminator is donor consistency: a device claiming a donor
that is known to support larger payloads, different tag behavior,
or a different negotiated profile should match that donor under
the same root-port constraints.
Data Link Layer
DLLPs provide reliable delivery between Physical and Transaction layers.
DLLP Purpose
─────────────────────────────────────────
Ack TLP received correctly
Nak TLP received with error; sender must replay
InitFC1/2 Flow control credit initialization at link bring-up
UpdateFC Ongoing flow control credit updates
PM_* Power management (L0s, L1 entry/exit)
Vendor Vendor-defined
Flow control credits are per TLP category:
- PH / PD — Posted Header / Data
- NPH / NPD — Non-Posted Header / Data
- CplH / CplD — Completion Header / Data
Negotiated credit values are not generally exposed through standard
Link Capabilities register. They are visible in protocol-level traces,
some root-port/vendor performance counters, or FPGA-side debug.
Useful for lab fingerprinting and forensic captures, not normal
runtime config-space detection.
Physical Layer
Two details matter even without PHY-level instrumentation:
LTSSM (Link Training and Status State Machine):
- States: Detect → Polling → Configuration → L0 (operational)
→ L0s, L1, L2 (low-power) → Recovery → Hot Reset → Disabled → Loopback
- Observable via Link Status Register and root-port performance counters
Detection-relevant:
- Negotiated Link Width (Link Status[9:4]):
Compare with slot wiring, platform policy, signal quality, and matched donor
deployments; devices can legitimately train below maximum width
- Current Link Speed (Link Status[3:0]):
A lower negotiated generation is contextual, not a contradiction by itself
- Recovery cycle frequency:
Comparative signal; materially different from donor reference is anomalous
ASPM (Active State Power Management):
- L0s and L1 are link-level low-power states
- Capability does not imply the platform enabled ASPM; evaluate transitions only
under verified policy and workload conditions that should exercise them
Configuration Access Mechanisms
Two mechanisms on x86:
CAM (Legacy I/O-port path):
1. CPU writes to I/O port 0xCF8 (Bus:Device:Function:Register)
2. CPU reads/writes at I/O port 0xCFC
- Reaches only first 256 bytes
- Still used during early BIOS/UEFI boot
ECAM (Enhanced, MMIO path):
1. Read MCFG ACPI table for segment base addresses
2. Compute: addr = base + ((bus << 20) | (dev << 15) | (func << 12) | offset)
3. OS maps physical address into kernel virtual memory
- Required for Extended Configuration Space (0x100–0xFFF)
- Where AER, DSN, LTR, VSEC, ATS, PASID, SR-IOV live
On Windows, supported paths are:
- IRP_MN_READ_CONFIG / IRP_MN_WRITE_CONFIG
- BUS_INTERFACE_STANDARD.GetBusData / SetBusData
Use documented bus interfaces within the caller's permitted ownership scope.
Direct MCFG mapping is not a supported substitute for the Windows PCI stack;
OS ownership of headers and capabilities still applies.
PCIe Configuration Space
Legacy 256-Byte Header (Type 0 Endpoint)
Offset Field Notes
0x00 Vendor ID (2B) Chip manufacturer (e.g., 0x8086 Intel)
0x02 Device ID (2B) Specific product
0x04 Command (2B) BME (bit 2), MemSpace (bit 1), IOSpace (bit 0)
0x06 Status (2B) Capabilities List (bit 4)
0x08 Revision ID + Class Code Class triplet: Base / Sub / ProgIF
0x0C Cache Line / Latency / Header Type 0x00 = endpoint,
Header Type / BIST 0x01 = bridge, 0x80 = multi-function
0x10–27 BAR0–BAR5 Memory or I/O windows
0x2C Subsystem Vendor ID Often distinguishes board manufacturers
0x2E Subsystem Device ID
0x30–33 Expansion ROM Base
0x34 Capabilities Pointer Offset of first capability in linked list
0x3C IRQ Line/Pin/Min/Max Legacy INTx routing
BAR encoding (32-bit BAR):
bit 0: 0 = Memory BAR, 1 = I/O BAR
bits 2:1: 00 = 32-bit, 10 = 64-bit (BAR pair)
bit 3: Prefetchable
BAR sizing belongs to platform enumeration and resource management.
For a collector, compare OS-reported resources with the exact device contract;
do not rewrite a live device's BARs. A size discrepancy requires context about
the device revision, active function, firmware, and collection method.
Capabilities Chain
If Status[4] is set, 0x34 points to the first capability.
Each capability has a 2-byte header: [ID | Next].
Next is DWord-aligned in 0x40–0xFF, or 0x00 to terminate.
Common capability IDs:
ID Capability
0x01 PCI Power Management
0x05 MSI
0x10 PCI Express
0x11 MSI-X
0x12 SATA Configuration
0x13 PCI Advanced Features
0x14 Enhanced Allocation
Detection: walk the chain, validate each capability's declared size
doesn't overlap the next, Next is DWord-aligned and within bounds,
no cycle exists. A malformed chain is itself a signal.
PCIe Express Capability (ID 0x10)
The single most important capability for spoofing detection.
Offset Field Notes
+0x02 PCIe Capabilities Cap Version, Device/Port Type, Slot Impl
+0x04 Device Capabilities MPS Supported, FLR, Phantom Functions
+0x08 Device Control MPS current, MRRS, Error Enables
+0x0A Device Status CED, NFED, FED, URD, Transactions Pending
+0x0C Link Capabilities Max Link Speed/Width, ASPM, L0s/L1 latencies
+0x10 Link Control ASPM Control, RCB, Link Disable, Retrain
+0x12 Link Status Current Link Speed/Width, Link Training
+0x24 Device Capabilities 2 Completion Timeout Ranges, AtomicOp,
OBFF, LTR mechanism
+0x28 Device Control 2 Completion Timeout Value, AtomicOp, LTR Enable
+0x2C Link Capabilities 2 Supported Link Speeds Vector
+0x30 Link Control 2 Target Link Speed, Compliance
+0x32 Link Status 2 De-emphasis, EQ Phase status
Detection leverage per field:
- Device Type (+0x02[7:4]): must match donor's role
- MPS Supported (+0x04[2:0]): hard-IP ceiling contradicts donor
- FLR support (+0x04[28]): verify FLR changes same sticky/non-sticky
state as claimed donor; naive firmware acknowledges FLR but continues
unchanged, producing state inconsistent with donor-defined reset semantics
- Link Status (+0x12): Width/Speed are negotiated, observable, hard to
lie about — hard IP reports what LTSSM actually achieved
- Slot Clock Config (+0x12[12]): must match real platform behavior
- Completion Timeout ranges (+0x24): selecting outside claimed ranges
is a discriminator
- AtomicOp (+0x24[6-9]): server-class GPUs/NICs may support; FPGA
support depends on IP generation and configuration; compare advertised and
exercised behavior with the claimed donor
MSI and MSI-X Capabilities
MSI (ID 0x05):
Message Control bits:
[0] MSI Enable
[3:1] Multiple Message Capable (0–5, representing 1–32 vectors)
[6:4] Multiple Message Enable (cannot exceed Capable)
[7] 64-bit Address Capable
[8] Per-Vector Masking Capable
x86 MSI Address: bits [31:20] fixed at 0xFEE (LAPIC prefix)
[19:12] Destination ID, [3] Redirection Hint, [2] Destination Mode
Message Data: [15] Trigger Mode, [10:8] Delivery Mode, [7:0] Vector
MSI-X (ID 0x11):
- Supports up to 2,048 vectors
- Table stored in BAR-mapped region (not Config Space)
- Each entry: 16 bytes (Addr Low, Addr High, Data, Vector Control)
- PBA (Pending Bit Array): bit-per-vector pending state
Naive MSI-X emulation failures:
- Ignores Vector Control Mask writes
- Sets PBA bits but never clears on unmask
- Returns hardcoded PBA values
- Doesn't retire pending interrupts when masks clear
Detection probe: mask vector → induce interrupt condition →
observe PBA bit → unmask → observe interrupt firing.
A conforming implementation should satisfy the relevant MSI-X semantics;
incomplete emulations may fail, while sophisticated emulations can pass.
AER Extended Capability (ID 0x0001)
Three error classes:
- Correctable: Receiver Error, Bad TLP, Bad DLLP, Replay Timer Timeout
- Uncorrectable Non-Fatal: Completion Timeout, Completer Abort, UR, ACS Violation
- Uncorrectable Fatal: Malformed TLP, DLL Protocol Error, Surprise Down
Each has Status (sticky, W1C), Mask, and Severity registers.
Header Log (16B) captures full TLP header of first logged uncorrectable error.
Detection:
- Absence of AER when donor model is known to expose it = mismatch
- Zero correctable-error count over long window when donor's silicon
normally produces a baseline rate = anomalous
- Anomalous UR response patterns to probes of unimplemented offsets
Extended Capabilities
4-byte header at each offset:
[31:20] Next Capability Offset (0 to terminate)
[19:16] Capability Version
[15:0] Extended Capability ID
Key Extended Capability IDs:
0x0001 AER
0x0002 Virtual Channel (VC)
0x0003 DSN (Device Serial Number, 8 bytes)
0x000B Vendor-Specific Extended Capability (VSEC)
0x000D ACS (Access Control Services)
0x000E ARI
0x000F ATS (Address Translation Services)
0x0010 SR-IOV
0x0015 Resizable BAR (RBAR)
0x0018 LTR (Latency Tolerance Reporting)
0x001B PASID
0x001D DPC (Downstream Port Containment)
0x001E L1 PM Substates
0x001F Precision Time Measurement (PTM)
Detection-relevant:
- DSN: 8-byte unique serial; donor-cloned firmware can collide
with another player's identical card
- VSEC: Xilinx PCIe IP optionally emits VSEC blocks with
characteristic Vendor ID + VSEC ID combinations
- ATS/PASID/SR-IOV presence on consumer-class donor is
demographically suspicious — rare outside server-class hardware
IOMMU Architecture
Translation Flow
1. Device issues Memory TLP with target IOVA.
TLP header carries 16-bit Requester ID (BDF).
2. TLP travels upstream through switches/bridges to root complex.
3. IOMMU intercepts, uses Requester ID to look up translation context.
4. IOMMU walks device's I/O page tables: IOVA → physical address.
5. Permission bits (Read, Write) checked against access type.
6. Success: TLP forwarded with translated physical address.
7. Failure: fault logged, device receives UR or CA completion.
Intel VT-d Internals
Two-level table lookup:
BDF → Root Table (256 entries, 16B each, indexed by Bus)
→ Context Table (256 entries, 16B each, indexed by Dev:Func)
→ Second-Level Page Tables (3–5 levels)
→ Final 4 KB physical page
Context Entry fields:
- SLPTPTR: Second-Level Page Table Pointer
- Domain ID: 16-bit (multiple devices can share a domain)
- AW: Address Width (3/4/5-level = 39/48/57-bit IOVA)
- T: Translation Type (untranslated-only, translated-only, or both)
- P: Present
- FPD: Fault Processing Disable
Page table entries (PTE, EPT-like format):
[0] R - Read permission
[1] W - Write permission
[7] PS - Page Size (1=leaf super-page, 0=next-level table)
[N-1:12] Physical address of next-level table or 4 KB page
Super-pages: level-2 leaf = 2 MB, level-3 leaf = 1 GB.
Scalable Mode (VT-d 3.0+):
Context Entry → PASID Directory → PASID Table → per-PASID
first-level page-table roots. Enables Shared Virtual Memory (SVM).
Check RTADDR_REG.TTM to determine which mode is in effect.
AMD-Vi Internals
Single-level Device Table indexed directly by BDF:
BDF → Device Table Entry (32 bytes)
→ I/O Page Tables (1–6 levels)
→ Final page
DTE encodes:
- Page Table Root Pointer
- Mode (0–6, selects paging levels)
- Domain ID (16 bits)
- IR, IW — Default Read/Write permission
- GV — Guest Valid (nested translation)
- PASID-related fields
Page sizes: 4 KB, 2 MB, 1 GB.
IOTLB and Invalidation
Translations cached in IOTLB (I/O Translation Lookaside Buffer).
When mappings change, IOTLB must be invalidated.
Two distinct caches when ATS is in use:
- IOMMU's own IOTLB
- Device-side TLB (DevTLB) caching prior translations
Full invalidation with ATS requires:
1. IOMMU invalidates own IOTLB
2. IOMMU sends ATS Invalidate Request Message to device
3. Device drops affected DevTLB entries, replies with Invalidate Completion
If step 2 or 3 is skipped, device retains stale translations
and can DMA to unmapped addresses.
VT-d invalidation granularities:
- Global: flush entire IOTLB
- Domain-Selective: flush all entries for a Domain ID
- Page-Selective: flush specific IOVA range in a domain
Strict vs lazy invalidation:
Lazy mode defers IOTLB invalidation, batching them for performance.
Opens a window where stale translations remain valid — a device
whose driver has unmapped a buffer can still DMA to the old IOVA.
Fault Recording
VT-d: Fault Recording Registers — circular array capturing
Requester ID, faulting IOVA, fault reason, TLP type.
AMD-Vi: Event Log Buffer — producer-consumer ring buffer of
IO_PAGE_FAULT, INVALID_DEVICE_REQUEST, ATS-related events.
Both surface faults via interrupts and event-log entries.
On Windows, some IOMMU violations observable through WHEA/bug-check
paths and Driver Verifier DMA-violation telemetry.
Per-device fault rate is one of the most operationally useful
IOMMU-layer signals, but its baseline is platform-, device-, driver-, firmware-,
and workload-specific. Sustained faults show failed or invalid DMA requests;
driver bugs, resets, stale mappings, or hardware faults must be excluded before
attributing malicious out-of-domain access.
RMRR/IVMD:
ACPI DMAR table contains RMRR (Reserved Memory Region Reporting)
sub-tables declaring physical ranges devices need identity-mapped.
AMD-Vi has analogous IVMD (I/O Virtualization Memory Definition)
in the IVRS table. A defender should enumerate these and reject
configurations where suspect BDFs appear in RMRR scope or
RMRR ranges overlap game memory regions.
IOMMU Topology and Isolation
IOMMU Groups
Devices in the same IOMMU group may not be safely isolated from
one another. Group membership determined by:
- PCIe topology — devices behind a switch share a group
unless the switch supports and enables ACS
- ACS state of upstream bridges
- Quirks for known-broken hardware
Linux: /sys/kernel/iommu_groups/N/devices/
Windows: equivalent constraints but no simple public group filesystem
ACS (Access Control Services, Extended Cap ID 0x000D)
ACS is a PCIe capability that switches/root ports advertise
to declare they can enforce isolation between downstream ports.
ACS Capability register enable bits:
Bit Feature Effect
0 Source Validation (SV) Drop TLPs with wrong Requester ID
1 Translation Blocking (TB) Block AT=10 (Translated) TLPs
2 P2P Request Redirect (RR) Force P2P requests upstream for IOMMU
3 P2P Completion Redirect (CR) Force P2P completions upstream
4 Upstream Forwarding (UF) Forward upstream regardless
5 P2P Egress Control (EC) Allow/deny P2P routing per-port
6 Direct Translated P2P (DT) Allow P2P with translated addresses
Critical for untrusted endpoints: SV, TB, RR, and CR.
A switch missing Source Validation lets a malicious device spoof
its Requester ID, defeating per-BDF IOMMU translation.
A switch missing P2P Request Redirect allows devices on the same
switch to DMA directly to each other without IOMMU involvement.
Peer-to-Peer DMA
Devices on the same PCIe tree can send Memory TLPs directly to
each other's BAR ranges without involving system memory.
Without ACS redirection, peer traffic may remain below the root complex and
bypass the host IOMMU translation path. Routing behavior is topology- and
platform-specific, so confirm it with the actual root complex and switches.
Plausible P2P DMA targets for cheat:
- GPU framebuffer — rendered game state
- Network adapter ring buffers — game traffic
- USB controller queues — input device data
Mitigation: ACS Translation Blocking + P2P Request Redirect
on every intermediate bridge. Defender must walk topology and
confirm both bits are active.
Interrupt Remapping
MSI/MSI-X interrupts are Memory Writes to 0xFEE00000–0xFEEFFFFF.
Without Interrupt Remapping (IR), any device with Bus Master enabled
can write to this range and trigger arbitrary interrupts — NMIs, SMIs,
or vectors targeting wrong CPU.
With IR enabled, IOMMU validates MSI/MSI-X writes and uses
remapping-table state to determine permitted destination.
IR is part of VT-d's broader DMA Remapping architecture.
Both VT-d and AMD-Vi have integrated equivalents.
Both should be mandatory in any anti-cheat threat model.
ATS, PASID, and Address Translation Trust
ATS (Address Translation Services, Extended Cap ID 0x000F)
ATS lets a device cache IOMMU translations locally:
1. Device issues Translation Request TLP (AT=01) with IOVA
2. IOMMU translates and responds with Translation Completion
carrying physical address
3. Device caches translation in Device-side TLB (DevTLB)
4. Subsequent accesses issued with AT=10 (Translated) —
IOMMU bypasses page-walk, trusting device's cached translation
5. On mapping changes, IOMMU sends Invalidation Request
Attack surface: malicious device claiming ATS can present
arbitrary AT=10 TLPs whose addresses were never approved
by the IOMMU. The IOMMU forwards them trusting the device's claim.
PASID (Extended Cap ID 0x001B)
Extends ATS to per-process address spaces. 20-bit PASID carried
in a TLP Prefix. IOMMU uses (Requester ID, PASID) jointly
to select translation context.
PASID enables Shared Virtual Memory (SVM) — primarily found in
datacenter NICs, AI accelerators. Presence on a consumer card
is anomalous.
ATS Trust Model and "ATS Untrusted" Mode
The fundamental trust assumption: device honestly reports
translations it has been granted. Unreasonable for external
Thunderbolt enclosures, FPGAs in M.2 slots, or untrusted
accelerator cards.
Modern OS/IOMMU stacks can treat endpoints as ATS-untrusted:
ATS is disabled, blocked by policy, or stripped.
Linux: pci=noats plus per-device quirks.
Windows: Kernel DMA Protection / DMAGuard matters, but don't
treat "Kernel DMA Protection: On" as proof every internal
endpoint is ATS-untrusted. Verify ATS state per endpoint.
Driver–IOMMU Contract and Bypass Catalog
Legitimate DMA Path (Windows)
1. Acquire DMA adapter: IoGetDmaAdapter / WDF wrapper
2. Allocate buffer: MmAllocateContiguousMemorySpecifyCacheNode
or WdfCommonBufferCreate
3. Map for DMA: AllocateCommonBuffer / MapTransferEx
- OS allocates IOVA from device's domain
- Creates IOMMU page-table entries: [IOVA, IOVA+size) → physical pages
- Returns IOVA to driver
4. Program device: driver writes IOVA into device's BAR registers
5. Device DMAs: TLPs arrive at IOMMU with BDF + IOVA
6. IOMMU translates: page-walk produces physical address
7. Completion and unmap: teardown IOMMU entries + IOTLB invalidation
In this model, device can DMA only to addresses the driver
explicitly mapped. Game memory is not in that range.
Six Paths to Out-of-Domain Access
1. IOMMU not active or not applied to this path
VT-d/AMD-Vi disabled, OS not enforcing, device outside protected ports
2. Pre-boot DMA injection
Inject before IOMMU initialized; requires firmware-level exploit
3. Identity-mapped / passthrough domains
Legacy drivers request 1:1 mapping; modern strict-mode rejects it
4. Driver mapping over-allocation (Thunderclap class)
OS maps full 4 KB page when buffer is smaller; adjacent kernel data exposed
5. Legitimate-path data exfiltration
Cheat spoofed as NIC; OS network stack passes game packets through
NIC's RX ring buffer (legitimately IOMMU-mapped). Cheat reads game data
without leaving allowed mappings. Undetectable at IOMMU layer.
6. IOMMU page-table manipulation via kernel compromise
BYOVD / vulnerable driver reprograms IOMMU tables.
Requires code execution on gaming PC.
Approaches 1–3 are the foundation of most current DMA cheats.
IOMMU Bypass Catalog (16 Techniques)
# Technique Mechanism Mitigation
─────────────────────────────────────────────────────────────────────────────────
1 IOMMU disabled VT-d/AMD-Vi off in BIOS Refuse misconfigured platforms
2 Pre-boot DMA Firmware leaves injection window UEFI updates; verify ACPI indicators
3 Identity/passthrough 1:1 IOVA-to-physical mapping Strict-mode IOMMU policy
4 Driver over-allocation Full 4 KB page, adjacent data OS bounce buffers; strict mappings
5 ATS abuse AT=10 TLPs with arbitrary addrs ATS Untrusted mode for non-allowlisted
6 ACS missing on bridge P2P or spoofed Requester ID Verify ACS state on all bridges
7 Lazy IOTLB invalidation Stale translations valid briefly Strict invalidation mode
8 FLR race FLR/Hot Reset race window Synchronized FLR handling
9 SMM bypass SMM code exempt from IOMMU Boot Guard / Platform Secure Boot
10 DMA-remapping driver bugs Bugs in OS IOMMU manager OS patching
11 Hypervisor trust failure Compromised hypervisor Platform remediation; boot evidence is not runtime proof
12 Interrupt injection (no IR) Write arbitrary interrupts Mandatory IR enforcement
13 RMRR/IVMD scope abuse Fake ACPI tables cover attacker Measured boot; runtime RMRR audit
physical ranges
14 Snoop-bit manipulation Stale cache lines visible Strict snoop enforcement
15 PASID confusion Misconfigured PASID Table PASID-aware IOMMU programming
16 DMAR/IVRS spoofing Compromised firmware, fake tables Measured boot covering firmware
Techniques 1–6: active attack surface for current commercial DMA cheats
Techniques 7–13: academic, APT, firmware-level contexts
Techniques 14–16: largely theoretical
FPGA Hardware
Xilinx PCIe Integrated Block
Hardened IP block handling:
- Physical Layer (PHY, 8b/10b or 128b/130b, LTSSM, equalization)
- Data Link Layer (sequence numbers, replay buffer, flow control)
- Transaction Layer framing and parsing
- Subset of Configuration Space
IP core documentation:
- PG054 for 7-series
- PG156 for UltraScale Gen3
- PG213 for UltraScale+ Gen4
User logic interfaces over AXI-Stream (TX/RX) and separate
config management: cfg_mgmt_* (7-series), cfg_ext_* (UltraScale).
Detection consequences:
- Default fingerprints leak through: hard block populates Config Space
with Xilinx-characteristic byte patterns
- 7-series firmware authors who don't understand cfg_mgmt_* leave
subtle behavioral differences (some CfgTLPs return hard-block defaults)
FPGA Family Hierarchy
Artix-7 (consumer/mid-range, GTP transceivers, PCIe Gen2):
Chip LUTs BRAM(Kbit) PCIe Hard Block
XC7A35T 20,800 1,800 Gen2 x4
XC7A50T 32,600 2,700 Gen2 x4
XC7A75T 46,200 3,780 Gen2 x4
XC7A100T 63,400 4,860 Gen2 x4
XC7A200T 134,600 13,140 Gen2 x4
(Smaller than T35 have no hard PCIe block)
Kintex-7 (high-end, GTX transceivers):
XC7K70T 41,000 4,860 Gen2 x8
XC7K160T 101,400 11,700 Gen2 x8
XC7K325T 203,800 16,020 Gen2 x8 / Gen3 x4
XC7K410T 254,200 28,620 Gen3 x8
Zynq UltraScale+ (ARM Cortex-A53 cores, GTH/GTY):
ZU2EG/CG ~47,000 ~5.3M Gen3 x4
ZU3EG/CG ~70,000 ~7.6M Gen3 x4
ZU4EG/EV ~88,000 ~11.0M Gen3 x8
ZU5EG/EV ~117,000 ~18.0M Gen3 x8
ZU6EG/CG ~230,000 ~32.1M Gen3 x16
(EV-suffixed: hardened H.265 codec for DMA + video-capture boards)
Resource Constraints and Capability
BRAM size caps:
shadow config + writable overlay + BAR emulation + state machines.
T35 (1.8 Mbit) struggles with full 4 KB shadow + 64 KB BAR + jitter buffers.
T100 (4.86 Mbit) fits comfortably.
Zynq ZU3 (7+ Mbit) has effectively unlimited room.
LUT count caps behavioral complexity:
Each subsystem (MSI generator, ASPM FSM, AER counter, BAR responder)
costs thousands of LUTs. T35 holds 1–2; T100 the full set;
Kintex/Zynq adds runtime-reconfigurable parameter tables.
PHY transceiver family (GTP/GTX/GTH/GTY) has measurably different
signal characteristics; can sometimes be inferred from root-port
performance counters independent of firmware spoofing.
Form Factors
Form Factor Description Detection
────────────────────────────────────────────────────────────────────
M.2 NGFF Key M Internal NVMe slot Dominant modern form;
physical inspection needed
M.2 + USB3 bridge M.2 board with FT601 Gaming PC sees only M.2
PCIe x1/x4 add-in Traditional add-in card More physically visible
External USB3 USB3-to-PCIe (legacy) Mostly obsolete
Combo boards DMA + HDMI capture + Complex device tree;
input injection HDMI activity is fingerprint
M.2 slot populations are partially auditable from software through
PCI topology, ACPI, SMBIOS, storage inventory, and vendor board databases.
SMBIOS slot records are often incomplete for M.2, so detection should
be probabilistic and board-model-aware.
pcileech Framework
Project Lineage
Five upstream repositories:
- pcileech: Host-side C application with attack modules
- pcileech-fpga: FPGA firmware in Verilog/SystemVerilog, per-board variants
- MemProcFS: Virtual filesystem mounting target memory as /proc-like tree
- LeechCore: Low-level device abstraction library
- vmm: Memory analysis engine (vmm.dll API)
Pipeline: FPGA → LeechCore → PCILeech attack modules / MemProcFS analysis
FPGA Firmware Architecture
Key modules:
- pcileech_pcie_a7.v / _us.v: Top-level Artix-7 / UltraScale integration
- pcileech_pcie_tlps128_bram_rdwr.v: 128-bit TLP source/sink (AXI-Stream)
- pcileech_pcie_cfgspace_shadow.v: Shadow config space in BRAM
- pcileech_cfgspace.coe: Init data (stock: Xilinx 10EE:0666)
- pcileech_bar_impl_zerowrite4k.v: Default BAR — absorbs writes, returns zero
- pcileech_bar_impl_loopaddr.v: Alternative BAR — echoes address
- pcileech_bar_impl_none.v: Disables BAR (returns UR)
- pcileech_pcie_cfg_a7.v: Config management via cfg_mgmt_*
- pcileech_mux.v: TLP multiplexer
- pcileech_fifo.v: Internal staging FIFO
Two key architectural choices:
1. Shadow config is spoofable but not spoofed by default.
.coe ships with placeholder Xilinx IDs. User must overwrite
with real donor's dump and resynthesize.
2. BAR controller is functionally inert.
zerowrite4k doesn't emulate device behavior.
Active BAR probing catches stock builds in one operation.
Host-Side MemProcFS
Mounts target memory as filesystem:
M:\
├── pid\1234\
│ ├── name.txt
│ ├── modules\ ← loaded module list
│ ├── handles\
│ ├── vad\ ← virtual address descriptors
│ ├── memmap.txt
│ └── minidump\
├── sys\
├── name\game.exe\ ← lookup by process name
└── forensic\
├── yara\
├── timeline\
└── registry\
One possible development/use pattern:
1. Development phase: MemProcFS, signature search, cross-references
→ slow, broad scanning to find entity manager / player array / view matrix
2. Execution phase: custom app via vmm.dll/LeechCore,
narrower periodic or batched reads of known offsets
Behavioral analysis can test for this pattern, but implementations may cache,
randomize, or use different access strategies.
Stock Firmware Fingerprints
Common or older vanilla pcileech-fpga configurations may exhibit the following;
verify the exact commit, FPGA IP configuration, and synthesized design:
- VID/DID 10EE:0666 (Xilinx placeholder)
- Xilinx 7-series PCIe IP signature bytes at characteristic offsets
- DSN Extended Capability absent or default
- No AER, LTR, ARI, ATS, or SR-IOV capabilities
- BAR0 mapped (DMA window); BAR1–5 disabled or all-ones
- BAR reads return zero (zerowrite4k) or echo address (loopaddr)
- MSI capability present but expected interrupts are not generated
- Config reads complete in deterministically uniform time
(BRAM lookup with fixed pipeline depth, near-zero variance)
- no observed ASPM transitions under a workload and policy that should enter
lower-power states
- AER correctable-error count stays at zero
- power state remains D0 under tested conditions
- Class Code matches donor placeholder but no class-specific behavior
Configuration Space Spoofing
Bridge vs Emulated Firmware
Bridge firmware:
Patches identity fields via Vivado's PCIe IP Core GUI
(VID, DID, Subsystem IDs, Class Code, sometimes DSN).
Fast to produce, but 7-series hard IP generates internal capability
blocks at characteristic offsets that retain FPGA-specific fingerprints.
Emulated (1:1) firmware:
Implements complete shadow Configuration Space in BRAM.
Entire 4 KB extended config space initialized from real donor device hex dump.
When OS issues CfgRd TLP, firmware responds from BRAM.
The design attempts to prevent IP-core defaults from appearing on the bus.
Common bugs in emulated firmware:
- First 16 bytes still come from IP block (mux priority)
- Type 1 config reads not intercepted
- Capability blocks bypassed in GUI still leak defaults
Shadow Configuration Space Implementation
Requirements:
1. Intercept incoming CfgRd0/CfgWr0 TLPs
2. Decode target offset
3. Look up value in BRAM
4. Build Completion TLP with correct Completer ID, status, payload
5. Send Completion through hard IP block
4 KB coverage at 4
…(truncated)
1---
2name: dma-attack-techniques
3description: Classify hardware DMA threats, host-driver memory acquisition and network or USB transport in game-security research. Use for PCIe/FPGA, IOMMU/VT-d, Thunderbolt/USB4, LeechCore, WinPmem, bridge-cable claims, device identity and acquisition forensics; select repository resources for architecture, remapping concepts and existing images. Identify the memory initiator and required access, then map observable artifacts, mitigation scope, benign uses and unresolved architecture claims.
4metadata:
5 source: https://skillmd.com/skills/gmh5225/dma-attack-techniques
6---
7
8# DMA Attack Techniques
9
10## Overview
11
12This skill covers DMA threat models, device isolation, and physical-memory acquisition evidence. It separates the component that accesses memory from the transport, analysis software, and optional input path. Classify capabilities and protection boundaries before reasoning about a particular device or product.
13
14## Classify the Acquisition Path First
15
16For USB transfer cables, two-computer setups, LeechCore, or WinPmem, read
17[Memory acquisition and transport](references/acquisition-and-transport.md).
18Use it to distinguish hardware bus access from host-mediated software capture
19and to evaluate US516/90212 implementation claims against primary sources.
20
21- Identify the memory source: PCIe requester, host kernel component, hypervisor
22 interface, or offline image. A library name or second computer does not settle it.
23- Record source access requirements, transport endpoints, analysis location,
24 write capability, and input functionality separately; leave unknowns explicit.
25- Map controls to the actual boundary: device DMA remapping, driver/interface
26 security, authenticated transport, or server-side information exposure.
27- Report available artifacts, benign uses, missing visibility, and confidence.
28 A clean process module list or absent FPGA is not a clean-host finding.
29
30Use [research-rigor](../research-rigor/SKILL.md) for disputed implementation,
31performance, compatibility, or detectability claims. This classification does
32not establish that a particular commercial setup uses the components it advertises.
33
34For certainty claims about firmware classes, EPT, HVCI, containment, or TPM
35proof, read [assurance boundaries](references/assurance-boundaries.md). It
36separates mechanism, deployed policy, evidence coverage, and attribution.
37
38## README Coverage
39
40- `Cheat > DMA`
41- `Anti Cheat > Detection:DMA`
42- `Anti Cheat > Detection: Hacked Hypervisor`
43- `Anti Cheat > Detection:Virtual Environments`
44- `Anti Cheat > Detection:HWID`
45- `Windows Security Features`
46
47## Threat Model
48
49### External DMA Cheat Architecture
50```
51A modern external DMA cheat consists of three components:
52
531. Cheat PC — runs the cheat application, signature databases,
54 aim assistance, ESP rendering, and a network/USB link to the gaming PC.
55
562. DMA Card — an FPGA-based PCIe endpoint installed in the gaming PC
57 (typically M.2 NVMe slot). Exposes a memory-read/write interface to
58 the cheat PC. Uses Bus Master capability to issue Memory Read TLPs
59 against the gaming PC's RAM.
60
613. Actuator (optional) — a USB HID emulator (microcontroller-based) that
62 injects keyboard/mouse input on the gaming PC according to commands
63 from the cheat PC, closing the loop.
64
65This hardware-only model need not use a host memory-acquisition process.
66The device initiates memory transactions subject to platform routing and
67IOMMU mappings. Host agents and mixed hardware/software designs are separate
68cases. Visibility depends on the observer and platform; device presence,
69configuration, policy state, and available fault telemetry are different
70observations, none of which alone establishes malicious intent.
71```
72
73### Three Defense Layers
74
75| Layer | Property evaluated | Limits |
76|---|---|---|
77| PCIe identity and behavior | Consistency with an identified device and matched baseline | A mismatch needs version, topology, driver, workload, and benign-device context; an identifier is not proof of intent |
78| IOMMU enforcement | Device requests permitted by the active remapping policy | Verify actual path, mappings, lifecycle, and available fault evidence; enforcement and observation are separate |
79| External attestation | Authenticity and policy appraisal of selected measurements | Boot evidence does not automatically cover current device behavior or runtime mapping state |
80
81Use the [assurance reference](references/assurance-boundaries.md) for the
82underlying platform contracts and the evidence required at each layer.
83
84## PCIe Protocol Stack
85
86### Three Protocol Layers
87```
88Layer Unit Function
89────────────────────────────────────────────────────────────────
90Transaction TLP Memory/IO/Config reads & writes,
91 completions, messages
92Data Link DLLP Acknowledgements, flow control
93 credits, power management
94Physical Ordered Sets Link training, equalization,
95 clock recovery
96
97A real device's behavior is shaped by all three layers.
98Many FPGA designs primarily customize Transaction-Layer behavior; Physical and
99Data Link behavior may retain implementation fingerprints unless the selected
100IP, configuration, and surrounding behavior closely match the claimed device.
101Whether a fingerprint is usable must be validated on the actual link.
102```
103
104### TLP (Transaction Layer Packet) Format
105```
106Every TLP contains a 3 DW (12-byte) or 4 DW (16-byte) base header; optional
107TLP Prefixes may precede it. 4 DW headers are used for 64-bit addresses and
108certain message types.
109
110First DWord (DW0) encoding:
111Bits Field Notes
112[31:29] Fmt[2:0] Header format + data presence
113[28:24] Type[4:0] TLP type (combined with Fmt)
114[22:20] TC[2:0] Traffic Class (default 0)
115[18] Attr[2] ID-Based Ordering (IDO)
116[15] TD TLP Digest (ECRC trailer)
117[14] EP Poisoned data
118[13:12] Attr[1:0] Relaxed Ordering, No Snoop
119[11:10] AT[1:0] Address Type (critical for ATS bypass)
120[9:0] Length[9:0] Payload length in DWords (0x000 = 1024 DW = 4 KB)
121
122Fmt[2:0] encoding:
123000 = 3 DW header, no data
124001 = 4 DW header, no data
125010 = 3 DW header, with data
126011 = 4 DW header, with data
127100 = TLP Prefix
128
129Key TLP types (Fmt + Type combinations):
130Fmt Type TLP
131000 0_0000 MRd (Memory Read, 3DW / 32-bit addr)
132001 0_0000 MRd (Memory Read, 4DW / 64-bit addr)
133010 0_0000 MWr (Memory Write, 3DW)
134011 0_0000 MWr (Memory Write, 4DW)
135000 0_0100 CfgRd0 (Config read — terminate at this device)
136010 0_0100 CfgWr0
137000 0_0101 CfgRd1 (Config read — forwarded by bridges)
138010 0_0101 CfgWr1
139000 0_1010 Cpl (Completion without data)
140010 0_1010 CplD (Completion with data)
141001 1_0rrr Msg (Message, no data)
142011 1_0rrr MsgD (Message with data)
143```
144
145### Detection-Relevant DW0 Fields
146```
147TC[2:0] — Traffic Class. Default traffic commonly uses TC0, but non-zero TC is
148valid when platform and device policy configure it. Compare usage with the
149claimed device, driver, and workload rather than flagging it in isolation.
150
151Attr[2:0] — RO/NS/IDO. A device emulating a NIC must follow that NIC's
152typical NS/RO usage pattern; mismatches are visible.
153
154AT[1:0] — Address Type:
155 00 = Untranslated (IOMMU will translate)
156 01 = Translation Request (ATS only)
157 10 = Translated (device claims it has already translated via ATS)
158This field is the basis of ATS bypass attacks.
159
160TD — TLP Digest. If set, an ECRC trailer is present.
161EP — Poisoned. Indicates data is known-bad.
162```
163
164### TLP Routing and Requester ID
165```
166Three routing modes:
167- Address routing — Memory and IO TLPs, matched against bridge apertures
168- ID routing — Config TLPs and Completions, by BDF
169- Implicit routing — Some Messages (broadcast, terminate at root)
170
171DW1 carries the Requester ID (16 bits = Bus:Device:Function, "BDF")
172and an 8-bit Tag for matching completions to requests.
173
174Requester ID is a key input to IOMMU lookup, ACS source validation, AER source
175identification, and interrupt-remapping policy. If spoofed IDs are accepted
176without topology or source validation, per-function isolation can be
177undermined; the exact effect depends on the platform and remapping path.
178
179Transaction categories:
180- Posted (P) — fire-and-forget (Memory Writes, Messages)
181- Non-Posted (NP) — requires completion (Memory Reads, IO/Config R/W)
182- Completion (Cpl/CplD) — response to Non-Posted requests
183
184Completion Status codes:
185000 = Successful Completion (SC)
186001 = Unsupported Request (UR)
187010 = Configuration Request Retry Status (CRS)
188100 = Completer Abort (CA)
189
190UR vs CA distinction matters for spoofing detection — real silicon
191responds differently to malformed config accesses vs accesses to
192unimplemented offsets. Many spoofed firmwares hard-code one or the other.
193```
194
195### Memory Read Completion Splitting
196```
197A single Memory Read TLP returns up to Max_Read_Request_Size (MRRS) bytes.
198The completer splits the payload at any boundary >= RCB
199(Read Completion Boundary, 64 or 128 bytes).
200Each fragment cannot exceed Max_Payload_Size (MPS).
201
202Each Completion carries:
203- Lower Address[6:0] — lowest 7 bits of first byte address
204- Byte Count[11:0] — bytes remaining (last fragment's Byte Count
205 equals its own payload length)
206- BCM — PCI-X compatibility (typically 0)
207- Tag — matches originating MRd's Tag
208
209The split pattern (fragment count, boundary positions) is a
210strong fingerprint: real memory controllers produce characteristic
211distributions of fragment sizes and inter-fragment gaps.
212BRAM-backed emulators producing perfectly uniform 64-byte fragments
213at constant cadence are anomalous.
214```
215
216### Tag Space and Fingerprinting
217```
218- 5-bit Tag (original): 32 outstanding non-posted requests per Requester ID
219- Extended Tag (PCIe 1.1+, Device Control[8]): 8-bit / 256 outstanding
220- 10-Bit Tag (PCIe 4.0+, Device Control 2[12]): 1024 outstanding
221
222Tag turnover discipline — which tags get reissued and how quickly —
223reflects the device's internal request tracking pipeline.
224Firmware that issues reads with no tag turnover (same tag, or monotonic
225beyond negotiated limit) is observably distinct from real silicon.
226```
227
228### MPS and MRRS as Fingerprints
229```
230Record current MPS/MRRS configuration and the responsible platform software;
231do not infer the active values solely from advertised link capability.
232- Device Capabilities[2:0]: Max_Payload_Size_Supported
233 (0=128, 1=256, 2=512, 3=1024, 4=2048, 5=4096 bytes)
234- Device Control[7:5]: current MPS (must be <= Supported,
235 set to minimum of all devices in hierarchy)
236- Device Control[14:12]: Max_Read_Request_Size (same encoding)
237
238The discriminator is donor consistency: a device claiming a donor
239that is known to support larger payloads, different tag behavior,
240or a different negotiated profile should match that donor under
241the same root-port constraints.
242```
243
244### Data Link Layer
245```
246DLLPs provide reliable delivery between Physical and Transaction layers.
247
248DLLP Purpose
249─────────────────────────────────────────
250Ack TLP received correctly
251Nak TLP received with error; sender must replay
252InitFC1/2 Flow control credit initialization at link bring-up
253UpdateFC Ongoing flow control credit updates
254PM_* Power management (L0s, L1 entry/exit)
255Vendor Vendor-defined
256
257Flow control credits are per TLP category:
258- PH / PD — Posted Header / Data
259- NPH / NPD — Non-Posted Header / Data
260- CplH / CplD — Completion Header / Data
261
262Negotiated credit values are not generally exposed through standard
263Link Capabilities register. They are visible in protocol-level traces,
264some root-port/vendor performance counters, or FPGA-side debug.
265Useful for lab fingerprinting and forensic captures, not normal
266runtime config-space detection.
267```
268
269### Physical Layer
270```
271Two details matter even without PHY-level instrumentation:
272
273LTSSM (Link Training and Status State Machine):
274- States: Detect → Polling → Configuration → L0 (operational)
275 → L0s, L1, L2 (low-power) → Recovery → Hot Reset → Disabled → Loopback
276- Observable via Link Status Register and root-port performance counters
277
278Detection-relevant:
279- Negotiated Link Width (Link Status[9:4]):
280 Compare with slot wiring, platform policy, signal quality, and matched donor
281 deployments; devices can legitimately train below maximum width
282- Current Link Speed (Link Status[3:0]):
283 A lower negotiated generation is contextual, not a contradiction by itself
284- Recovery cycle frequency:
285 Comparative signal; materially different from donor reference is anomalous
286
287ASPM (Active State Power Management):
288- L0s and L1 are link-level low-power states
289- Capability does not imply the platform enabled ASPM; evaluate transitions only
290 under verified policy and workload conditions that should exercise them
291```
292
293### Configuration Access Mechanisms
294```
295Two mechanisms on x86:
296
297CAM (Legacy I/O-port path):
2981. CPU writes to I/O port 0xCF8 (Bus:Device:Function:Register)
2992. CPU reads/writes at I/O port 0xCFC
300- Reaches only first 256 bytes
301- Still used during early BIOS/UEFI boot
302
303ECAM (Enhanced, MMIO path):
3041. Read MCFG ACPI table for segment base addresses
3052. Compute: addr = base + ((bus << 20) | (dev << 15) | (func << 12) | offset)
3063. OS maps physical address into kernel virtual memory
307- Required for Extended Configuration Space (0x100–0xFFF)
308- Where AER, DSN, LTR, VSEC, ATS, PASID, SR-IOV live
309
310On Windows, supported paths are:
311- IRP_MN_READ_CONFIG / IRP_MN_WRITE_CONFIG
312- BUS_INTERFACE_STANDARD.GetBusData / SetBusData
313Use documented bus interfaces within the caller's permitted ownership scope.
314Direct MCFG mapping is not a supported substitute for the Windows PCI stack;
315OS ownership of headers and capabilities still applies.
316```
317
318## PCIe Configuration Space
319
320### Legacy 256-Byte Header (Type 0 Endpoint)
321```
322Offset Field Notes
3230x00 Vendor ID (2B) Chip manufacturer (e.g., 0x8086 Intel)
3240x02 Device ID (2B) Specific product
3250x04 Command (2B) BME (bit 2), MemSpace (bit 1), IOSpace (bit 0)
3260x06 Status (2B) Capabilities List (bit 4)
3270x08 Revision ID + Class Code Class triplet: Base / Sub / ProgIF
3280x0C Cache Line / Latency / Header Type 0x00 = endpoint,
329 Header Type / BIST 0x01 = bridge, 0x80 = multi-function
3300x10–27 BAR0–BAR5 Memory or I/O windows
3310x2C Subsystem Vendor ID Often distinguishes board manufacturers
3320x2E Subsystem Device ID
3330x30–33 Expansion ROM Base
3340x34 Capabilities Pointer Offset of first capability in linked list
3350x3C IRQ Line/Pin/Min/Max Legacy INTx routing
336
337BAR encoding (32-bit BAR):
338bit 0: 0 = Memory BAR, 1 = I/O BAR
339bits 2:1: 00 = 32-bit, 10 = 64-bit (BAR pair)
340bit 3: Prefetchable
341
342BAR sizing belongs to platform enumeration and resource management.
343For a collector, compare OS-reported resources with the exact device contract;
344do not rewrite a live device's BARs. A size discrepancy requires context about
345the device revision, active function, firmware, and collection method.
346```
347
348### Capabilities Chain
349```
350If Status[4] is set, 0x34 points to the first capability.
351Each capability has a 2-byte header: [ID | Next].
352Next is DWord-aligned in 0x40–0xFF, or 0x00 to terminate.
353
354Common capability IDs:
355ID Capability
3560x01 PCI Power Management
3570x05 MSI
3580x10 PCI Express
3590x11 MSI-X
3600x12 SATA Configuration
3610x13 PCI Advanced Features
3620x14 Enhanced Allocation
363
364Detection: walk the chain, validate each capability's declared size
365doesn't overlap the next, Next is DWord-aligned and within bounds,
366no cycle exists. A malformed chain is itself a signal.
367```
368
369### PCIe Express Capability (ID 0x10)
370```
371The single most important capability for spoofing detection.
372
373Offset Field Notes
374+0x02 PCIe Capabilities Cap Version, Device/Port Type, Slot Impl
375+0x04 Device Capabilities MPS Supported, FLR, Phantom Functions
376+0x08 Device Control MPS current, MRRS, Error Enables
377+0x0A Device Status CED, NFED, FED, URD, Transactions Pending
378+0x0C Link Capabilities Max Link Speed/Width, ASPM, L0s/L1 latencies
379+0x10 Link Control ASPM Control, RCB, Link Disable, Retrain
380+0x12 Link Status Current Link Speed/Width, Link Training
381+0x24 Device Capabilities 2 Completion Timeout Ranges, AtomicOp,
382 OBFF, LTR mechanism
383+0x28 Device Control 2 Completion Timeout Value, AtomicOp, LTR Enable
384+0x2C Link Capabilities 2 Supported Link Speeds Vector
385+0x30 Link Control 2 Target Link Speed, Compliance
386+0x32 Link Status 2 De-emphasis, EQ Phase status
387
388Detection leverage per field:
389- Device Type (+0x02[7:4]): must match donor's role
390- MPS Supported (+0x04[2:0]): hard-IP ceiling contradicts donor
391- FLR support (+0x04[28]): verify FLR changes same sticky/non-sticky
392 state as claimed donor; naive firmware acknowledges FLR but continues
393 unchanged, producing state inconsistent with donor-defined reset semantics
394- Link Status (+0x12): Width/Speed are negotiated, observable, hard to
395 lie about — hard IP reports what LTSSM actually achieved
396- Slot Clock Config (+0x12[12]): must match real platform behavior
397- Completion Timeout ranges (+0x24): selecting outside claimed ranges
398 is a discriminator
399- AtomicOp (+0x24[6-9]): server-class GPUs/NICs may support; FPGA
400 support depends on IP generation and configuration; compare advertised and
401 exercised behavior with the claimed donor
402```
403
404### MSI and MSI-X Capabilities
405```
406MSI (ID 0x05):
407Message Control bits:
408 [0] MSI Enable
409 [3:1] Multiple Message Capable (0–5, representing 1–32 vectors)
410 [6:4] Multiple Message Enable (cannot exceed Capable)
411 [7] 64-bit Address Capable
412 [8] Per-Vector Masking Capable
413
414x86 MSI Address: bits [31:20] fixed at 0xFEE (LAPIC prefix)
415 [19:12] Destination ID, [3] Redirection Hint, [2] Destination Mode
416Message Data: [15] Trigger Mode, [10:8] Delivery Mode, [7:0] Vector
417
418MSI-X (ID 0x11):
419- Supports up to 2,048 vectors
420- Table stored in BAR-mapped region (not Config Space)
421- Each entry: 16 bytes (Addr Low, Addr High, Data, Vector Control)
422- PBA (Pending Bit Array): bit-per-vector pending state
423
424Naive MSI-X emulation failures:
425- Ignores Vector Control Mask writes
426- Sets PBA bits but never clears on unmask
427- Returns hardcoded PBA values
428- Doesn't retire pending interrupts when masks clear
429Detection probe: mask vector → induce interrupt condition →
430observe PBA bit → unmask → observe interrupt firing.
431A conforming implementation should satisfy the relevant MSI-X semantics;
432incomplete emulations may fail, while sophisticated emulations can pass.
433```
434
435### AER Extended Capability (ID 0x0001)
436```
437Three error classes:
438- Correctable: Receiver Error, Bad TLP, Bad DLLP, Replay Timer Timeout
439- Uncorrectable Non-Fatal: Completion Timeout, Completer Abort, UR, ACS Violation
440- Uncorrectable Fatal: Malformed TLP, DLL Protocol Error, Surprise Down
441
442Each has Status (sticky, W1C), Mask, and Severity registers.
443Header Log (16B) captures full TLP header of first logged uncorrectable error.
444
445Detection:
446- Absence of AER when donor model is known to expose it = mismatch
447- Zero correctable-error count over long window when donor's silicon
448 normally produces a baseline rate = anomalous
449- Anomalous UR response patterns to probes of unimplemented offsets
450```
451
452### Extended Capabilities
453```
4544-byte header at each offset:
455[31:20] Next Capability Offset (0 to terminate)
456[19:16] Capability Version
457[15:0] Extended Capability ID
458
459Key Extended Capability IDs:
4600x0001 AER
4610x0002 Virtual Channel (VC)
4620x0003 DSN (Device Serial Number, 8 bytes)
4630x000B Vendor-Specific Extended Capability (VSEC)
4640x000D ACS (Access Control Services)
4650x000E ARI
4660x000F ATS (Address Translation Services)
4670x0010 SR-IOV
4680x0015 Resizable BAR (RBAR)
4690x0018 LTR (Latency Tolerance Reporting)
4700x001B PASID
4710x001D DPC (Downstream Port Containment)
4720x001E L1 PM Substates
4730x001F Precision Time Measurement (PTM)
474
475Detection-relevant:
476- DSN: 8-byte unique serial; donor-cloned firmware can collide
477 with another player's identical card
478- VSEC: Xilinx PCIe IP optionally emits VSEC blocks with
479 characteristic Vendor ID + VSEC ID combinations
480- ATS/PASID/SR-IOV presence on consumer-class donor is
481 demographically suspicious — rare outside server-class hardware
482```
483
484## IOMMU Architecture
485
486### Translation Flow
487```
4881. Device issues Memory TLP with target IOVA.
489 TLP header carries 16-bit Requester ID (BDF).
4902. TLP travels upstream through switches/bridges to root complex.
4913. IOMMU intercepts, uses Requester ID to look up translation context.
4924. IOMMU walks device's I/O page tables: IOVA → physical address.
4935. Permission bits (Read, Write) checked against access type.
4946. Success: TLP forwarded with translated physical address.
4957. Failure: fault logged, device receives UR or CA completion.
496```
497
498### Intel VT-d Internals
499```
500Two-level table lookup:
501
502BDF → Root Table (256 entries, 16B each, indexed by Bus)
503 → Context Table (256 entries, 16B each, indexed by Dev:Func)
504 → Second-Level Page Tables (3–5 levels)
505 → Final 4 KB physical page
506
507Context Entry fields:
508- SLPTPTR: Second-Level Page Table Pointer
509- Domain ID: 16-bit (multiple devices can share a domain)
510- AW: Address Width (3/4/5-level = 39/48/57-bit IOVA)
511- T: Translation Type (untranslated-only, translated-only, or both)
512- P: Present
513- FPD: Fault Processing Disable
514
515Page table entries (PTE, EPT-like format):
516[0] R - Read permission
517[1] W - Write permission
518[7] PS - Page Size (1=leaf super-page, 0=next-level table)
519[N-1:12] Physical address of next-level table or 4 KB page
520
521Super-pages: level-2 leaf = 2 MB, level-3 leaf = 1 GB.
522
523Scalable Mode (VT-d 3.0+):
524Context Entry → PASID Directory → PASID Table → per-PASID
525first-level page-table roots. Enables Shared Virtual Memory (SVM).
526Check RTADDR_REG.TTM to determine which mode is in effect.
527```
528
529### AMD-Vi Internals
530```
531Single-level Device Table indexed directly by BDF:
532
533BDF → Device Table Entry (32 bytes)
534 → I/O Page Tables (1–6 levels)
535 → Final page
536
537DTE encodes:
538- Page Table Root Pointer
539- Mode (0–6, selects paging levels)
540- Domain ID (16 bits)
541- IR, IW — Default Read/Write permission
542- GV — Guest Valid (nested translation)
543- PASID-related fields
544
545Page sizes: 4 KB, 2 MB, 1 GB.
546```
547
548### IOTLB and Invalidation
549```
550Translations cached in IOTLB (I/O Translation Lookaside Buffer).
551When mappings change, IOTLB must be invalidated.
552
553Two distinct caches when ATS is in use:
554- IOMMU's own IOTLB
555- Device-side TLB (DevTLB) caching prior translations
556
557Full invalidation with ATS requires:
5581. IOMMU invalidates own IOTLB
5592. IOMMU sends ATS Invalidate Request Message to device
5603. Device drops affected DevTLB entries, replies with Invalidate Completion
561
562If step 2 or 3 is skipped, device retains stale translations
563and can DMA to unmapped addresses.
564
565VT-d invalidation granularities:
566- Global: flush entire IOTLB
567- Domain-Selective: flush all entries for a Domain ID
568- Page-Selective: flush specific IOVA range in a domain
569
570Strict vs lazy invalidation:
571Lazy mode defers IOTLB invalidation, batching them for performance.
572Opens a window where stale translations remain valid — a device
573whose driver has unmapped a buffer can still DMA to the old IOVA.
574```
575
576### Fault Recording
577```
578VT-d: Fault Recording Registers — circular array capturing
579 Requester ID, faulting IOVA, fault reason, TLP type.
580
581AMD-Vi: Event Log Buffer — producer-consumer ring buffer of
582 IO_PAGE_FAULT, INVALID_DEVICE_REQUEST, ATS-related events.
583
584Both surface faults via interrupts and event-log entries.
585On Windows, some IOMMU violations observable through WHEA/bug-check
586paths and Driver Verifier DMA-violation telemetry.
587
588Per-device fault rate is one of the most operationally useful
589IOMMU-layer signals, but its baseline is platform-, device-, driver-, firmware-,
590and workload-specific. Sustained faults show failed or invalid DMA requests;
591driver bugs, resets, stale mappings, or hardware faults must be excluded before
592attributing malicious out-of-domain access.
593
594RMRR/IVMD:
595ACPI DMAR table contains RMRR (Reserved Memory Region Reporting)
596sub-tables declaring physical ranges devices need identity-mapped.
597AMD-Vi has analogous IVMD (I/O Virtualization Memory Definition)
598in the IVRS table. A defender should enumerate these and reject
599configurations where suspect BDFs appear in RMRR scope or
600RMRR ranges overlap game memory regions.
601```
602
603## IOMMU Topology and Isolation
604
605### IOMMU Groups
606```
607Devices in the same IOMMU group may not be safely isolated from
608one another. Group membership determined by:
609- PCIe topology — devices behind a switch share a group
610 unless the switch supports and enables ACS
611- ACS state of upstream bridges
612- Quirks for known-broken hardware
613
614Linux: /sys/kernel/iommu_groups/N/devices/
615Windows: equivalent constraints but no simple public group filesystem
616```
617
618### ACS (Access Control Services, Extended Cap ID 0x000D)
619```
620ACS is a PCIe capability that switches/root ports advertise
621to declare they can enforce isolation between downstream ports.
622
623ACS Capability register enable bits:
624Bit Feature Effect
6250 Source Validation (SV) Drop TLPs with wrong Requester ID
6261 Translation Blocking (TB) Block AT=10 (Translated) TLPs
6272 P2P Request Redirect (RR) Force P2P requests upstream for IOMMU
6283 P2P Completion Redirect (CR) Force P2P completions upstream
6294 Upstream Forwarding (UF) Forward upstream regardless
6305 P2P Egress Control (EC) Allow/deny P2P routing per-port
6316 Direct Translated P2P (DT) Allow P2P with translated addresses
632
633Critical for untrusted endpoints: SV, TB, RR, and CR.
634A switch missing Source Validation lets a malicious device spoof
635its Requester ID, defeating per-BDF IOMMU translation.
636A switch missing P2P Request Redirect allows devices on the same
637switch to DMA directly to each other without IOMMU involvement.
638```
639
640### Peer-to-Peer DMA
641```
642Devices on the same PCIe tree can send Memory TLPs directly to
643each other's BAR ranges without involving system memory.
644Without ACS redirection, peer traffic may remain below the root complex and
645bypass the host IOMMU translation path. Routing behavior is topology- and
646platform-specific, so confirm it with the actual root complex and switches.
647
648Plausible P2P DMA targets for cheat:
649- GPU framebuffer — rendered game state
650- Network adapter ring buffers — game traffic
651- USB controller queues — input device data
652
653Mitigation: ACS Translation Blocking + P2P Request Redirect
654on every intermediate bridge. Defender must walk topology and
655confirm both bits are active.
656```
657
658### Interrupt Remapping
659```
660MSI/MSI-X interrupts are Memory Writes to 0xFEE00000–0xFEEFFFFF.
661Without Interrupt Remapping (IR), any device with Bus Master enabled
662can write to this range and trigger arbitrary interrupts — NMIs, SMIs,
663or vectors targeting wrong CPU.
664
665With IR enabled, IOMMU validates MSI/MSI-X writes and uses
666remapping-table state to determine permitted destination.
667IR is part of VT-d's broader DMA Remapping architecture.
668Both VT-d and AMD-Vi have integrated equivalents.
669Both should be mandatory in any anti-cheat threat model.
670```
671
672## ATS, PASID, and Address Translation Trust
673
674### ATS (Address Translation Services, Extended Cap ID 0x000F)
675```
676ATS lets a device cache IOMMU translations locally:
6771. Device issues Translation Request TLP (AT=01) with IOVA
6782. IOMMU translates and responds with Translation Completion
679 carrying physical address
6803. Device caches translation in Device-side TLB (DevTLB)
6814. Subsequent accesses issued with AT=10 (Translated) —
682 IOMMU bypasses page-walk, trusting device's cached translation
6835. On mapping changes, IOMMU sends Invalidation Request
684
685Attack surface: malicious device claiming ATS can present
686arbitrary AT=10 TLPs whose addresses were never approved
687by the IOMMU. The IOMMU forwards them trusting the device's claim.
688```
689
690### PASID (Extended Cap ID 0x001B)
691```
692Extends ATS to per-process address spaces. 20-bit PASID carried
693in a TLP Prefix. IOMMU uses (Requester ID, PASID) jointly
694to select translation context.
695
696PASID enables Shared Virtual Memory (SVM) — primarily found in
697datacenter NICs, AI accelerators. Presence on a consumer card
698is anomalous.
699```
700
701### ATS Trust Model and "ATS Untrusted" Mode
702```
703The fundamental trust assumption: device honestly reports
704translations it has been granted. Unreasonable for external
705Thunderbolt enclosures, FPGAs in M.2 slots, or untrusted
706accelerator cards.
707
708Modern OS/IOMMU stacks can treat endpoints as ATS-untrusted:
709ATS is disabled, blocked by policy, or stripped.
710Linux: pci=noats plus per-device quirks.
711Windows: Kernel DMA Protection / DMAGuard matters, but don't
712treat "Kernel DMA Protection: On" as proof every internal
713endpoint is ATS-untrusted. Verify ATS state per endpoint.
714```
715
716## Driver–IOMMU Contract and Bypass Catalog
717
718### Legitimate DMA Path (Windows)
719```
7201. Acquire DMA adapter: IoGetDmaAdapter / WDF wrapper
7212. Allocate buffer: MmAllocateContiguousMemorySpecifyCacheNode
722 or WdfCommonBufferCreate
7233. Map for DMA: AllocateCommonBuffer / MapTransferEx
724 - OS allocates IOVA from device's domain
725 - Creates IOMMU page-table entries: [IOVA, IOVA+size) → physical pages
726 - Returns IOVA to driver
7274. Program device: driver writes IOVA into device's BAR registers
7285. Device DMAs: TLPs arrive at IOMMU with BDF + IOVA
7296. IOMMU translates: page-walk produces physical address
7307. Completion and unmap: teardown IOMMU entries + IOTLB invalidation
731
732In this model, device can DMA only to addresses the driver
733explicitly mapped. Game memory is not in that range.
734```
735
736### Six Paths to Out-of-Domain Access
737```
7381. IOMMU not active or not applied to this path
739 VT-d/AMD-Vi disabled, OS not enforcing, device outside protected ports
740
7412. Pre-boot DMA injection
742 Inject before IOMMU initialized; requires firmware-level exploit
743
7443. Identity-mapped / passthrough domains
745 Legacy drivers request 1:1 mapping; modern strict-mode rejects it
746
7474. Driver mapping over-allocation (Thunderclap class)
748 OS maps full 4 KB page when buffer is smaller; adjacent kernel data exposed
749
7505. Legitimate-path data exfiltration
751 Cheat spoofed as NIC; OS network stack passes game packets through
752 NIC's RX ring buffer (legitimately IOMMU-mapped). Cheat reads game data
753 without leaving allowed mappings. Undetectable at IOMMU layer.
754
7556. IOMMU page-table manipulation via kernel compromise
756 BYOVD / vulnerable driver reprograms IOMMU tables.
757 Requires code execution on gaming PC.
758
759Approaches 1–3 are the foundation of most current DMA cheats.
760```
761
762### IOMMU Bypass Catalog (16 Techniques)
763```
764# Technique Mechanism Mitigation
765─────────────────────────────────────────────────────────────────────────────────
7661 IOMMU disabled VT-d/AMD-Vi off in BIOS Refuse misconfigured platforms
7672 Pre-boot DMA Firmware leaves injection window UEFI updates; verify ACPI indicators
7683 Identity/passthrough 1:1 IOVA-to-physical mapping Strict-mode IOMMU policy
7694 Driver over-allocation Full 4 KB page, adjacent data OS bounce buffers; strict mappings
7705 ATS abuse AT=10 TLPs with arbitrary addrs ATS Untrusted mode for non-allowlisted
7716 ACS missing on bridge P2P or spoofed Requester ID Verify ACS state on all bridges
7727 Lazy IOTLB invalidation Stale translations valid briefly Strict invalidation mode
7738 FLR race FLR/Hot Reset race window Synchronized FLR handling
7749 SMM bypass SMM code exempt from IOMMU Boot Guard / Platform Secure Boot
77510 DMA-remapping driver bugs Bugs in OS IOMMU manager OS patching
77611 Hypervisor trust failure Compromised hypervisor Platform remediation; boot evidence is not runtime proof
77712 Interrupt injection (no IR) Write arbitrary interrupts Mandatory IR enforcement
77813 RMRR/IVMD scope abuse Fake ACPI tables cover attacker Measured boot; runtime RMRR audit
779 physical ranges
78014 Snoop-bit manipulation Stale cache lines visible Strict snoop enforcement
78115 PASID confusion Misconfigured PASID Table PASID-aware IOMMU programming
78216 DMAR/IVRS spoofing Compromised firmware, fake tables Measured boot covering firmware
783
784Techniques 1–6: active attack surface for current commercial DMA cheats
785Techniques 7–13: academic, APT, firmware-level contexts
786Techniques 14–16: largely theoretical
787```
788
789## FPGA Hardware
790
791### Xilinx PCIe Integrated Block
792```
793Hardened IP block handling:
794- Physical Layer (PHY, 8b/10b or 128b/130b, LTSSM, equalization)
795- Data Link Layer (sequence numbers, replay buffer, flow control)
796- Transaction Layer framing and parsing
797- Subset of Configuration Space
798
799IP core documentation:
800- PG054 for 7-series
801- PG156 for UltraScale Gen3
802- PG213 for UltraScale+ Gen4
803
804User logic interfaces over AXI-Stream (TX/RX) and separate
805config management: cfg_mgmt_* (7-series), cfg_ext_* (UltraScale).
806
807Detection consequences:
808- Default fingerprints leak through: hard block populates Config Space
809 with Xilinx-characteristic byte patterns
810- 7-series firmware authors who don't understand cfg_mgmt_* leave
811 subtle behavioral differences (some CfgTLPs return hard-block defaults)
812```
813
814### FPGA Family Hierarchy
815```
816Artix-7 (consumer/mid-range, GTP transceivers, PCIe Gen2):
817Chip LUTs BRAM(Kbit) PCIe Hard Block
818XC7A35T 20,800 1,800 Gen2 x4
819XC7A50T 32,600 2,700 Gen2 x4
820XC7A75T 46,200 3,780 Gen2 x4
821XC7A100T 63,400 4,860 Gen2 x4
822XC7A200T 134,600 13,140 Gen2 x4
823(Smaller than T35 have no hard PCIe block)
824
825Kintex-7 (high-end, GTX transceivers):
826XC7K70T 41,000 4,860 Gen2 x8
827XC7K160T 101,400 11,700 Gen2 x8
828XC7K325T 203,800 16,020 Gen2 x8 / Gen3 x4
829XC7K410T 254,200 28,620 Gen3 x8
830
831Zynq UltraScale+ (ARM Cortex-A53 cores, GTH/GTY):
832ZU2EG/CG ~47,000 ~5.3M Gen3 x4
833ZU3EG/CG ~70,000 ~7.6M Gen3 x4
834ZU4EG/EV ~88,000 ~11.0M Gen3 x8
835ZU5EG/EV ~117,000 ~18.0M Gen3 x8
836ZU6EG/CG ~230,000 ~32.1M Gen3 x16
837(EV-suffixed: hardened H.265 codec for DMA + video-capture boards)
838```
839
840### Resource Constraints and Capability
841```
842BRAM size caps:
843 shadow config + writable overlay + BAR emulation + state machines.
844 T35 (1.8 Mbit) struggles with full 4 KB shadow + 64 KB BAR + jitter buffers.
845 T100 (4.86 Mbit) fits comfortably.
846 Zynq ZU3 (7+ Mbit) has effectively unlimited room.
847
848LUT count caps behavioral complexity:
849 Each subsystem (MSI generator, ASPM FSM, AER counter, BAR responder)
850 costs thousands of LUTs. T35 holds 1–2; T100 the full set;
851 Kintex/Zynq adds runtime-reconfigurable parameter tables.
852
853PHY transceiver family (GTP/GTX/GTH/GTY) has measurably different
854signal characteristics; can sometimes be inferred from root-port
855performance counters independent of firmware spoofing.
856```
857
858### Form Factors
859```
860Form Factor Description Detection
861────────────────────────────────────────────────────────────────────
862M.2 NGFF Key M Internal NVMe slot Dominant modern form;
863 physical inspection needed
864M.2 + USB3 bridge M.2 board with FT601 Gaming PC sees only M.2
865PCIe x1/x4 add-in Traditional add-in card More physically visible
866External USB3 USB3-to-PCIe (legacy) Mostly obsolete
867Combo boards DMA + HDMI capture + Complex device tree;
868 input injection HDMI activity is fingerprint
869
870M.2 slot populations are partially auditable from software through
871PCI topology, ACPI, SMBIOS, storage inventory, and vendor board databases.
872SMBIOS slot records are often incomplete for M.2, so detection should
873be probabilistic and board-model-aware.
874```
875
876## pcileech Framework
877
878### Project Lineage
879```
880Five upstream repositories:
881- pcileech: Host-side C application with attack modules
882- pcileech-fpga: FPGA firmware in Verilog/SystemVerilog, per-board variants
883- MemProcFS: Virtual filesystem mounting target memory as /proc-like tree
884- LeechCore: Low-level device abstraction library
885- vmm: Memory analysis engine (vmm.dll API)
886
887Pipeline: FPGA → LeechCore → PCILeech attack modules / MemProcFS analysis
888```
889
890### FPGA Firmware Architecture
891```
892Key modules:
893- pcileech_pcie_a7.v / _us.v: Top-level Artix-7 / UltraScale integration
894- pcileech_pcie_tlps128_bram_rdwr.v: 128-bit TLP source/sink (AXI-Stream)
895- pcileech_pcie_cfgspace_shadow.v: Shadow config space in BRAM
896- pcileech_cfgspace.coe: Init data (stock: Xilinx 10EE:0666)
897- pcileech_bar_impl_zerowrite4k.v: Default BAR — absorbs writes, returns zero
898- pcileech_bar_impl_loopaddr.v: Alternative BAR — echoes address
899- pcileech_bar_impl_none.v: Disables BAR (returns UR)
900- pcileech_pcie_cfg_a7.v: Config management via cfg_mgmt_*
901- pcileech_mux.v: TLP multiplexer
902- pcileech_fifo.v: Internal staging FIFO
903
904Two key architectural choices:
9051. Shadow config is spoofable but not spoofed by default.
906 .coe ships with placeholder Xilinx IDs. User must overwrite
907 with real donor's dump and resynthesize.
9082. BAR controller is functionally inert.
909 zerowrite4k doesn't emulate device behavior.
910 Active BAR probing catches stock builds in one operation.
911```
912
913### Host-Side MemProcFS
914```
915Mounts target memory as filesystem:
916M:\
917├── pid\1234\
918│ ├── name.txt
919│ ├── modules\ ← loaded module list
920│ ├── handles\
921│ ├── vad\ ← virtual address descriptors
922│ ├── memmap.txt
923│ └── minidump\
924├── sys\
925├── name\game.exe\ ← lookup by process name
926└── forensic\
927 ├── yara\
928 ├── timeline\
929 └── registry\
930
931One possible development/use pattern:
9321. Development phase: MemProcFS, signature search, cross-references
933 → slow, broad scanning to find entity manager / player array / view matrix
9342. Execution phase: custom app via vmm.dll/LeechCore,
935 narrower periodic or batched reads of known offsets
936Behavioral analysis can test for this pattern, but implementations may cache,
937randomize, or use different access strategies.
938```
939
940### Stock Firmware Fingerprints
941```
942Common or older vanilla pcileech-fpga configurations may exhibit the following;
943verify the exact commit, FPGA IP configuration, and synthesized design:
944- VID/DID 10EE:0666 (Xilinx placeholder)
945- Xilinx 7-series PCIe IP signature bytes at characteristic offsets
946- DSN Extended Capability absent or default
947- No AER, LTR, ARI, ATS, or SR-IOV capabilities
948- BAR0 mapped (DMA window); BAR1–5 disabled or all-ones
949- BAR reads return zero (zerowrite4k) or echo address (loopaddr)
950- MSI capability present but expected interrupts are not generated
951- Config reads complete in deterministically uniform time
952 (BRAM lookup with fixed pipeline depth, near-zero variance)
953- no observed ASPM transitions under a workload and policy that should enter
954 lower-power states
955- AER correctable-error count stays at zero
956- power state remains D0 under tested conditions
957- Class Code matches donor placeholder but no class-specific behavior
958```
959
960## Configuration Space Spoofing
961
962### Bridge vs Emulated Firmware
963```
964Bridge firmware:
965 Patches identity fields via Vivado's PCIe IP Core GUI
966 (VID, DID, Subsystem IDs, Class Code, sometimes DSN).
967 Fast to produce, but 7-series hard IP generates internal capability
968 blocks at characteristic offsets that retain FPGA-specific fingerprints.
969
970Emulated (1:1) firmware:
971 Implements complete shadow Configuration Space in BRAM.
972 Entire 4 KB extended config space initialized from real donor device hex dump.
973 When OS issues CfgRd TLP, firmware responds from BRAM.
974 The design attempts to prevent IP-core defaults from appearing on the bus.
975
976 Common bugs in emulated firmware:
977 - First 16 bytes still come from IP block (mux priority)
978 - Type 1 config reads not intercepted
979 - Capability blocks bypassed in GUI still leak defaults
980```
981
982### Shadow Configuration Space Implementation
983```
984Requirements:
9851. Intercept incoming CfgRd0/CfgWr0 TLPs
9862. Decode target offset
9873. Look up value in BRAM
9884. Build Completion TLP with correct Completer ID, status, payload
9895. Send Completion through hard IP block
990
9914 KB coverage at 4-byte granularity = 1,024 entries × 4 bytes = 4 KB BRAM.
992Well within even T35's resources.
993```
994
995### Overlay RAM and Writable Register Emulation
996```
997Real devices have writable registers. Firmware that returns correct
998values on reads but drops writes creates detectable inconsistency.
999
1000Detection probe:
1001 write Command[BME] = 1 → read Command[BME]
1002 write Command[BME] = 0 → read Command[BME]
1003 Real silicon: bit toggles. Naive shadow: bit stays at BRAM init value.
1004
1005Overlay RAM merges at read time:
1006 response = (base_value & ~writable_mask) | (overlay_value & writable_mask)
1007
1008The catch: writable mask is register-specific:
1009- Command Register: different reserved bits than Device Control
1010- MSI Address Low: bits [1:0] reserved-zero
1011- BAR: type bits in [3:0] depend on I/O/memory, prefetchable
1012- Status Register: W1C bits — writing 1 clears, writing 0 no change
1013- AER Status: W1C across the board
1014
1015Naive implementations with single global mask fail because
1016reserved-bit and W1C behavior diverges. Detection probes
1017W1C cases: write 0x00000000 to Correctable Error Status,
1018then write known-1 patterns, verify read-back semantics.
1019```
1020
1021### Claimed Device Identity and Baselines
1022
1023Compare the claimed device with provenance-backed inventory and a matched
1024reference: exact SKU, function, firmware, driver, topology, and power/workload
1025state. Multiple legitimate devices can share product identifiers. A lower link
1026speed, inactive function, or unusual device class needs context; none is an
1027automatic finding of device impersonation.
1028
1029### Device Evidence Dimensions
1030
1031Replace informal firmware tiers with a record of properties actually observed:
1032
1033| Dimension | Evidence needed | Permitted conclusion |
1034|---|---|---|
1035| Identity and provenance | Device inventory, exact identifiers, trusted source and version | Consistent, inconsistent, or unverified identity |
1036| Configuration and function | Applicable device contract and matched observations | A specific conformance discrepancy with known alternatives |
1037| Runtime behavior | Collector coverage, workload and power-state baseline | A calibrated anomaly within the measured conditions |
1038| Memory-access policy | Active platform/driver remapping and available fault evidence | Permitted or denied access on the established path |
1039| Platform trust | Attestation policy and supported runtime observations | Trust in the measured properties, with unmeasured state explicit |
1040
1041No public/private label establishes detector difficulty, guaranteed detection,
1042or a requirement for one particular trust anchor. A device can satisfy observed
1043behavioral checks while other properties remain unknown. See
1044[assurance boundaries](references/assurance-boundaries.md).
1045
1046### Reference-Set Limits
1047
1048Describe which legitimate device populations a baseline covers. A reference-set
1049absence is an unknown identity, not proof that a device class is malicious or
1050technically implausible. Do not claim that a whole class is defeated, undetected,
1051or exhausted without a versioned evaluation and measured error rates.
1052
1053## Detection at the PCIe Layer
1054
1055### Configuration Integrity
1056
1057Use supported, permitted observations of device identity, capability structure,
1058OS-assigned resources, and advertised functions. Compare with the exact device
1059contract and a matched baseline; document unavailable or inaccessible fields.
1060Collection should not modify another driver's configuration registers.
1061
1062### BAR and Register Evidence
1063
1064Distinguish OS-reported BAR resources from device-specific register contents.
1065A zero or unexpected value may reflect reset, power state, a missing driver,
1066unsupported functionality, or collector scope. Establish register semantics and
1067which actor owns access before interpreting it as a conformance failure.
1068
1069### Configuration Ownership and Consistency
1070
1071Assess consistency from existing traces, device documentation, owned-source
1072review, and documented platform interfaces. Windows retains control of PCI
1073headers and capabilities. A generic collector is not entitled to toggle bus
1074mastering, payload size, MSI state, or reserved bits to classify live devices.
1075Any separately designed device validation must respect the owning driver and
1076platform lifecycle. See [configuration and containment boundaries](references/assurance-boundaries.md).
1077
1078### LTSSM and Link-State Validation
1079```
1080Sample PCIe Express Capability Link Status over time:
1081- Negotiated Width (Link Status[9:4]): consistent with donor deployment
1082 and FPGA hard block capability
1083- Current Link Speed (Link Status[3:0]): track slot's actual speed
1084- A device can legitimately train below its maximum capability; compare the
1085 result with slot topology, platform policy, signal quality, and matched donor
1086 deployments
1087- DLL Active (Link Status[13]): should be 1 during operation
1088- Slot Clock Config (Link Status[12]): match real common-clock state
1089```
1090
1091### ASPM Behavioral Validation
1092```
1093Real devices claiming ASPM exhibit characteristic L0 ↔ L1 transitions.
1094
1095Spoofed device anomalies:
1096- Claims and enables ASPM but shows no expected transition under a workload,
1097 policy, and observation window known to exercise it
1098- Transitions with exit latency inconsistent with claimed value
1099- Does not reach L1.1/L1.2 when donor, platform, firmware policy, and workload
1100 are verified to enable those substates
1101
1102Sample Link Status "DLL Active" bit over time + PMC counters.
1103```
1104
1105### AER Baselining
1106```
1107- Departure from donor baseline: per-silicon correctable-error footprint
1108 should be stable. Implausibly clean (zero correctables when donor
1109 normally produces Bad TLP / Replay Timer Timeout) is anomalous.
1110- Implausible Header Log content (default/zeroed values)
1111- Inconsistent UR/CA responses to probes of unimplemented offsets
1112```
1113
1114### Completion Latency Fingerprinting
1115```
1116Completion latency can reflect memory, arbitration, buffering, power state,
1117link, driver, and workload behavior. A simplistic BRAM-backed emulator may show
1118lower variance, but real and emulated distributions can overlap.
1119
1120Detection signal is distribution shape, not absolute mean.
1121
1122Statistical methods:
1123- Kolmogorov–Smirnov test: compare empirical CDFs
1124- Tail estimators where sample size and distributional assumptions support them
1125- Anderson-Darling test: sensitive to tail differences
1126
1127Choose the sample size from power/variance analysis, collect under controlled
1128conditions, compare with a matched donor reference, and validate any decision
1129threshold on held-out devices.
1130
1131Random jitter alone need not reproduce donor behavior. Compare mean, variance,
1132tails, modes, autocorrelation, and responses to condition changes.
1133```
1134
1135### MSI/MSI-X Behavioral Validation
1136```
1137A device with MSI enabled, programmed Address/Data, an attached driver, and a
1138verified interrupt-producing condition should produce interrupts:
1139
1140- Zero interrupts when driver should exercise device = anomalous
1141- Uniform arrival times may indicate a timer-driven generator, but legitimate
1142 periodic workloads must be excluded
1143- Implausibly bursty patterns not matching donor class
1144
1145Monitor via OS interrupt accounting, ETW/performance telemetry,
1146driver counters, kernel instrumentation.
1147```
1148
1149### Cheat-Phase Access Pattern Recognition
1150```
1151One possible workflow has a broad discovery phase followed by narrower,
1152periodic reads during use. Implementations can cache, randomize, batch, or avoid
1153these phases, and legitimate devices can also show periodic access.
1154
1155Candidate execution features:
1156 Temporal periodicity, address-space breadth, and alignment to game-frame
1157 intervals, calibrated against matched benign device/workload behavior.
1158
1159Distinguishing features:
1160- Fano factor
1161- Autocorrelation at frame intervals
1162- Address-space coverage entropy
1163
1164Decoy observations require a defined collector and access path. An EPT event
1165records processor access under the active EPT policy; device DMA requires
1166separate remapping/fault or platform evidence. Server events have their own
1167application semantics. Do not attribute one collector's event to another layer.
1168```
1169
1170### Hot-Plug and Link Disruption Events
1171```
1172Firmware swaps and donor reconfigurations require link renegotiation.
1173Three observable signals:
1174
11751. AER Surprise Down — uncorrectable fatal error logged when link
1176 drops unexpectedly mid-session.
1177
11782. Slot Status hot-plug events — Presence Detect Changed,
1179 Data Link Layer State Changed, MRL Sensor Changed.
1180 Register via IoRegisterPlugPlayNotification with
1181 EventCategoryTargetDeviceChange or EventCategoryDeviceInterfaceChange.
1182
11833. LTSSM re-training cycles — Link Training bit toggling,
1184 transient Recovery state.
1185
1186A device that surprise-downs then reappears with subtly different
1187Config Space (adjusted MSI layout, different latency profile,
1188different VID/DID) = fingerprint of mid-session firmware reload.
1189```
1190
1191## Detection at the IOMMU Layer
1192
1193### Fault-Rate Monitoring
1194```
1195Sample per-device fault counters from IOMMU fault-recording structure
1196(VT-d Fault Recording Registers, AMD-Vi Event Log) or from WHEA.
1197
1198Pipeline:
11991. Snapshot baseline at session start
12002. Sample at intervals; compute per-device fault rate
12013. Threshold-trigger additional PCIe probing on devices exceeding baseline
12024. Aggregate evidence across signals before action
1203```
1204
1205### Domain Assignment Audit
1206```
1207Walk IOMMU domain assignments for anomalies:
1208- Devices on passthrough/identity domains when strict mode is active
1209- Devices in unexpectedly large IOMMU groups (poor ACS topology)
1210- Multiple devices sharing Domain ID when they shouldn't
1211```
1212
1213### ACS Topology Verification
1214```
1215Walk PCIe bridge topology between every endpoint and root complex.
1216For each bridge with ACS Capability:
1217- Verify Source Validation (SV) enabled
1218- Verify Translation Blocking (TB) enabled
1219- Verify P2P Request Redirect (RR) and Completion Redirect (CR) enabled
1220
1221Missing or disabled ACS can limit isolation where peer routing is possible.
1222Assess the complete topology, root-complex behavior, firmware policy, and actual
1223IOMMU grouping before calling it an exploitable isolation hole.
1224```
1225
1226### IOMMU as Containment Primitive
1227
1228Containment is a platform/driver responsibility. Record the authorized policy
1229owner, affected device hierarchy, existing mappings, in-flight work, recovery
1230path, and evidence that the requested isolation completed. Remapping, bus-master
1231state, and downstream-port containment have different prerequisites and scope;
1232none has an effectiveness guarantee derived from a firmware tier.
1233
1234Use supported OS-managed device lifecycle and isolation controls. Do not instruct
1235a generic game-security driver to rewrite another device's PCI configuration or
1236IOMMU ownership. Preserve evidence and evaluate availability impact before an
1237authorized response; restriction is separate from misconduct attribution.
1238[Platform ownership and containment](references/assurance-boundaries.md)
1239
1240## Hypervisor-Level Defense
1241
1242### EPT-Based Memory Protection
1243
1244EPT supplies a processor-side guest-physical to host-physical translation and
1245permission boundary. A violation concerns an access governed by the active EPT
1246policy. IOMMU remapping supplies the separate device-to-memory boundary; an EPT
1247trap is not direct evidence of a PCIe DMA request.
1248
1249A trusted hypervisor can own both policies, but verify each path independently.
1250Protection depends on correct region coverage, page lifetime, backing-memory
1251isolation, and trusted policy/configuration interfaces. A guest CPU permission
1252change alone establishes no device-DMA coverage. Hypervisor presence and effects
1253may be observable; operating outside the guest kernel does not imply invisibility.
1254[CPU, DMA, and hypervisor assurance](references/assurance-boundaries.md)
1255
1256### VBS, HVCI, and VTL Split
1257
1258VBS and memory integrity strengthen isolation of kernel code-integrity decisions.
1259They do not grant arbitrary third-party drivers a VTL 1 extension interface or
1260make every signed driver safe. Review documented integration and the effective
1261vulnerable-driver policy separately; blocklist coverage has limits.
1262
1263Record platform support, configured policy, services actually running, and
1264compatibility evidence. Kernel DMA Protection does not require VBS, and per-device
1265DMA remapping can be enabled independently of the overall feature. Select an
1266explicit deployment baseline for the product instead of treating every security
1267feature as a universal requirement or its absence as misconduct.
1268[Feature and deployment boundaries](references/assurance-boundaries.md)
1269
1270### SMM Considerations
1271```
1272System Management Mode (Ring -2) runs in SMRAM, isolated from
1273the OS. SMM CPU memory accesses are not mediated by the device IOMMU, but
1274accessible data still depends on platform protections, memory encryption,
1275firmware design, and virtualization context.
1276
1277A vulnerable SMI handler = path to arbitrary memory access
1278without IOMMU mediation.
1279
1280Mitigations:
1281- Intel Boot Guard / AMD Platform Secure Boot (firmware signatures)
1282- SMI Transfer Monitor (STM): hypervisor-resident, treats SMM as
1283 constrained guest; availability and deployment are platform-specific
1284- Runtime verification of SMM lockdown registers
1285```
1286
1287### PCIe IDE (Integrity and Data Encryption)
1288```
1289IDE adds link-level TLP protection: integrity (MAC-based, required)
1290and confidentiality (encryption, optional).
1291Incorporated into PCIe 6.0 base specification.
1292
1293Valuable against: physical link interposers, malicious retimers/switches,
1294traffic tampering.
1295
1296NOT a DMA-cheat silver bullet: cheat installed as the endpoint
1297still originates legitimate IDE-protected TLPs after key establishment.
1298IDE raises the bar for passive bus sniffing but endpoint identity,
1299IOMMU policy, ACS topology, ATS policy, and attestation remain required.
1300```
1301
1302## External Trust Anchors
1303
1304### TPM Measurements and PCR Profiles
1305
1306A TPM supports protected keys and measurement reporting. Record the actual TPM
1307implementation, PCR bank, platform profile, and selected measurements. PCR reset
1308and extend rules are profile-dependent; a universal extend-only table is
1309inaccurate. Resolve measurement meaning from the applicable profile and event
1310log, rather than assigning one fixed PCR layout to every system.
1311
1312### Remote Attestation Evidence
1313
1314Review key enrollment, verifier trust anchors, signature validity, expected
1315qualifying data, PCR selection/digest consistency, event-log consistency, and
1316the appraisal policy. An attestation key's trust chain depends on the enrollment
1317scheme; it does not automatically terminate at a TPM manufacturer certificate.
1318
1319A valid quote supports the selected measurements under that trust model. It does
1320not establish the absence of a DMA-capable device or authenticate every current
1321IOMMU mapping. Separate accepted boot evidence, unsupported measurement coverage,
1322and verified runtime state in the report.
1323
1324### DRTM and Secure Launch
1325
1326Secure Launch uses DRTM during startup to establish a measured execution path.
1327Do not describe this as an arbitrary post-boot application launch or assume that
1328one PCR comparison verifies every security component. Record platform support,
1329launch state, applicable measurement profile, and appraisal policy.
1330
1331### Pre-Boot DMA Evidence
1332
1333Firmware's pre-boot isolation responsibilities and Windows runtime DMA policy
1334are distinct. Microsoft's OEM contract specifies a PCR 7 event when relevant
1335DMA protections are disabled or reduced. Interpret its presence or absence only
1336against the applicable contract and a trustworthy measurement/event-log path.
1337ACPI indicators describe platform capabilities and policy inputs, not a complete
1338snapshot of live IOMMU mappings.
1339
1340Sources and verification limits: [attestation and platform contracts](references/assurance-boundaries.md).
1341
1342## Layered Detection Pipeline
1343
1344### Pre-Game Environmental Verification
1345
1346Record supported, configured, and observed-running state separately for device
1347remapping, interrupt remapping, Secure Boot, VBS/memory integrity, and attestation.
1348Bind requirements to a documented product/platform policy. Assess firmware update
1349applicability and relevant topology; absence from a known-issue list is not proof
1350that firmware has no vulnerabilities. Unsupported or unavailable evidence should
1351remain explicit, with compatibility and recovery paths defined.
1352
1353### PCIe Inventory Pass
1354```
1355- Enumerate all PCIe devices via PnP tree
1356- Supported configuration snapshot, recording readable span and missing fields
1357- Check device problem codes (DEVPKEY_Device_ProblemCode)
1358- Cross-reference SMBIOS slot inventory with populated devices
1359```
1360
1361### Configuration Integrity Per Device
1362```
1363- VID/DID/SVID/SDID against known-good list
1364- Capability-chain walk and validation
1365- Signature-residue scan
1366- OS-reported BAR/resource consistency
1367- Configuration consistency from permitted observations
1368- Compare against per-donor reference database
1369```
1370
1371### Behavioral Sampling During Play
1372```
1373- Periodic Link Status reads (LTSSM, ASPM transitions)
1374- AER counter snapshots
1375- Per-device interrupt rate and distribution
1376- Per-device IOMMU fault rate
1377- BAR-region content sampling for class consistency
1378```
1379
1380### Statistical Analysis Over Session
1381```
1382- Latency distribution comparison (KS test, Hill estimator)
1383- Interrupt arrival distribution
1384- ASPM transition rate
1385```
1386
1387### Cheat-Phase Detection
1388```
1389- Honeypot region access
1390- Memory access frequency / locality classifiers
1391```
1392
1393### Containment Before Verdict
1394```
1395Each detection produces evidence, not a verdict.
1396Verdict informed by:
1397- Multi-signal correlation with measured joint error rates; correlated
1398 signals can share the same false-positive cause
1399- Server-side aggregation across sessions
1400- Behavioral verification (input timing, gameplay statistics)
1401
1402Any authorized containment must use the established OS/platform owner and
1403verify its actual scope and completion. EPT CPU permissions and device DMA
1404isolation are different controls; neither implies a guaranteed real-time outcome.
1405```
1406
1407Apply [`research-rigor`](../research-rigor/SKILL.md) when converting these
1408signals into a claim or response. Validate baselines per device, firmware,
1409platform, topology, driver, and power state; preserve raw captures and test
1410benign alternatives before attribution.
1411
1412### Realistic Limits
1413
1414A passing identity or behavioral check establishes consistency only in the
1415observed dimensions. A denied DMA request establishes the enforced boundary
1416for that request; it does not classify every device or actor. A valid attestation
1417result covers its selected measurements and appraisal policy, not all current
1418memory access.
1419
1420Choose complementary controls for independently identified trust gaps. External
1421attestation can support boot-state confidence but is not a universal solution to
1422unobserved runtime activity. Report coverage, missing evidence, shared failure
1423modes, and measured error rates instead of an evasion checklist or a claim that
1424one device class requires a particular detector.
1425
1426Layered protection may increase attack cost; the magnitude and economic effect
1427remain deployment-specific claims requiring evidence.
1428
1429## Forensic Evidence Capture
1430
1431### What to Capture
1432```
1433Artifact Source Purpose
1434──────────────────────────────────────────────────────────────────────────────
1435Supported config snapshot OS PCI interface Device identity and collection scope
1436Capability chain walk Parsed from config Capability presence
1437PCIe link state history Link Status over session LTSSM anomaly evidence
1438MSI/MSI-X arrival timeline OS interrupt telemetry Rate claim refutation
1439AER correctable counts AER capability registers Baseline outlier evidence
1440IOMMU fault log entries WHEA/ETW, Driver Verifier Invalid-DMA evidence
1441IOMMU domain assignments IOMMU manager state walk Passthrough anomaly
1442ACS bridge state Bridge enumeration Isolation assessment
1443Protected-page CPU event Hypervisor EPT event evidence CPU access-policy observation
1444Device DMA fault evidence Platform/IOMMU collector Device request-policy observation
1445TPM quote and measurement log Attestation provider Selected-measurement appraisal
1446MCFG / DMAR / IVRS tables ACPI subsystem Platform config baseline
1447SMBIOS slot inventory DMI subsystem Slot-population audit
1448BIOS version + patch level SMBIOS Pre-Boot DMA fix verify
1449Latency-distribution hists Per-session sampling Statistical fingerprint
1450```
1451
1452### Multi-Signal Correlation
1453```
1454Strongest evidence packages combine:
14551. Hardware-layer signal (config space, BAR, link state)
14562. Behavioral-layer signal (interrupt distribution, IOMMU fault rate, honeypot)
14573. Temporal correlation (hardware signal preceded behavioral by plausible interval)
1458
1459No signal count guarantees a target false-positive rate. Establish independence
1460or model dependence, validate the joint decision rule on representative benign
1461systems, and report confidence bounds plus expected appeal volume.
1462```
1463
1464### PCIe Protocol Captures
1465```
1466A PCIe protocol analyzer (interposer) can provide high-fidelity evidence at its
1467observation point: TLP-level captures with analyzer-specific timestamp accuracy.
1468
1469Commercial analyzers capture every TLP, DLLP, and physical-layer ordered set.
1470Traces can be replayed to confirm fingerprinting findings.
1471
1472Cost and deployment complexity limit routine use. For high-impact cases,
1473protocol-level captures from an independent lab can materially strengthen the
1474record, but capture coverage, analyzer configuration, and interpretation still
1475need validation.
1476```
1477
1478## Thunderbolt / USB4 DMA
1479
1480### Attack Surface
1481```
1482- Thunderbolt 1-4 / USB4 provide direct PCIe tunneling
1483- Hot-plug capable: device can be attached at runtime
1484- Pre-boot DMA: device has memory access before OS loads
1485- Thunderbolt Security Levels:
1486 - SL0 (None): no security, legacy mode
1487 - SL1 (User Auth): user must approve new devices
1488 - SL2 (Secure Connect): device must match previously approved UUID
1489 - SL3 (No PCIe tunneling): completely disables DMA
1490```
1491
1492### Thunderbolt-Specific Attacks
1493```
1494- Thunderclap: malicious Thunderbolt peripherals bypass IOMMU
1495- Device re-identification: change UUID to bypass SL2
1496- OS-level Thunderbolt driver vulnerabilities
1497- PCIe tunneling through USB4 hubs
1498```
1499
1500### Defensive Measures
1501```
1502- Kernel DMA Protection (Windows 10 1803+): automatic IOMMU for hot-plug
1503- Thunderbolt firmware verification
1504- Platform-level: BIOS setting to disable Thunderbolt PCIe tunneling
1505- macOS: T2 chip enforces DMA restrictions on Thunderbolt ports
1506```
1507
1508## Shadow CR3 / Split TLB
1509
1510### Page Table Manipulation
1511```
1512- Maintain two sets of page tables (two CR3 values):
1513 - "Clean" CR3: legitimate page tables visible to anti-cheat
1514 - "Shadow" CR3: modified page tables with cheat-accessible mappings
1515- Swap CR3 before/after anti-cheat inspection windows
1516- Combine with EPT manipulation for hypervisor-level split
1517```
1518
1519### Split TLB Techniques
1520```
1521- Desync instruction TLB (iTLB) and data TLB (dTLB):
1522 - Execute code from one physical page
1523 - Read data from another physical page at same virtual address
1524- Requires precise TLB invalidation control
1525- Hypervisor can create EPT-based split: execute on page A,
1526 read on page B, at same GPA
1527- Anti-cheat mitigation: TLB flush + re-walk, serializing instructions
1528```
1529
1530## Memory Access Techniques
1531
1532### Physical Memory Reading
1533```c
1534// Typical pcileech API usage
1535HANDLE hDevice;
1536BYTE buffer[0x1000];
1537pcileech_read_phys(hDevice, physAddr, buffer, sizeof(buffer));
1538```
1539
1540### Virtual Address Translation
1541```c
1542// Walk page tables: PML4 → PDPT → PD → PT → Physical
1543PHYSICAL_ADDRESS TranslateVA(UINT64 cr3, UINT64 virtualAddr) {
1544 UINT64 pml4e = ReadPhys(cr3 + PML4_INDEX(virtualAddr) * 8);
1545 UINT64 pdpte = ReadPhys(PFN(pml4e) + PDPT_INDEX(virtualAddr) * 8);
1546 UINT64 pde = ReadPhys(PFN(pdpte) + PD_INDEX(virtualAddr) * 8);
1547 UINT64 pte = ReadPhys(PFN(pde) + PT_INDEX(virtualAddr) * 8);
1548 return PFN(pte) + PAGE_OFFSET(virtualAddr);
1549}
1550```
1551
1552### DTB (Directory Table Base) Finding
1553```
1554- Scan physical memory for valid CR3 values
1555- Look for kernel structures
1556- Use signature scanning
1557- Validate page table entries
1558```
1559
1560## Security Considerations
1561
1562### Ethical Use
1563```
1564- Security research only
1565- Authorized testing environments
1566- Responsible disclosure
1567- Legal compliance
1568```
1569
1570### Risk Awareness
1571```
1572- Physical hardware access required
1573- Potential system instability
1574- Detection by advanced anti-cheat
1575- Legal implications
1576```
1577
1578## Resource Organization
1579
1580The README contains:
1581- pcileech and derivatives
1582- FPGA firmware projects
1583- DMA libraries
1584- Integration tools
1585- Device emulation firmware
1586- Anti-detection implementations
1587
1588---
1589
1590## Repository Navigation
1591
1592For project selection, load [repository resource selection](references/repository-resources.md) on demand. Use the shared [repository navigation](../overview/references/repository-navigation.md) for local discovery layers, filename case, missing snapshots and currentness. Generated descriptions and wiki pages are discovery aids, not independent evidence.
1593
1594For topic discovery, see the [compiled dma-attack overview](../../../wiki/overviews/dma-attack.md). Verify its technical claims against primary sources and the actual target context.
1595
1596## Data Source
1597
1598Use the following repository sources directly when applying this skill. Prefer
1599available local files for discovery and scoped historical inspection; use the
1600raw URLs when the collection is not installed locally. These entrypoint details
1601are retained here so source lookup does not depend on loading another skill.
1602
1603### 0. Compiled Wiki
1604
1605Start with [wiki/index.md](../../../wiki/index.md) for topical synthesis and
1606cross-project connections. [Wiki schema](../../../wiki/AGENTS.md) describes its
1607structure. Generated wiki pages are discovery aids; follow their original
1608citations before adopting technical claims.
1609
1610Raw catalog: [wiki/index.md](https://raw.githubusercontent.com/gmh5225/awesome-game-security/refs/heads/main/wiki/index.md).
1611For this domain, read [wiki/overviews/dma-attack.md](../../../wiki/overviews/dma-attack.md).
1612Raw URL: [dma-attack overview](https://raw.githubusercontent.com/gmh5225/awesome-game-security/refs/heads/main/wiki/overviews/dma-attack.md).
1613
1614A direct project question can start with its README entry or description below;
1615reading the entire wiki is unnecessary.
1616
1617### 1. Project Overview and Resource Index
1618
1619[README.md](../../../README.md) contains the collection's actual categories,
1620subcategories, project URLs and short descriptions. Find the relevant category
1621and retain the original URL, including any specific file or revision suffix.
1622
1623Raw index: [README.md](https://raw.githubusercontent.com/gmh5225/awesome-game-security/refs/heads/main/README.md).
1624
1625### 2. Repository Descriptions
1626
1627For a concise project summary, look for the actual local path:
1628
1629```text
1630description/{owner}/{repo}/description_en.txt
1631https://raw.githubusercontent.com/gmh5225/awesome-game-security/refs/heads/main/description/{owner}/{repo}/description_en.txt
1632```
1633
1634Example: [bgfx description](https://raw.githubusercontent.com/gmh5225/awesome-game-security/refs/heads/main/description/bkaradzic/bgfx/description_en.txt).
1635Extract owner/repository from the original GitHub project URL, omitting a .git
1636suffix. Resolve existing path casing before constructing a local/raw path.
1637Descriptions are generated summaries, not independent verification. If absent
1638or inaccessible, use the README entry, relevant archive or original project.
1639
1640### 3. Repository Source Archives
1641
1642For deeper inspection of an available captured source tree, locate:
1643
1644```text
1645archive/{owner}/{repo}.txt
1646https://raw.githubusercontent.com/gmh5225/awesome-game-security/refs/heads/main/archive/{owner}/{repo}.txt
1647```
1648
1649Example: [bgfx archive](https://raw.githubusercontent.com/gmh5225/awesome-game-security/refs/heads/main/archive/bkaradzic/bgfx.txt).
1650Prefer inspecting the relevant portion of an existing archive over re-cloning
1651merely to inspect the same captured material. Archives may exclude files, use
1652fallback extraction or contain truncation; they are not guaranteed complete
1653checkouts. Record any upstream revision evidence and included-file limits.
1654If missing or insufficient, follow the README's original upstream URL.
1655
1656### Choose and Verify the Source
1657
1658For a specific project, locate its README identity, use a description or wiki
1659page for orientation when helpful, then inspect the relevant archive/source
1660artifact for the question. For current compatibility or exact implementation,
1661verify the matching upstream documentation, release or immutable source revision.
1662Keep the collection revision and capture/generation dates separate from the
1663upstream version. Multiple generated layers from one source are not independent
1664corroboration, and missing archive content does not establish upstream absence.
1665
1666The per-domain resource guide above helps choose useful artifacts. Shared
1667[repository navigation](../overview/references/repository-navigation.md) adds the optional read-only indexer,
1668case-ambiguity handling and maintenance details; it supplements this Data Source
1669section rather than replacing it.