IDAPython 插件开发

一 按模版设置启动插件Python脚本在ida安装插件目录下

对应路径:/Applications/ida.app/Contents/MacOS/plugins/roy_hook_proxy.py

对应内容:

import sys
sys.path.append('/Users/xxxx/Desktop/xxTool')
from xxhook import RoyHook

def PLUGIN_ENTRY():
    return RoyHook()  

二 编写界面代码

1)安装qt designer 设计好界面保存ui文件进行代码转换

2)pyuic5 -o xx.py mytest.ui

三 编写主要功能类函数以及调用界面进行简易按钮绑定

    def run(self, arg):
        #idaapi.require('view')
        idaapi.require('main_view')
        main_window = main_view.LogSaver_MainWindow()
        if self.windows is None or not self.windows.isVisible():
            self.windows = QtWidgets.QMainWindow()
            main_window.setupUi(self.windows)
            print("123")
            main_window.pushButton.clicked.connect(self.FindFlowChar)
            self.windows.showNormal()
        pass
    def FindFlowChar(self):
        ea = idc.ScreenEA()
        for func_ea in Functions(idc.SegStart(ea), idc.SegEnd(ea)):
            func = get_func(func_ea)
            flow = FlowChart(func)
            if flow.size > 30:
                print("found susp cffed function at {0:08x}".format(func_ea))
        print("end")           

界面显示结果以及IDA初步结果:

原文地址:https://www.cnblogs.com/konf/p/14845884.html