FridaHook环境搭建

FridaHook环境搭建

1
2
3
pip install frida==14.2.18 --proxy=127.0.0.1:7890 #设置 clash 代理加速下载

pip install frida-tools==9.2.5 --proxy=127.0.0.1:7890 #设置 clash 代理加速下载

WebStorm 修改终端:

http://cdn.wutongliran.top/img/image-20240402110632294.png

4.1、配置 npm 环境变量:

找到 npm 路径

http://cdn.wutongliran.top/img/image-20240402110804436.png

添加环境变量

http://cdn.wutongliran.top/img/image-20240402110903118.png

重启电脑

4.2、配置 frida 局部代码提示

打开代码目录下的终端:

1
npm i @types/frida-gum

http://cdn.wutongliran.top/img/image-20240402111010095.png

4.3、代码补全忽略大小写:

http://cdn.wutongliran.top/img/image-20240402111236827.png

5.1、下载安装 frida-server

下载地址:https://github.com/frida/frida/releases/tag/14.2.18

查询模拟器/真机架构:

1
adb shell getprop ro.product.cpu.abi

http://cdn.wutongliran.top/img/image-20240402121918575.png

选择 Android 端

http://cdn.wutongliran.top/img/image-20240402121811670.png

把 frida-server 推送到模拟器/真机 (记得先解压)

1
adb push frida-server-14.2.18-android-x86_64 /data/local/tmp/fsx86_64

5.2、运行 frida-server

1
2
3
4
5
adb shell #进入adb shell
su #切换管理员
cd /data/local/tmp #到frida-server所在目录
chmod 777 fsx86_64 #赋予执行权限
./fsx86_64 #运行frida-server

5.3、开启端口转发

1
adb forward tcp:27042 tcp:27042

5.4、运行 frida 脚本

1
frida -U -F -l demo.js