CLI: resolve same-directory title DLL exports in census #2037
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2039"
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 fuzeofficlal on 2026-11-25T03:52:00Z.
Summary
victory census, indexing exports of scanned DLLs by canonical parent directory and ASCII-lowercased filename.titlecolumn instead of reporting them as unresolvedmissinghost/HLE gaps, while preserving cross-directory scan-order independence and existingFunctionKey/ canonical-path deduplication.Fixes #838
Testing
cargo test -p victory --lockedcargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo xtask policyImported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:57:01Z.
Review: COMMENTED
Static review only: apps/CLI are Windows-only paths — nothing compiles or runs on macOS; source review of the diff.
CLI census resolves same-directory title DLL exports — path-resolution fix for the offline census tool.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T03:57:06Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, Rust 1.98.1 MSVC):cargo test -p victory— 16 passed, 0 failedcargo clippy -p victory --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean resolution of same-directory title DLL exports in
censuswith thorough test coverage. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T04:08:00Z.
Triage verdict — Keep for #838, distinguish forwarder declarations from resolved imports (
0c8615f)Evidence
FooFwd -> other.Target, supplies no target DLL, and expects three title resolutions and zero missing. Export index · Forwarder fixtureGetProcAddressand only reports a title import when it obtains an address. A forwarder declaration alone does not establish that its target is reachable. Runtime resolver · Export lookup · PE forwarder formatChecks and limits
Next step
This verification was AI-assisted.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T04:44:21Z.
Updated in
6f8735f9— good catch @jeremygold02.TitleExportsnow distinguishes direct RVA exports from forwarder strings and verifies each forwarder target againstHleResolver(HLE /HostPolicy) or same-directory title DLL exports, guarded by a visited set andMAX_FORWARD_HOPS = 16bound for cycles. Updated the forwarder fixture to chain through real same-directory and HLE targets, and addeddangling_and_cyclic_forwarders_stay_missingcovering missing target DLLs, missing target symbols/ordinals, mutual cycles, and self-loops.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T09:20:02Z.
Automated triage for the maintainers.
Merge candidate.
apps/victory/src/census.rs:collectparses every image first and indexes the direct exports of scanned DLLs by canonical directory and lowercase file name;tally_imagethen counts an import that neither HLE nor the host policy covers astitlewhen a same-directory DLL thattitle_dllallows exports it, replacing the oldunreachable!("census maps no title DLLs")arm. As asked in the second look, the forwarder chain is gone:TitleExports::insert_allskips exports with no RVA, so forwarded exports stay missing, andExportTarget,parse_forwarder,MAX_FORWARD_HOPSand the forwarder tests are removed. The branch is one commit onf3578e3, after #1863, and keeps its scan-loop changes; tests use synthetic PE data written to a temp directory only.CI: passing (
check).On your reply: checked, the simplification matches what was asked.
Recommending a look, not approving.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:02:46Z.
Automated triage for the maintainers, second look (a review against
main, with the PR built and tested).The title column is right, and this can be merged once it is simplified and rebased. Please drop the forwarder chain: no title DLL forwards an export, and the chain counts HLE targets that the Windows loader would not use. In
apps/victory/src/census.rsTitleExports::insert_all, index only exports withe.rva.is_some(), so that a forwarded export stays missing, and deleteExportTarget,parse_forwarder,MAX_FORWARD_HOPSandresolves_title_export_inner(a plaintitle_dll(..)check plus an export lookup is enough), thedangling_and_cyclic_forwarders_stay_missingtest, the Forward cases ofresolves_same_dir_title_dll_exports_by_name_ordinal_and_forward, andExportSpec::Forwardin the PE builder. Then rebase ontomain: #1863, merged today, changed the same scan loop.Push the change and it will be reviewed again. Thank you for the contribution.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T22:30:20Z.
Simplified and rebased onto
main(f3578e3) inf12f217per second-look feedback:ExportTarget,parse_forwarder,MAX_FORWARD_HOPS,resolves_title_export_inner).TitleExports::insert_allnow indexes only direct exports (e.rva.is_some()), so forwarded exports remain missing, andresolves_title_exportis a plaintitle_dll(&resolver.host, dll_key)check plus set lookup.dangling_and_cyclic_forwarders_stay_missing, theForwardcases in the resolution test, andExportSpec::Forwardfrom the synthetic PE builder.cargo test -p victory census(9/9 passed),cargo clippy -p victory --all-targets -- -D warnings, andcargo xtask policy(190 files ok).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.