项目
在 GitHub 查看
axhlzy/Il2CppHookScripts
axhlzy/Il2CppHookScripts has 666 GitHub stars and 182 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-15 22:58 UTC. Last push 2026-02-02.
可以做什么
- Parse Unity's method m / class c / field f / instance lfs / lfp
- parse runtime method argument b / bt / nop function n / detachAll and clean cache D
- (Batch) Hook B/BF/BN for commonly used functions, modify function return value setFunctionXXX, setActive to set gameobject active
- Wrapped "Interceptor.attach" to make it easier to use from the command line A(ptr,(args)=>{},(ret)=>{})
实测星标增长
- 24小时
- 0
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
关于
Frida-based libil2cpp.so runtime parsing script
开发工具README.zh-CN.md
原文Il2cppHook
基于 frida 的 libil2cpp.so 运行时解析脚本
功能
- 解析 Unity 的 方法
m| 类c| 字段f| 实例lfs/lfp - 解析运行时方法参数
b/bt| nop 函数n| detachAll 和清理缓存D - 批量HOOK常用函数
B/BF/BN, 修改函数返回值setFunctionXXX,setActive设置游戏对象的活动状态 - 封装 “Interceptor.attach”,使其更易于从命令行使用
A(ptr,(args)=>{},(ret)=>{}) - 更方便地查找函数
findMethods/findClasses并调用函数callFunction/findExport查找导出函数 showMethodInfo帮助我们简单地获取 Il2cppMethod* 的详细信息,获取游戏对象的详细信息使用showGameObject- 对象层次结构
PrintHierarchy/ 类型层次结构showTypeParent - 用frida和方法信息反汇编
showAsm,seeHexA表示十六进制转储 breakWithStack为 il2cpp 提供更多符号解析,breakWithArgs只显示 args- 常用HOOK封装
HookOnPointerClick/HookSetActive/B_Button/HookPlayerPrefs... - 解析挂载脚本
showComponents|PrintHierarchyWithComponents - JNI RegisterNatives 挂钩(在 JNIHelper 中植入,默认关闭 [不稳定]),使用 JNIHelper.cacheRegisterNativeItem 获取信息 !测试!
- 使用 QBDI 模拟函数的执行,使用 t(methoinfo) 或 traceFunction(mPtr) 启用替换钩子!测试!
- :confused: :confused: :confused:
安装
$ npm install il2cpp-hooker -g
然后你可以像这样使用 ↓
- frida attch current app
$ fat
- frida spawn app of ${PackageName}
$ fat ${PackageName}
- 命令行选项
$ fat -h
_ _ ______ _ _
| | |(_____ \ | | | |
| | | ____) )____ ____ ____ _____| |__ ___ ___ | | _ _____ ____
| | | / ____// ___) _ \| _ (_____) _ \ / _ \ / _ \| |_/ ) ___ |/ ___)
| | || (____( (___| |_| | |_| | | | | | |_| | |_| | _ (| ____| |
|_|_|\______)____) __/| __/ |_| |_|\___/ \___/|_| \_)_____)_|
|_| |_|
用法: fat [options] <package-name?>
选项:
-h, --help 打印使用信息。
-r, --runtime [engine] 指定 JS 引擎(qjs, v8)。默认:v8
-t,--timeout [ms] 以毫秒为单位指定调用函数前的时间。
-f,--functions[名称] 指定启动时要调用的函数,例如:-f getApkInfo();
-l, --log [path] 指定保存日志的路径。
-c,--vscode 使用 vscode 打开项目。
-v,--版本 打印版本信息。
报告错误:
axhlzy <[email protected]> (https://github.com/axhlzy/Il2CppHookScripts/)
编译
$ git clone https://github.com/axhlzy/Il2CppHookScripts.git
$ cd Il2cppHook/
$ npm install
$ npm run build & npm run compress
$ frida -U -f com.xxx.xxx -l ../_Ufunc.js
或者
$ frida -FU -l ../_Ufunc.js
或者是这样使用(未及时更新 且 需要科学上网)
frida --codeshare axhlzy/il2cpphookscripts -U -f ${PackageName}
[!]npm 软件包可能无法及时更新,因此您可以考虑使用
fat -c打开项目 并使用github actionArtifacts 替换 _Ufunc.js 文件 :hushed:
API
或
使用 vscode 打开并搜索 globalthis. 以查找更多用法
请作者喝杯咖啡 (^_^)