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:
authorFarhatFIN <260112927+FarhatFIN@users.noreply.github.com>2026-11-22 16:41:49 +0700
committerFarhatFIN <260112927+FarhatFIN@users.noreply.github.com>2026-11-22 16:41:49 +0700
commitb6d4ac879ba95ce253ed535fefb16298abb237a4 (patch)
tree7e974bb7b7d447292771e9fc5cc68e1514e31b90 /tools/rtti_scan.py
parente7584c5207e44ed51472e6aa05c781f39ea975f6 (diff)
fix(rtti): stop vtable slot counting at the section boundary
Raw padding beyond a section's virtual size can contain executable-looking pointers. Bound slot scanning to the section holding the vtable and cover both sides of that boundary with a synthetic PE.
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 e7f4522f9..5957ff422 100644
--- a/tools/rtti_scan.py
+++ b/tools/rtti_scan.py
@@ -176,7 +176,7 @@ def scan_pe64_rtti(data: bytes) -> dict:
176 if q in col_vas: 176 if q in col_vas:
177 vt = p + 8 177 vt = p + 8
178 n = 0 178 n = 0
179 while vt + 8 * (n + 1) <= len(img): 179 while vt + 8 * (n + 1) <= hi:
180 f = struct.unpack_from("<Q", img, vt + 8 * n)[0] - base 180 f = struct.unpack_from("<Q", img, vt + 8 * n)[0] - base
181 if not (0 <= f < len(img) and is_exec(f)): 181 if not (0 <= f < len(img) and is_exec(f)):
182 break 182 break