Beispiel #1
0
def check_ida():
    if idaapi.IDA_SDK_VERSION < 700:
        BinaryAILog.log(BinaryAILog.ERROR, "Need IDA >= 7.0")
        return False
    if not idaapi.init_hexrays_plugin():
        BinaryAILog.log(BinaryAILog.ERROR,
                        "Hex-Rays decompiler does not exists")
        return False
    return True
Beispiel #2
0
 def init(self):
     if not idaapi.is_idaq():
         BinaryAILog.log(BinaryAILog.INFO,
                         "Plugin should be loaded in idaq mode")
         return idaapi.PLUGIN_SKIP
     if check_ida():
         bai_mgr = BinaryAIManager()
         ui_mgr = UIManager(BinaryAIIDAPlugin.wanted_name, bai_mgr)
         if ui_mgr.register_actions():
             return idaapi.PLUGIN_KEEP
         else:
             BinaryAILog.log(BinaryAILog.ERROR, "Register actions failed")
     return idaapi.PLUGIN_SKIP