def _get_member(self, offset, cexpr, obj, tinfo=None, obj_ea=None): if offset < 0: logger.error( "Considered to be imposible: offset - {}, obj - {}".format( offset, Helper.to_hex(self._find_asm_address(cexpr)))) raise AssertionError applicable = not self.crippled cexpr_ea = self._find_asm_address(cexpr) scan_obj = ScannedObject.create(obj, cexpr_ea, self.__origin, applicable) if obj_ea: if TemporaryStructure.VirtualTable.check_address(obj_ea): return TemporaryStructure.VirtualTable(offset, obj_ea, scan_obj, self.__origin) if Helper.is_code_ea(obj_ea): cfunc = Api.decompile_function(obj_ea) if cfunc: tinfo = cfunc.type tinfo.create_ptr(tinfo) else: tinfo = Const.DUMMY_FUNC return TemporaryStructure.Member(offset, tinfo, scan_obj, self.__origin) # logger.warn("Want to see this ea - {},".format(Helper.to_hex(cexpr_ea))) if not tinfo or tinfo.equals_to(Const.VOID_TINFO) or tinfo.equals_to( Const.CONST_VOID_TINFO): return TemporaryStructure.VoidMember(offset, scan_obj, self.__origin) if tinfo.equals_to(Const.CHAR_TINFO): return TemporaryStructure.VoidMember(offset, scan_obj, self.__origin, char=True) if tinfo.equals_to(Const.CONST_PCHAR_TINFO): tinfo = Const.PCHAR_TINFO elif tinfo.equals_to(Const.CONST_PVOID_TINFO): tinfo = Const.PVOID_TINFO else: tinfo.clr_const() return TemporaryStructure.Member(offset, tinfo, scan_obj, self.__origin)
def __iter_callers(self): for ea in self.__callers_ea: cfunc = Api.decompile_function(ea) if cfunc: yield cfunc