首页
社区
课程
招聘
[转帖]IDA_Pro_plugin_wizard的一个bug及修正
发表于: 2009-7-29 16:09 6619

[转帖]IDA_Pro_plugin_wizard的一个bug及修正

2009-7-29 16:09
6619

转自己的贴,原发于:
http://www.team509.com/modules.php?name=News&file=article&sid=79

以前写IDA的plugin比较烦,都要手工设置很多东西,比较烦。具体设置方式可以见IDA PLUG-IN WRITING IN C/C++,3. Setting up a Build Environment
以VS为例,设置过程如下:
1 Go to File->New->Project… (Ctrl-Shift-N)
2 Expand the Visual C++ folder, followed by the Win32 sub-folder, and then select the
Win32 Project icon. Name the project whatever you like and click OK.
3 The Win32 Application Wizard should then appear, click the Application Settings
link on the left and make sure Windows Application is selected, and then tick the
Empty Project checkbox. Click Finish.
4 In the Solutions Explorer on the right hand side, right click on the Source Files
folder and go to Add->New Item...
5 Select C++ File (.cpp) under the Templates section and name the file appropriately.
Click Add. Repeat this step for any other files you want to add to the project.
6 Go to Project->projectname Properties...
7 Change the following settings (some have been put there to reduce the size of the
resulting plug-in, as VS seems to bloat the output file massively):
Configuration drop down in the top left: Select Release
Configuration Properties->General: Change Configuration Type to
Dynamic Library (.dll)
C/C++->General: Set Detect 64-bit Portability Issues checks to No
C/C++->General: Set Debug Information Format to Disabled
C/C++->General: Add the SDK include path to the Additional Include
Directories field. e.g. C:\IDA\SDK\Include
C/C++->Preprocessor: Add __NT__;__IDP__ to Preprocessor Definitions
C/C++->Code Generation: Turn off Buffer Security Check, set Basic
Runtime Checks to Default and set Runtime Library to Multi-threaded
C/C++->Advanced: Calling Convention is __stdcall
Linker->General: Change Output File from a .exe to a .plw in the IDA plugins
directory
Linker->General: Add the path to your libvc.wXX to Additional Library
Directories. e.g. C:\IDA\SDK\libvc.w32
Linker->Input: Add ida.lib to Aditional Dependencies
Linker->Debugging: No to Generate Debug Info
Linker->Command Line: Add /EXPORT:PLUGIN
Build Events->Post-Build Event: Set Command-line to your idag.exe to start
IDA after each successful build (Optional)
Click OK
8 Go to Build->Configuration Manager… and change the drop-down in the
Configuration column for your plug-in project from Debug to Release. Click OK
9 Begin to write plugin
够烦吧!

现在好了,最近发现一款IDA Pro plugin wizard的工具,安装一下,就能在VS里很方便的编写IDA的Plugin了,而且你设置好IDA的安装目录之后,编译好的plugin还会自动复制到你的IDA安装目录的plugins目录里,哈哈,实在是方便啊:-)
这个东东你可以去http://jeru.ringzero.net/?page_id=4下载。

这个东东有一个小小的bug:

如果你的IDA是按默认路径安装的,比如:C:\Program Files\IDA
由于复制编译好的plugin文件时是用一句
copy /y XXXXX.plw C:\Program Files\IDA\plugins
完成的,由于目标路径没有加上冒号,所以只要这个路径里有个空格,这条命令就死翘翘了:-(
自然,编译好的plw文件也就去不了IDA的plugins目录了。

解决方法有一个,那就是对这个东西略微修改一下,我一VS2005为例,做一个说明:
\IDA_Plugin_Wizard_VS2005\Put Contents into AppWiz\IDA Pro Plugin\Scripts\1033
这个目录下有一个default.js,这个文件的第246行
         idaBinDir = wizard.FindSymbol("BINPATH") + '\\plugins';
显然这一句就是生成有问题的这个路径的,把这句改成
         idaBinDir = '\"' + wizard.FindSymbol("BINPATH") + '\\plugins\"';
就可以了。


[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

收藏
免费 7
支持
分享
最新回复 (2)
雪    币: 647
活跃值: (564)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
2
你们的主页总算更新了,真不容易
2009-7-29 16:21
0
雪    币: 2290
活跃值: (20)
能力值: ( LV9,RANK:150 )
在线值:
发帖
回帖
粉丝
3
4242,好一段时间没更新了。
2009-7-29 17:05
0
游客
登录 | 注册 方可回帖
返回
//