zoukankan      html  css  js  c++  java
  • ida plug-in helloworld

    #include <ida.hpp>
    #include <idp.hpp>
    #include <loader.hpp>
    #include <kernwin.hpp>
    
    int __stdcall IDP_init(void)
    {
      //在这里做一些校验,以确保您的插件是被用在合适的环境里。
      if ( 0 )
      {
        error("sorry!");
        return PLUGIN_SKIP;
      }
      return PLUGIN_KEEP;
    }
    
    void __stdcall IDP_term(void)
    {
      //当结束插件时,一般您可以在此添加一点任务清理的代码。
      return;                                                                       
    }
    
    // 插件可以从plugins.cfg文件中,被传进一个整型参数。
    // 当按下不同的热键或者菜单时,您需要一个插件做不同的事情时,这非常有用。
    void __stdcall IDP_run(int arg)
    {
      // 插件的实体
      msg("Hello world!
    ");
      return;
    }
    
    // 在Edit->Plugins 菜单中,插件的现实名称,它能被用户的plugins.cfg文件改写
    char IDP_name[] = "My plugin";
    char IDP_comment[] = "This is my test plug-in";
    char IDP_help[] = "My plugin";
    char IDP_hotkey[] = "Ctrl-Alt-X"; // 启动插件的热键
    
    // 所有PLUGIN对象导出的重要属性。
    plugin_t PLUGIN =
    {
      IDP_INTERFACE_VERSION, // IDA version plug-in is written for
      0, // Flags (see below)
      IDP_init, // Initialisation function
      IDP_term, // Clean-up function
      IDP_run, // Main plug-in body
      IDP_comment, // Comment – unused
      IDP_help, // As above – unused
      IDP_name, // Plug-in name shown in Edit->Plugins menu
      IDP_hotkey // Hot key to run the plug-in
    };
  • 相关阅读:
    安装maven报错及解决
    Servlet包导入
    理解SQL SERVER的逻辑读,预读和物理读以及索引
    第六章(函数)编程题二
    第六章(函数)编程题一
    第五章(使用对象) 编程题一
    第三章(循环) 编程题 4
    第四章(数组) 编程题 1
    第三章(循环) 编程题 3
    低功耗蓝牙 ATT/GATT/Service/Characteristic 规格解读
  • 原文地址:https://www.cnblogs.com/shangdawei/p/3325432.html
Copyright © 2011-2022 走看看