|
@@ -110,7 +110,7 @@ class VtableDisambiguator(angr.Analysis):
|
|
|
raise ValueError("unknown typeinfo class", typeinfo_class_sym)
|
|
|
|
|
|
def resolve_ambiguous_vfn(
|
|
|
- self, vtidx: int, ambig_fnsyms: set[Symbol], related_vtsyms: Iterable[Symbol]
|
|
|
+ self, vtidx: int, ambig_fnsyms: set[Symbol], related_vtsyms: set[Symbol]
|
|
|
) -> Symbol | None:
|
|
|
"""
|
|
|
Resolves an ambiguous virtual function by attempting to match against symbols in related
|
|
@@ -148,11 +148,9 @@ class VtableDisambiguator(angr.Analysis):
|
|
|
if dh.get_dtor_type(demangler.parse(sym.name)) == dtype:
|
|
|
return sym
|
|
|
|
|
|
- # prevent iterable from being consumed in the first iteration
|
|
|
- rel_vtsyms = set(related_vtsyms)
|
|
|
for fnsym in ambig_fnsyms - non_class_syms:
|
|
|
funcsig = dh.extract_method_signature(demangler.parse(fnsym.name))
|
|
|
- for svt in rel_vtsyms:
|
|
|
+ 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)
|
|
@@ -175,14 +173,12 @@ class VtableDisambiguator(angr.Analysis):
|
|
|
return fnsym
|
|
|
return None
|
|
|
|
|
|
- def get_possible_vtable_set_candidates(
|
|
|
- self, vtsym: Symbol, vtidx: int
|
|
|
- ) -> Iterable[set[Symbol]]:
|
|
|
+ def get_possible_vtable_set_candidates(self, vtsym: Symbol, vtidx: int) -> set[Symbol]:
|
|
|
# It's possible that this class inherited a base version of a method that is specialized
|
|
|
# in a different part of the class hierarchy, so find the base implementor then return
|
|
|
# it along with its descendants.
|
|
|
psym = self.get_parent_vt_implementing(vtsym, vtidx)
|
|
|
- yield {psym} | self.subclass_map[psym]
|
|
|
+ return {psym} | self.subclass_map[psym]
|
|
|
|
|
|
def get_parent_vt_implementing(self, vtsym: Symbol, vtidx: int) -> Symbol:
|
|
|
# walk up parents until we reach the first one to implement this method
|