Frida游戏黑客MCP
一种模型上下文协议(MCP)服务器,提供 类似作弊引擎的功能 用于游戏破解 弗里达使AI助手和自动化工具能够执行内存扫描、值修改、模式匹配、函数挂钩和代码注入。
特性
内存操作(作弊引擎风格)
- 数值扫描:按类型在内存中查找值(int8-64、float、double、string)
- 扫描优化:狭窄的结果
scan_next,scan_changed,scan_unchanged - 图案扫描:支持通配符的字节数组(AoB)(
??) - 内存读/写:使用类型感知读取和修改内存
函数挂钩和代码注入
- 拦截功能:挂钩
onEnter/onLeaveJavaScript回调 - 替换功能:使函数返回自定义值
- 模块挂钩:挂钩
module!function名字 - 符号分辨率:解析导出到地址
流程管理
- 进程枚举:列出并筛选正在运行的进程
- 附着/分离:连接到正在运行的进程
- 出生和简历:启动进程暂停以进行早期挂钩
调试
- 断点:通过钩子实现软件断点
- 注册访问权限:在断点处读取CPU寄存器
- 模块分析:列出模块、导出、导入
窗口交互(Windows)
- 电脑屏幕截图工具:截取游戏窗口的屏幕截图
- 键盘输入:将击键发送到游戏窗口
- 窗口管理:列出、聚焦并与窗口交互
安装
# Install from PyPI (coming soon)
pip install frida-game-hacking-mcp
# Or install from source
git clone https://github.com/0xhackerfren/frida-game-hacking-mcp.git
cd frida-game-hacking-mcp
pip install -e .需求
- Python 3.10+
- 弗里达16.0+
- pywin32,枕头(Windows,用于截图功能)
pip install frida frida-tools mcp pillow
# On Windows, also install:
pip install pywin32快速开始
运行MCP服务器
# Run directly
python -m frida_game_hacking_mcp
# Or use the entry point
frida-game-hacking-mcp使用Claude Desktop进行配置
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"frida-game-hacking": {
"command": "python",
"args": ["-m", "frida_game_hacking_mcp"]
}
}
}配置其他MCP客户端
默认情况下,服务器使用stdio传输。使用以下方式连接:
- 命令:
python -m frida_game_hacking_mcp - 运输:stdio
使用示例
作弊引擎工作流程:查找和修改健康状况
1. List processes and find your game
> list_processes("game")
2. Attach to the game
> attach("game.exe")
3. Initial scan for current health value (e.g., 100)
> scan_value(100, "int32")
Found: 58,869 addresses
4. Take damage in game (health now 95)
> scan_next(95)
Narrowed to: 1,419 addresses
5. Repeat until you find the address
> scan_next(90)
Narrowed to: 3 addresses
6. Get results and modify
> get_scan_results()
> write_memory("0x12345678", "E7030000") # 999 in little-endian字节数组模式扫描
# Find code pattern (works across game updates)
> attach("game.exe")
> scan_pattern("89 47 44 ?? ?? 5B 7A", "r-x")
Found: 2 matches
# ?? = wildcard bytes
# "r-x" = executable memory regions功能挂钩
# Hook a function and log calls
> hook_function("0x401234",
on_enter="console.log('Args:', args[0], args[1]);",
on_leave="console.log('Return:', retval);")
# Make a function always return success
> replace_function("0x401234", 1)
# Hook by module and function name
> intercept_module_function("game.dll", "CheckLicense",
on_leave="retval.replace(1);")早期钩住(暂停产卵)
# Start process suspended
> spawn("C:/Games/game.exe")
# Set up hooks before code runs
> hook_function("0x401234", on_enter="...")
# Resume execution
> resume()可用工具(共42个)
过程管理(6)
| 工具 | 说明 |
|---|---|
list_processes | 枚举正在运行的进程 |
attach | 按名称或PID附加到进程 |
detach | 脱离当前流程 |
spawn | 启动进程已暂停 |
resume | 恢复生成的进程 |
get_session_info | 获取当前会话状态 |
内存操作(10)
| 工具 | 说明 |
|---|---|
read_memory | 读取地址处的字节 |
write_memory | 将字节/值写入地址 |
scan_value | 精确值的初始扫描 |
scan_next | 具有新值的窄扫描 |
scan_changed | 查找更改的值 |
scan_unchanged | 查找未更改的值 |
scan_pattern | 带通配符的AoB模式扫描 |
get_scan_results | 获取当前扫描结果 |
clear_scan | 重置扫描状态 |
list_memory_regions | 列出内存区域 |
模块信息(5)
| 工具 | 说明 |
|---|---|
list_modules | 列出加载的模块/DLL |
get_module_info | 获取模块详细信息 |
get_module_exports | 列表模块导出 |
get_module_imports | 列表模块导入 |
resolve_symbol | 将符号解析为地址 |
功能挂钩(6)
| 工具 | 说明 |
|---|---|
hook_function | 带有回调的钩子 |
unhook_function | 取下挂钩 |
replace_function | 替换功能返回 |
hook_native_function | 与通话约定挂钩 |
list_hooks | 列出活动挂钩 |
intercept_module_function | 按模块挂钩!功能 |
调试(4)
| 工具 | 说明 |
|---|---|
set_breakpoint | 设置软件断点 |
remove_breakpoint | 删除断点 |
list_breakpoints | 列出断点 |
read_registers | 读取CPU寄存器 |
脚本管理(3)
| 工具 | 说明 |
|---|---|
load_script | 加载自定义Frida JS |
unload_script | 卸载脚本 |
call_rpc | 调用脚本RPC导出 |
窗口交互(5)-仅限Windows
| 工具 | 说明 |
|---|---|
list_windows | 枚举可见窗口 |
screenshot_window | 捕获窗口为PNG/base64 |
screenshot_screen | 捕获屏幕或区域 |
send_key_to_window | 向窗口发送按键 |
focus_window | 将窗口置于前台 |
标准MCP(3)
| 工具 | 说明 |
|---|---|
list_capabilities | 列出所有工具 |
get_documentation | 获取帮助和示例 |
check_installation | 验证Frida是否已安装 |
值类型
| 类型 | 大小 | 描述 |
|---|---|---|
int8 | 1字节 | 带符号字节 |
uint8 | 1字节 | 无符号字节 |
int16 | 2字节 | 签名短 |
uint16 | 2字节 | 无符号短 |
int32 | 4字节 | 带符号的int(最常见) |
uint32 | 4字节 | 无符号整数 |
int64 | 8字节 | 签名长度 |
uint64 | 8字节 | 无符号长 |
float | 4字节 | 单精度 |
double | 8字节 | 双精度 |
string | 变量 | 以空结尾的字符串 |
扫描区域
| 地区 | 描述 |
|---|---|
rw- | 读写数据(堆、堆栈、全局变量)-值扫描的默认值 |
r-x | 可执行代码-模式扫描的默认值 |
rwx | 读写执行(罕见,经常被利用) |
r-- | 只读数据 |
平台支持
- 视窗:本地支持
- Linux:本地支持
- macOS:本地支持
- 安卓:通过frida服务器
- iOS:通过frida服务器(越狱)
用例
- 游戏黑客:记忆编辑、价值修改、培训师发展
- 安全性研究:漏洞分析,利用开发
- 逆向工程:运行时分析,API挂钩
- 软件测试:故障注入、行为修改
- 恶意软件分析:沙盒环境中的动态分析
安全通知
此工具用于:
- 教育目的
- 对您拥有或有权测试的软件进行安全研究
- 单人/离线环境下的游戏修改
请勿用于:
- 在线多人游戏中的作弊行为
- 非法规避软件保护
- 任何恶意目的
贡献
欢迎投稿!拜托:
- 复刻仓库
- 创建要素分支
- 提交拉取请求
许可证
MIT许可证-请参阅 许可证
鸣谢
链接
______________________________________________________________________
*专为人工智能辅助的游戏黑客攻击和安全研究而设计。*
