Census: deduplicate PE imports without hint #476
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/476"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by nathanbzrr on 2026-11-24T03:50:23Z.
Problem
victory censusinapps/victory/src/census.rstracked per-DLL unique functions inBTreeSet<ImportSymbol>. BecauseImportSymbolderivesEqandOrdover all fields including the advisory PEhint: u16, identicaldll!functionimports appearing across different binaries (or in both regular and delay-load import tables) with differenthintvalues were counted multiple times infuncs,hle,host, andmissingtotals, disagreeing withmissingentries (which key bye.symbol.to_string()).What changed
FunctionKey { Name(String), Ordinal(u16) }enum implementingFrom<&ImportSymbol>inapps/victory/src/census.rsso PE importhintvalues are ignored when deduplicating per-DLL functions.DllStats.functionsfromBTreeSet<ImportSymbol>toBTreeSet<FunctionKey>.tally_image()fromrun()and insertedFunctionKey::from(&e.symbol)intostats.functions.imports+delay_importsdeduplication across differinghintvalues, ordinal imports, andmissingtotal consistency.Tests (isolated branch
a3f89ed)rustfmt --edition 2024 --check apps/victory/src/census.rs: passed (exit 0).cargo test -p victory --bin victory census: 2 passed, 0 failed, 1 filtered out (census::tests::deduplicates_imports_ignoring_hint_across_images_and_delay_imports,census::tests::counts_distinct_symbols_and_dlls_separately).cargo clippy -p victory --all-targets: passed (exit 0; 0 errors/warnings inapps/victory/src/census.rs).cargo xtask policy:asset policy: 151 files ok.No game files. AI-assisted; reviewed and verified with the tests above.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T06:14:45Z.
Review: APPROVED
Tested
a3f89edon Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (266 passed, 0 failed).functionson name or ordinal alone is the right identity. The per-DLL totals now agree withmissing, which already keyed onsymbol.to_string().tally_imageis a pure move of the loop body. The new tests buildImageInfoin memory with no title data.No issues found.
AI-assisted (Claude Code).