- 解析 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) 启用替换钩子!测试!
- 😕 😕 😕
$ 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 <axhlzy@live.cn> (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.jsfrida --codeshare axhlzy/il2cpphookscripts -U -f ${PackageName}
[!]npm 软件包可能无法及时更新,因此您可以考虑使用
fat -c打开项目 并使用github actionArtifacts 替换 _Ufunc.js 文件 😯
或
使用 vscode 打开并搜索 globalthis. 以查找更多用法
请作者喝杯咖啡 (^_^)