用 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、分析函数,修改变量名,修改函数名,添加注释,看你的要求了
效果展示:
sub_5c54c4 函数处理前
处理后: