pe_inventory: name import providers as the loader looks them up #227
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/230"
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 R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T18:49:25Z.
Change
An import descriptor can name a DLL without an extension (
intake_forward) or with a trailing dot (intake_forward.). The loader treats these names asLoadLibrarydoes: a name without an extension gets.dllappended, and a trailing dot suppresses the append and is not part of the file name.pe_inventory.pyused the stored name as is, so an import ofintake_forwarddid not match the package'sintake_forward.dlland was reported asprovider_not_foundwith no package resolution.tools/pe_inventory.py:module_name()returns the file name the loader looks for.import_tables()uses it for normal and delay descriptors. Names that already carry an extension are unchanged apart from the existing lower-casing.tests/intake/forwarders_check.py:bundled_export_forwardersrewrites the caller'sintake_forward.dlldescriptor name in place (same length, zero padded) toINTAKE_FORWARDand tointake_forward.. The first must give the same rows, bundle matches and forwarder chains as the original. The second must nameintake_forwardand find no provider, since the package holds no file of that name.docs/experiments.md: the inventory section describes the rule.Verification
--target=x86_64-pc-windows-msvcand lld-link,forwarders_check.check()run with pefile and the Windows-only calls replaced. Without thepe_inventory.pychange the new check fails (AssertionError: {'intake_forward'}: the extension-less descriptor produces a separate, unresolvedintake_forwardprovider). With it the test passes.tests/intake/paths_check.pyandtests/dependency_paths_check.pystill pass.ctest --preset dev --no-tests=error -R 'static_exe_intake|bundled_export_forwarders|conditional_import_paths|dependency_paths_controls' -Vat6fb2404on Windows 11 build 26200.9974, VS Build Tools 2022 17.14 (MSVC 14.44.35207), Windows SDK 10.0.26100, Python 3.12: 4/4 passed. The fullctest --preset dev --no-tests=errorpassed 114/114, withbvh_wave64_hardware,bvh_wave64_warpandwave_shuffle_warpskipped.cpu_import_original.dll(no entry point) was rewritten in place, zero padded, and the copy was loaded withLoadLibraryExW(..., LOAD_WITH_ALTERED_SEARCH_PATH)from a folder that also holdscpu_import_provider.dll, one child process per case:cpu_import_provider.dll(as built)mix_argsfromcpu_import_provider.dllcpu_import_providercpu_import_provider.DLLand the slot holdsmix_argsCPU_IMPORT_PROVIDERCPU_IMPORT_PROVIDER.DLL, slot holdsmix_argscpu_import_provider.Evidence and follow-up
LoadLibraryW. The measurement above shows the Windows 11 loader applies it to static imports: an extension-less name gets.DLLappended and binds, and a trailing dot suppresses the append, so no file is found. The inventory test itself reads the images and never loads them.module.symbol) already always get.dllappended and are unchanged here. Forwarded export resolution is the subject of #208.pe_mappasses the stored descriptor name to the host resolver; whether resolvers should see the normalized name is left open.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T18:51:50Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
6fb2404ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.