前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >VS2010 + IDASDK6.2搭建IDA Plugin开发环境

VS2010 + IDASDK6.2搭建IDA Plugin开发环境

作者头像
obaby
发布2023-02-24 11:01:15
7660
发布2023-02-24 11:01:15
举报
文章被收录于专栏:obaby@mars

这里使用的开发环境是vs2010,不过几乎所有的设置在早期版本的vs中基本是一致的。启动vs之后关闭其他的项目和解决方案,然后按照下面的流程创作工程即可。

  1. 执行菜单的File->New->Project… (Ctrl-Shift-N)打开新建工程窗口。
  2. 展开左侧的Visual C++项目模板分支,然后选择右侧的Win32 Project条目,输入工程名称,然后点击确定。
  1. 在Win32Application Wizard先到出现之后,点击左侧的Application Settings连接,在设置界面勾选Windows Application选项,然后选择Empty Project,点击完成按钮退出向导。
  1. 在左侧的解决方案浏览器中,点击源文件,执行添加,新建项添加新的源文件。
  1. 选择C++文件模板,输入文件名称然后点击添加按钮添加此文件,重复此操作知道添加完所有文件。
  1. 按照下面的格式修改项目属性。

在左上方的配置下拉框中选择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,即可。

下面就可以开始写代码和进行测试了,这里有一个简单的插件模板,再次基础上完善即可创建一个新的插件:

代码语言:javascript
复制
#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
};

最后是一张效果图,至于其他的东西,以后可以继续写点东西。

猛击此处下载pdf版本

☆文章版权声明☆

* 网站名称: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) 》许可协议。


分享文章:

相关文章:

  1. Mac IDA Pro 插件编写指南 v1.0
  2. IDA Binary Copy & Paste
  3. Ida Plugin Wizard For VS2010
  4. VS2012 RC installation breaks VS2010 C++ projects
  5. C语言:字符串详解
  6. C语言混乱代码
  7. WSock32 Hook send and recv Functions
  8. Fast IDB2Sig and LoadMap plugins(IDA)
  9. C语言二维数组 打印方阵
  10. IDA Sync Plugin v3.0.1 for IDA Pro 6.x
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2011年11月29日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 相关文章:
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档