ida 插件编写

来源:互联网 发布:网络教育本科第二学位 编辑:程序博客网 时间:2024/05/22 00:28

    今天搜索中无意间看到ida可以用python/idc编写插件,好奇之下就试了试。

   先看一个例子:

   

import idaapiclass myplugin_t(idaapi.plugin_t):    flags = idaapi.PLUGIN_UNL    comment = "This is a comment"    help = "This is help"    wanted_name = "My Python plugin"    wanted_hotkey = "Alt-F8"    def init(self):        idaapi.msg("init() called!\n")        return idaapi.PLUGIN_OK    def run(self, arg):        idaapi.msg("run() called with %d!\n" % arg)    def term(self):        idaapi.msg("term() called!\n")def PLUGIN_ENTRY():    return myplugin_t()

将上边的代码保存到一个python文件中,比如命名为test.py,然后将此文件复制到$IDADIR/plugins/ 目录下即可。这样ida启动时即可加载该插件,在output window可以看到输出信息如下:


在插件菜单中也可以看到此插件:


点击此菜单,运行插件,会输出如下结果:




简单介绍就到这里了。。。。

如果想详细了解,可参考以下网址:

1.ida作者的blog

2.ida历年的插件大赛作品


0 0