mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:50:52 +01:00
[PR #2006] tools/import_call_sites: scan direct call qword [rip+disp32] (FF 15) import call sites (IMPORT-CALL-SITES-DIRECT-FF15-CALLS) #2011
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#2011
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/2006
Author: @abnalstlll-byte
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:feat/import-call-sites-direct-ff15📝 Commits (1)
369bf54tools/import_call_sites: scan direct call qword [rip+disp32] (FF 15) import call sites📊 Changes
3 files changed (+84 additions, -6 deletions)
View changed files
📝
tests/test_import_call_sites.py(+62 -0)📝
tools/import_call_sites.py(+15 -5)📝
tools/import_fail_fast.py(+7 -1)📄 Description
Claimed in the coordination issue as: IMPORT-CALL-SITES-DIRECT-FF15-CALLS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7170156749)
What and why
tools/import_call_sites.pysearches for thunks (jmp qword [rip+disp32]/\xff\x25) and relative branches (E8/E9 rel32) to those thunks. However, MSVC and compilers also emit directcall qword [rip+disp32](\xff\x15) targeting the import's IAT slot directly without an intermediate jmp thunk (as noted in BubsMcgee's finding anddocs/xdxr.md§6 forXboxBvhBuilder.dllcall sites).CALL_INDIRECT = re.compile(b"\xff\x15")and scan executable sections for direct calls targeting import slots, recording them inentry["call"].tools/import_fail_fast.pyto identify instruction boundary sizes (rva + 6for0xFF 0x15vsrva + 5for0xE8) and deduplicate call sites when classifying results.tests/test_import_call_sites.pycovering:Tested
python -I tests/test_import_call_sites.py->Ran 26 tests in 0.091s,OKpython -I tests/test_import_fail_fast.py->Ran 10 tests in 0.066s,OKpython -I tests/test_int3_cause.py->Ran 15 tests in 0.022s,OKpython -I tests/test_x86_high_byte_writes.py->Ran 4 tests in 0.001s,OKpython -I tests/test_text_write_line_endings.py->Ran 3 tests in 12.225s,OKpython -I scripts/check_no_game_data.py tools/import_call_sites.py tools/import_fail_fast.py tests/test_import_call_sites.py->exit 0python -m compileall -q make_game.py tools tests->exit 0git diff --check->cleanTested on Windows 11 x64 (Python 3.12, stdlib tests, no game data needed).
AI-assisted (Claude Code)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.