Reading Armed Thread-pool Waits From a Windows Memory Capture
A memory-forensics technique and tool for finding armed Windows thread-pool waits and enumerating timers from a single capture.
Research note / Start here
At a glance
- Question
- Can a single Windows memory capture show which thread-pool waits were armed when the image was taken?
- Status
- Tested in blind lab runs on four Windows builds
- Scope
- Windows thread-pool waits and timers in lab memory captures
- Key takeaway
- The kernel wait list supplies evidence that a wait is armed. The matching process record supplies its callback address.
On this page4 sections
A memory capture can show what was running when it was taken. I wanted to know what it could show about work that was already registered to run later. That question matters when an intruder has arranged for code to stay dormant until something wakes it.
Windows programs use thread pools to run callbacks when an object is signaled, a wait times out, or a timer expires. An armed wait leaves a record in the kernel and another in the process that registered the callback. The two records can be checked against each other in a single capture.
What the tool does
tpwaits reads a raw physical memory image or QEMU ELF core file and reports the thread-pool waits and timers it can identify. For a wait, it reports the state, the target, and the callback address when available. It also flags callback characteristics that may help an investigator decide which rows to review first.
From the repository root, run the following command on a capture taken from a paused machine. The reader uses the matching Windows kernel PDB and can fetch it from Microsoft’s symbol server.
python3 -m tpwaits run capture.raw --taken paused --out-dir results --fetch-symbols
How it works
- Find the wait in the kernel. The reader finds wait completion packets through process handle tables and checks whether each packet’s wait block is linked into a target’s wait list.
- Read the process record. The packet carries values that lead to the thread-pool wait record in process memory. The reader can recover the callback address and context from that record.
- Check the records against each other. The process record’s handles must resolve to the same packet and target. When the verification checks pass, the tool reports the wait as
armed_verified.
The timer path starts at a kernel wait packet associated with a timer queue. The reader follows that queue into process memory to read the individual timer registrations.
Results
The blind tests used purpose-built programs on four Windows builds. On Windows Server 2022 and 2025, tpwaits verified all 824 scored armed waits and reported none of 407 scored idle waits as armed. On Windows Server 2019 and Windows 10 22H2, it verified all 435 scored armed waits and reported none of 198 scored idle waits as armed.
In four runs using captures taken from inside running machines, it verified 78 of 79 scored armed waits and reported the remaining one as unknown.