吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 10738|回复: 36
上一主题 下一主题
收起左侧

[IDA Plugin] ida pro mcp 强大的 IDA MCP 插件,AI 助力逆向分析

  [复制链接]
跳转到指定楼层
楼主
qqycra 发表于 2025-4-10 20:34 回帖奖励
本帖最后由 qqycra 于 2025-4-11 07:32 编辑

希望大家帮加分顶帖,这种先进生产力要多推广。
IDA Pro MCP + AI 打造智能逆向工作流。真是强大啊,AI 改变世界。
MCP 现在太火了,紧跟潮流,坛友发了GhidraMCP贴,我来发 IDA MCP 贴。



ida-pro-mcp 可用功能:check_connection:检查IDA插件是否正在运行。
get_metadata():获取有关当前 IDB 的元数据。
get_function_by_name(name):通过函数名称获取函数。
get_function_by_address(address):通过地址获取函数。
get_current_address():获取用户当前选择的地址。
get_current_function():获取用户当前选择的功能。
convert_number(text, size):将数字(十进制、十六进制)转换为不同的表示形式。
list_functions(offset, count):列出数据库中的所有函数(分页)。
list_strings(offset, count):列出数据库中的所有字符串(分页)。
search_strings(pattern, offset, count):搜索包含给定模式的字符串(不区分大小写)。
decompile_function(address):反编译给定地址的函数。
disassemble_function(start_address):获取函数的汇编代码(地址:指令;注释)。
get_xrefs_to(address):获取给定地址的所有交叉引用。
get_entry_points():获取数据库中的所有入口点。
set_comment(address, comment):为函数反汇编和伪代码中给定的地址设置注释。
rename_local_variable(function_address, old_name, new_name):重命名函数中的局部变量。
rename_global_variable(old_name, new_name):重命名全局变量。
set_global_variable_type(variable_name, new_type):设置全局变量的类型。
rename_function(function_address, new_name):重命名函数。
set_function_prototype(function_address, prototype):设置函数的原型。
declare_c_type(c_declaration):从 C 声明创建或更新本地类型。
set_local_variable_type(function_address, variable_name, new_type):设置局部变量的类型。


使用先决条件:
Python (3.11 or higher)
        Use idapyswitch to switch to the newest Python version
IDA Pro (8.3 or higher, 9 recommended)
Supported MCP Client (pick one you like)
        Cline
        Roo Code
        Claude:

安装使用过程,使用 vs code 插件 cline

1、下载安装ida-pro-mcp
pip install --upgrade git+https://github.com/mrexodia/ida-pro-mcp
ida-pro-mcp --install

2、vs code 市场安装 cline 后点击 cline 图标然后点击小齿轮选deepseek并填写 api key
https://marketplace.visualstudio ... udrizwan.claude-dev
https://code.visualstudio.com/docs/?dv=win64user

3、点小书架,再点 installed,里面应该有 github.com/mrexodia/ida-pro-mcp 这个 mcp server
     IDA里点 Edit ---> Plugins ---> MCP,此时在 output 窗口提示 [MCP] Server started at http://localhost:13337

4、勾选 Auto-approve 左边方框,再点后面大于号,勾选 use mcp servers

5、然后输入提示词
        你的任务是使用 IDA Pro 分析一个文件。你可以使用 MCP 工具来检索信息。一般来说,使用以下策略:
        检查反编译并添加注释以说明您的发现
        将变量重命名为更合理的名称
        如有必要,更改变量和参数类型(尤其是指针和数组类型)
        更改函数名称,使其更具描述性
        如果需要更多详细信息,请拆解该函数并添加注释和您的发现
        切勿自行转换进制。如有需要,请使用 convert_number MCP 工具!
        不要尝试暴力破解,任何解决方案都只能通过反汇编和简单的 Python 脚本来获得。
        创建一份 report.md,其中包含你的发现和最后采取的步骤
        当你找到解决方案时,提示用户使用你找到的密码进行反馈


6、分析函数,修改变量名,修改函数名,添加注释,看你的要求了。
效果图的tokens花了我几块钱,希望大家给点热心温暖我一下。


效果展示:
sub_5c54c4 函数处理前


处理后:

免费评分

参与人数 15吾爱币 +15 热心值 +12 收起 理由
纳锋 + 1 热心回复!
连晋 + 1 + 1 谢谢@Thanks!
lyrong2008 + 1 用心讨论,共获提升!
358059103 + 1 + 1 我很赞同!
djhell + 1 + 1 用心讨论,共获提升!
xiaofengi + 1 用心讨论,共获提升!
杨辣子 + 1 + 1 谢谢@Thanks!
Carinx + 1 + 1 谢谢@Thanks!
salili + 1 + 1 我很赞同!
泊舟 + 1 + 1 谢谢@Thanks!
wodekk + 1 + 1 热心回复!
ytfh1131 + 1 + 1 谢谢@Thanks!
yyb414 + 1 + 1 热心回复!
xhr2025 + 1 + 1 用心讨论,共获提升!
Makefishr + 1 + 1 我很赞同!

查看全部评分

本帖被以下淘专辑推荐:

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

推荐
dkmg 发表于 2025-4-11 11:50

Large Language Models (LLMs) are powerful tools, but they can sometimes struggle with complex mathematical calculations or exhibit "hallucinations" (making up facts). Make sure to tell the LLM to use the conver_number MCP and you might also need math-mcp for certain operations.

Another thing to keep in mind is that LLMs will not perform well on obfuscated code. Before trying to use an LLM to solve the problem, take a look around the binary and spend some time (automatically) removing the following things:

    String encryption
    Import hashing
    Control flow flattening
    Code encryption
    Anti-decompilation tricks

You should also use a tool like Lumina or FLIRT to try and resolve all the open source library code and the C++ STL, this will further improve the accuracy.
推荐
CZ水星 发表于 2025-5-5 22:41
难受,折腾了一天没搞定,我python3.11安装好了也已经装了相关库,按照说明,pip install --upgrade git+https://github.com/mrexodia/ida-pro-mcp,ida-pro-mcp --install这两步也可以正常执行,然后在C盘的Roaming\Hex-Rays\IDA Pro\plugins文件加下也看到了mcp-plugin.py文件,但是这样启动IDA看不到插件,我在网上查一下说要把server.py也复制进去,我就将github上面的包下下来,将里面的server.py放到C盘这个目录,这时候启动IDA,确实看到了插件,但是报错说缺少mcp的库,我已经用pip安装了,同时观察到自动生成了一个新文件server_generated.py,请问大佬,我这个是啥问题,没搞明白
C:\Users\XX\AppData\Roaming\Hex-Rays\IDA Pro\plugins\server_generated.py: name 'mcp' is not defined
Traceback (most recent call last):
  File "D:\Tool\IDApro9.1\python\ida_idaapi.py", line 501, in IDAPython_ExecScript
    exec(code, g)
  File "C:/Users/XX/AppData/Roaming/Hex-Rays/IDA Pro/plugins/server_generated.py", line 48, in <module>
    @mcp.tool()
     ^^^
NameError: name 'mcp' is not defined
沙发
 楼主| qqycra 发表于 2025-4-10 20:46 |楼主
3#
hj4838448 发表于 2025-4-10 21:04
虽然看不懂,但是大受震撼
4#
weiaifenxiang 发表于 2025-4-10 22:20
不太会用呀
5#
高山!&流水 发表于 2025-4-10 22:20
感觉很多需要人力分析的事情,以后AI好像都能做了,是不是又是一个挑战哟
6#
KingDan25 发表于 2025-4-11 00:39
牛逼,AI改变了很多事情
7#
colaraa 发表于 2025-4-11 01:13
以后是不是就不用自己分析了
8#
ziliansha 发表于 2025-4-11 09:20
厉害了。。
9#
ciker_li 发表于 2025-4-11 09:33
Claude需要梯 子吗
10#
qzquzhou 发表于 2025-4-11 10:11
AI越来越强大了,试验看看,谢谢楼主。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - 52pojie.cn ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2026-1-31 07:23

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表