def scan_virtual_function(self, index, temp_struct): if helper.is_imported_ea(self.virtual_functions[index].address): print("[INFO] Ignoring import function at 0x{0:08X}".format( self.address)) return try: function = idaapi.decompile(self.virtual_functions[index].address) except idaapi.DecompilationFailure: print("[ERROR] Failed to decompile function at 0x{0:08X}".format( self.address)) return if helper.FunctionTouchVisitor(function).process(): function = idaapi.decompile(self.virtual_functions[index].address) if function.arguments and function.arguments[ 0].is_arg_var and helper.is_legal_type( function.arguments[0].tif): from . import variable_scanner print("[Info] Scanning virtual function at 0x{0:08X}".format( function.entry_ea)) obj = api.VariableObject(function.get_lvars()[0], 0) scanner = variable_scanner.NewDeepSearchVisitor( function, self.offset, obj, temp_struct) scanner.process() else: print( "[Warning] Bad type of first argument in virtual function at 0x{0:08X}" .format(function.entry_ea))
def activate(self, ctx): for idx in ctx.chooser_selection: func_ea = idaapi.getn_func(idx - 1).startEA cfunc = helper.decompile_function(func_ea) obj = api.VariableObject(cfunc.get_lvars()[0], 0) if cfunc: NewDeepSearchVisitor(cfunc, 0, obj, cache.temporary_structure).process()