mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:40:52 +01:00
[PR #648] [MERGED] OLD-7481: restore old upstream PR 7481 - rtti_scan: scan the last aligned qword of a section for a COL pointer #688
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#688
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/648
Author: @aslan2142
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:rtti-scan-last-slot📝 Commits (1)
558b1b4rtti_scan: scan the last aligned qword of a section for a COL pointer📊 Changes
2 files changed (+18 additions, -1 deletions)
View changed files
📝
tests/test_rtti_scan.py(+17 -0)📝
tools/rtti_scan.py(+1 -1)📄 Description
Claimed in the coordination issue as: OLD-7481 https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129329833
Restoration of my original pull request, old upstream PR 7481 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at21625bca8c; no changes beyond the rebase.What and why
scan_pe64_rttilooks for vtables by scanning each section's aligned qwords for a CompleteObjectLocator pointer.range(start, hi - 8, 8), so the qword athi - 8was never read, even though it is the last one that fits in the section.hi - 7, so every qword that fits whole inside the section is read, and none past its end.tests/test_rtti_scan.pyputs the COL pointer in the last aligned qword of a synthetic.rdata. The vtable is found atVirtualSize0x200, and nothing is found at 0x1FF, where the qword no longer fits.Tested
Linux, Python 3.14.10, CPU only, synthetic PE images built by the tests (no game files).
python -I tests/test_rtti_scan.py:main, 30/30 pass;mainwith only the new test added, 31 run and 1 fails (the new test);python -m compileall -q tools testsandgit diff --check: clean.python -I scripts/check_no_game_data.py tools/rtti_scan.py tests/test_rtti_scan.py: clean.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.