idaPython编写插件

来源:互联网 发布:js支持统计并发访问量 编辑:程序博客网 时间:2024/05/06 14:41

最基本插件内容如下:(将其保存为*.py放到ida的plugins目录下即可)


from idaapi import *class myIdaPlugin(plugin_t):    flags=0    wanted_name="my ida plugin"    wanted_hotkey="F1"    comment="my ida plugin"    help="Something helpful"    def init(self):        msg("Ida plugin init called.\n")        return PLUGIN_OK    def term(self):        msg("Ida plugin term called.\n")    def run(self,arg):        warning("Ida plugin run(%d) called.\n"%arg)def PLUGIN_ENTRY():    return myIdaPlugin()

其中你只需要丰富run函数的功能即可。
idaPython函数包括三类:idaapi、idautils、idc。其中idaapi为ida sdk中的所有函数,你可以用这些开发强大的插件;idc为全部的idc函数,一般一个idc可能有几个idaapi函数构成,可以编写强大的脚本;idautils是idaPython功能高度集成的一套最常用函数。

0 0