Repository navigation
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Vista and later,
SvcScan.service_scan()walks the service list from everyserHhit and stops at a record it has already yielded (if service_record in seen: break).service_recordthere is the tuple fromget_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 aNotApplicableValuecreated 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 callsservice_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:ruff checkandruff format --checkpass with the repository's configuration.This change was prepared with the help of an AI assistant (Claude). I have reviewed and tested it.