Browse Source

Use generated vtable instead of pointer maths

nosoop 10 months ago
parent
commit
3526f5488c
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/smgdc/angr/vtable_disamb.py

+ 4 - 3
src/smgdc/angr/vtable_disamb.py

@@ -208,9 +208,10 @@ class VtableDisambiguator(angr.Analysis):
             funcsig = dh.extract_method_signature(demangler.parse(fnsym.name))
             for svt in related_vtsyms:
                 # only check functions at the same index
-                subfn_addr = self.loader.fast_memory_load_pointer(
-                    svt.rebased_addr + 0x4 * (2 + vtidx)
-                )
+                svt_first, *_ = self.get_vfptrs_from_table(svt)
+                if vtidx >= len(svt_first):
+                    continue
+                subfn_addr = svt_first[vtidx]
 
                 if subfn_addr in rebased_fnsym_addrs:
                     # skip vtable entries that call the same exact function