Skip to content

Windows: stop svcscan repeating service records - #2108

Open
mnrkbys wants to merge 1 commit into
volatilityfoundation:developfrom
mnrkbys:fix-svcscan-seen
Open

mnrkbys wants to merge 1 commit into
volatilityfoundation:developfrom
mnrkbys:fix-svcscan-seen

Conversation

@mnrkbys

@mnrkbys mnrkbys commented Nov 18, 2026

Copy link
Copy Markdown

Problem

On Vista and later, SvcScan.service_scan() walks the service list from every serH hit and stops at a record it has already yielded (if service_record in seen: break). service_record there is the tuple from get_record_tuple(), not the record. Absent values (NotApplicableValue, UnreadableValue) do not define equality, so two instances never compare equal, and the PID of a stopped service is a NotApplicableValue created anew on every walk. A tuple holding one never matches, so the walk does not stop and records are yielded again from every later hit.

Change

Track the offsets of the records already yielded (the first item of the tuple, service_record.vol.offset) in a set and stop at a known offset. The plugin gets a patch version bump. svcdiff, which calls service_scan(), benefits from the same fix.

Testing

Windows 10 19041 memory image from the public DFIR Madness case "The Stolen Szechuan Sauce" (DESKTOP-SDN1RPT.mem), windows.svcscan:

  • before: 43,221 rows, 727 distinct rows, 727 distinct offsets, one row repeated up to 110 times
  • after: 727 rows, all distinct, the same 727 offsets

ruff check and ruff format --check pass with the repository's configuration.

This change was prepared with the help of an AI assistant (Claude). I have reviewed and tested it.

service_scan() stops walking a service list at a record it has already
yielded, but compared the yielded tuples. A tuple holding an absent value
(NotApplicableValue, created anew on every walk) never equals another, so a
record with one was yielded again from every later "serH" hit. Compare by the
record's offset instead.

On a Windows 10 19041 image (DFIR Madness Case 001, DESKTOP-SDN1RPT) this
reduces 43,221 rows to the 727 distinct records, with nothing dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant