Cache System32 PE export tables across static intake scans #137
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/138"
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 PrivacyOnion on 2026-11-21T16:53:15Z.
## Change
tools/pe_inventory.py:api_sets(system)with@cacheand moveSystem32DLL discovery (_system_images(system)) and per-DLL export-table parsing (_parsed_system_exports(path)) to module-level@cachefunctions instead of defining@cache def system_exports(name)insidescan().System32/*.dlland re-parsing the export directories ofkernel32.dll,ntdll.dll, anducrtbased.dll(~13,500 exports combined) on everyscan()call within the same Python process.tests/intake/check.py:intake_exe.pyinvocation as asubprocess.runCLI check and run the remaining verification passes in-process viaintake_exe.main(cli_args)so the cachedSystem32export tables are reused across all 9 intake passes (static_exe_intakedrops from6.41sto1.36s).Verification
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T17:17:46Z.
Caching export tables by path across scan() calls makes a second inventory stale when a DLL is replaced at the same path or the directory gains a DLL. Please scope the cache to an explicit inventory session or invalidate it on changes, and cover two scans of a modified synthetic directory.
Imported from R0Y00/Xbox2Windows. Originally posted by PrivacyOnion on 2026-11-21T17:54:10Z.
Rebased onto
mainand updatedtools/pe_inventory.pyandtests/intake/check.pyso the cache invalidates automatically on directory or file changes:scan():system_images = {p.name.lower(): p for p in system.glob("*.dll")}is enumerated freshly on eachscan()call, so any DLL added to or removed from the directory is visible immediately on the nextscan().(str(path), _file_digest(path))):_parsed_api_setsand_parsed_system_exportskey on(str(path), sha256_digest), so replacing or modifying a DLL in place at the exact same path invalidates its cached export table even within the same filesystem timestamp tick.scan()session,@cache def system_exports(name)hashes and looks up each queried DLL at most once.check_modified_directory):synth_rootandsynth_system) whereintake_provider.dllinitially hasnamed_valuepatched out (export_not_found) andintake_delay.dllis absent (provider_not_found), then overwritesintake_provider.dllin place at the same path and addsintake_delay.dllbefore a secondscan(), verifying that both changes are reflected (export_presentandbundle_exports_in).