这里使用的开发环境是vs2010,不过几乎所有的设置在早期版本的vs中基本是一致的。启动vs之后关闭其他的项目和解决方案,然后按照下面的流程创作工程即可。
在左上方的配置下拉框中选择Release;
修改属性->常规,将配置类型修改为动态库DLL,目标文件扩展名修改为.plw
C/C++->常规,附加包含目录添加ida sdk include目录,例如C:\IDA\SDK\Include
C/C++->预处理器,添加__NT__;__IDP__字段到预处理器定义中。
C/C++->代码生成,关闭缓冲区安全检查,将基本运行时检查设为默认,将运行库设置为多线程(MT)
C/C++->高级,将调用约定修改为__stdcall (/Gz)
连接器->常规,将输出文件修改为你的ida插件目录,例如E:\IDA 6.2\plugins
连接器->输入,将ida.lib添加到附加依赖项中。
连接器->调试,生成调试信息设置为否
连接器->命令行添加/EXPORT:PLUGIN
生成事件->后期生成事件,将ida添加到命令行中一边每次生成之后启动加载插件运行(可以不设置)
所有配置完成时候点击保存然后关闭设置窗口,在顶部的配置栏中选择release,即可。
下面就可以开始写代码和进行测试了,这里有一个简单的插件模板,再次基础上完善即可创建一个新的插件:
#include
#include
#include
int IDAP_init(void)
{
// Do checks here to ensure your plug-in is being used within
// an environment it was written for. Return PLUGIN_SKIP if the
// checks fail, otherwise return PLUGIN_KEEP.
return PLUGIN_KEEP;
}
void IDAP_term(void)
{
// Stuff to do when exiting, generally you'd put any sort
// of clean-up jobs here.
return;
}
// The plugin can be passed an integer argument from the plugins.cfg
// file. This can be useful when you want the one plug-in to do
// something different depending on the hot-key pressed or menu
// item selected.
void IDAP_run(int arg)
{
// The "meat" of your plug-in
msg("Hello world By obaby!\n");
msg("This is My first IDA Plugin!\n");
msg("Plugin templete Created by Steve Micallef!\n");
msg("Thx for his Great Works!\n");
return;
}
// There isn't much use for these yet, but I set them anyway.
char IDAP_comment[] = "This is my test plug-in";
char IDAP_help[] = "My plugin";
// The name of the plug-in displayed in the Edit->Plugins menu. It can
// be overridden in the user's plugins.cfg file.
char IDAP_name[] = "My plugin";
// The hot-key the user can use to run your plug-in.
char IDAP_hotkey[] = "Alt-X";
// The all-important exported PLUGIN object
plugin_t PLUGIN =
{
IDP_INTERFACE_VERSION, // IDA version plug-in is written for
0, // Flags (see below)
IDAP_init, // Initialisation function
IDAP_term, // Clean-up function
IDAP_run, // Main plug-in body
IDAP_comment, // Comment �unused
IDAP_help, // As above �unused
IDAP_name, // Plug-in name shown in
// Edit->Plugins menu
IDAP_hotkey // Hot key to run the plug-in
};
最后是一张效果图,至于其他的东西,以后可以继续写点东西。
☆文章版权声明☆
* 网站名称:obaby@mars
* 网址:https://h4ck.org.cn/
* 本文标题: 《VS2010 + IDASDK6.2搭建IDA Plugin开发环境》
* 本文链接:https://cloud.tencent.com/developer/article/2223643
* 转载文章请标明文章来源,原文标题以及原文链接。请遵从 《署名-非商业性使用-相同方式共享 2.5 中国大陆 (CC BY-NC-SA 2.5 CN) 》许可协议。
分享文章: