iOS逆向动态调试

1.拷贝越狱手机/Developer/usr/bin目录下的debugserver到Mac电脑

2.对debugserver进行瘦身(iOS11可以不用瘦身,因为只支持64位构架的程序),在debugserver所在目录输入lipo -info debugserver . 在终端输入:lipo -thinarmv7 debugserver -output debug-server

3.在xcode里新建一个plist文件

com.apple.springboard.debugapplications

    <true/>

    <key>get-task-allow</key>

    <true/>

    <key>task_for_pid-allow</key>

    <true/>

    <key>run-unsigned-code</key>

    <true/>

然后把plist文件拷贝到电脑的debugserver同一个目录下 ,在终端输入

codesign -s - --entitlements en.plist -f debugserver

可以给我们的debugserver赋上task_for_pid权限。

4.然后在终端里输入: codesign -d --entitlements - ./debugserver

查看授权文件描述, plist文件写入的东西

5.终端里输入: scp -P 2222 ./debugserver root@localhost:/usr/bin/debugserver

将debugserver拷贝到手机

6.ps aux 查看手机进程

7.Mac切换到手机 cd /usr/bin/ 以后, 输入chmod +x debugserver,给权限

10.debugserver *:1234 -a WhatsApp

11.新开一个终端,先做端口转发:iproxy 1234 1234,这样能更快的连接,新开一个终端:lldb 回车,做了端口转发输入: process connectconnect://localhost:1234,没做端口转发输入

process connectconnect://IP

12.连接成功后,输入c继续,然后image list -o -f ,获取基地址

13.拷贝基地址,然后在Hopper里运行你砸完壳以后的 可执行文件,然后找你想调试的函数名,记录下这个函数名的偏移地址,

然后在终端输入br s -a ’基地址+0x偏移地址’,开始断点调试。
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/xhzth70911/article/details/90044435