mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:00:52 +01:00
[PR #1855] tools/import_call_sites: bounds-check ordinary IAT slots and parse PE once in main #1868
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1868
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1855
Author: @kirigayakazima
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/import-call-sites-safety📝 Commits (1)
9a936d9tools/import_call_sites: bounds-check ordinary IAT slots and parse PE once in main📊 Changes
2 files changed (+79 additions, -20 deletions)
View changed files
📝
tests/test_import_call_sites.py(+40 -0)📝
tools/import_call_sites.py(+39 -20)📄 Description
Claimed in the coordination issue as: IMPORT-CALL-SITES-ORDINARY-IAT-BOUNDS-AND-SINGLE-PARSE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163426538)
What and why
tools/import_call_sites.py'simport_entries()against zero or unmappediat_rva/lookupRVAs (img.offset(..., 8)) and stop slot enumeration ifimg.offset(slot, 8) is None, matching the existing delay-import slot validation._call_sites_from_image()and_unmatched_from_entries()somain()parsespe_inspect.PeImageandimport_entries(img)once per CLI run instead of twice (while keeping publiccall_sites()andunmatched_selectors()signatures unchanged).tests/test_import_call_sites.py.Tested
python -I tests/test_import_call_sites.py -v->Ran 24 tests in 0.106s,OK.upstream/main(98c2f777) baseline worktree with updatedtests/test_import_call_sites.py->Ran 24 tests in 0.090s,FAILED (failures=4).python -I tests/test_ci_registration.py->Ran 16 tests in 6.127s,OK.python -I tests/test_text_write_line_endings.py->Ran 3 tests in 14.536s,OK.python -I scripts/check_no_game_data.py tools/import_call_sites.py tests/test_import_call_sites.py,python -I -m compileall -q tools/import_call_sites.py tests/test_import_call_sites.py, andgit diff --check-> exit0.GPUs tested: n/a (CPU/stdlib Python tests on Windows 11 x64)
AI-assisted: yes
Checklist
needs rebase).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.