import_call_sites: count call sites for delay-loaded imports #464
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/464"
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 ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-11-24T05:49:58Z.
Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123316122
What changed
tools/pe_inspect.py: Share the bounded descriptor parser (import_descriptors) withtools/import_call_sites.pyand add optionalva_entriessupport inthunk_names()for legacy VA delay-import lookup entries while keepingpe_inspect's own output unchanged.tools/import_call_sites.py: Enumerate PE32+ delay-loaded import IAT slots (named and ordinal, RVA and legacy VA descriptors) alongside ordinary imports, preserving tuple-based DLL/name matching (including inunmatched_selectors). Requires positive, mappedszName,pIAT, andpINTRVAs; ordinary imports take precedence on slot collisions.tests/test_import_call_sites.py: Synthetic PE32+ tests covering RVA/VA descriptors, named/ordinal delay imports, ordinary-import coexistence and collisions, missing/underflowedpINT, RVA-0 DLL-name rejection, and truncated tables.Testing & Disclosure
gpt-6.2-sol) and reviewed with Codex (gpt-6.2-astra).ubiquitarianism/leonidamain(8f481cf16):test_import_call_sites.py(21/21),test_pe_inspect.py(59 passed, 1 Windows-only skip),compileall,check_no_game_data.py, LF check — all passed.Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T08:53:12Z.
Merging. Why merged: delay-loaded imports are now counted, and descriptor parsing is shared in pe_inspect (not a translator input).
Why it's good: security-reviewed; on main
1c93c86: import/pe_inspect tests 78 -> 88 (9 fail without the fix); repo-consistency set 563/563.AI-assisted (Claude Code, Claude Opus 5.5).