Deduplicate image paths in victory census #1177

Merged
DoubleD17 merged 1 commit from upstream-pr/1177 into main 2026-11-25 00:13:14 +00:00
DoubleD17 commented 2026-11-24 16:20:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DoubleD17 on 2026-11-24T16:20:42Z.


Repeated input paths and overlapping scan roots can visit the same PE image more than once. This inflates the image count and can repeat diagnostics for malformed PEs.

Deduplicate PE candidates across scan roots by canonical path before reading and parsing them. Reports use the first path encountered. If canonicalization fails, use the original path as the deduplication key.

On Windows x64, the build and cargo test --locked --offline -p victory passed. CLI checks with synthetic fixtures confirmed that repeated arguments, overlapping roots, and alternate spellings count the same PE once. Two distinct files with identical bytes still count as two images. The same malformed PE now produces one diagnostic. Validation covered the Windows CLI with synthetic fixtures.

AI-assisted.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6586366835 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1177). Originally posted by [DoubleD17](https://github.com/DoubleD17) on 2026-11-24T16:20:42Z. --- Repeated input paths and overlapping scan roots can visit the same PE image more than once. This inflates the image count and can repeat diagnostics for malformed PEs. Deduplicate PE candidates across scan roots by canonical path before reading and parsing them. Reports use the first path encountered. If canonicalization fails, use the original path as the deduplication key. On Windows x64, the build and `cargo test --locked --offline -p victory` passed. CLI checks with synthetic fixtures confirmed that repeated arguments, overlapping roots, and alternate spellings count the same PE once. Two distinct files with identical bytes still count as two images. The same malformed PE now produces one diagnostic. Validation covered the Windows CLI with synthetic fixtures. AI-assisted. AI-assisted.
Zipettte commented 2026-11-24 18:06:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:00:44Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 142ec8d: cargo test -p victory passes, 1 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140027871 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1177#issuecomment-7140027871). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T18:00:44Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 142ec8d: `cargo test -p victory` passes, 1 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
mercuryVM commented 2026-11-24 20:01:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T19:14:37Z.

Review: APPROVED


Tested 142ec8d on Windows 11, RTX 5070, MSVC: builds, cargo test --workspace --no-fail-fast 607 passed, 0 failed (on our fork main).

  • Deduplicating by canonicalize() before reading is the right place: repeated arguments, overlapping roots and ../case spellings collapse, while two distinct files with the same bytes still count twice.
  • Falling back to the raw path when canonicalization fails keeps unreadable or odd paths in the scan instead of dropping them.
  • Output keeps the first spelling seen, since the canonical \?\ form is only the key.
  • Nit: no test. A small one with a temp dir passed twice, plus once through a .. spelling, would pin the count to 1.

Merged into our fork's main.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6045716021 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1177#pullrequestreview-6045716021). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T19:14:37Z. **Review:** APPROVED --- Tested 142ec8d on Windows 11, RTX 5070, MSVC: builds, `cargo test --workspace --no-fail-fast` 607 passed, 0 failed (on our fork main). - Deduplicating by `canonicalize()` before reading is the right place: repeated arguments, overlapping roots and `..`/case spellings collapse, while two distinct files with the same bytes still count twice. - Falling back to the raw path when canonicalization fails keeps unreadable or odd paths in the scan instead of dropping them. - Output keeps the first spelling seen, since the canonical `\?\` form is only the key. - Nit: no test. A small one with a temp dir passed twice, plus once through a `..` spelling, would pin the count to 1. Merged into our fork's main. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-25 01:05:49 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!1177
No description provided.