コード例 #1
0
 def scan_virtual_function(self, index):
     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):
         print "[Info] Scanning virtual function at 0x{0:08X}".format(
             function.entry_ea)
         scanner = VariableScanner.DeepSearchVisitor(
             function, self.offset, 0)
         scanner.apply_to(function.body, None)
         for candidate in scanner.candidates:
             Helper.temporary_structure.add_row(candidate)
     else:
         print "[Warning] Bad type of first argument in virtual function at 0x{0:08X}".format(
             function.entry_ea)
コード例 #2
0
 def scan_virtual_function(self, index):
     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):
         print "[Info] Scanning virtual function at 0x{0:08X}".format(
             function.entry_ea)
         # TODO: Remove usage `temporary_structure' as global
         obj = Api.VariableObject(function.get_lvars()[0], 0)
         scanner = VariableScanner.NewDeepSearchVisitor(
             function, self.offset, obj, Cache.temporary_structure)
         scanner.process()
     else:
         print "[Warning] Bad type of first argument in virtual function at 0x{0:08X}".format(
             function.entry_ea)