upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tools/rtti_scan.py
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-23 11:30:38 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 05:51:32 -0500
commit558b1b4e896a8b301668e1632479bd02ee1e77da (patch)
treedcabd89f87f10931236e24423a5186b21205e382 /tools/rtti_scan.py
parent21625bca8c675c62f9dbffc318ce6a59d57faf31 (diff)
rtti_scan: scan the last aligned qword of a section for a COL pointer
The vtable scan stopped at hi - 8 (exclusive), so the qword at hi - 8, the last one that fits in the section, was never read. The bound is hi - 7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tools/rtti_scan.py')
-rw-r--r--tools/rtti_scan.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/rtti_scan.py b/tools/rtti_scan.py
index 9082b2f6d..c2d2ae0b9 100644
--- a/tools/rtti_scan.py
+++ b/tools/rtti_scan.py
@@ -463,7 +463,7 @@ def scan_pe64_rtti(data: bytes) -> dict:
463 continue 463 continue
464 lo = sec["virtual_address"] 464 lo = sec["virtual_address"]
465 hi = min(lo + sec["virtual_size"], len(img)) 465 hi = min(lo + sec["virtual_size"], len(img))
466 for p in range((lo + 7) & ~7, hi - 8, 8): 466 for p in range((lo + 7) & ~7, hi - 7, 8):
467 q = struct.unpack_from("<Q", img, p)[0] 467 q = struct.unpack_from("<Q", img, p)[0]
468 if q in col_vas: 468 if q in col_vas:
469 vt = p + 8 469 vt = p + 8