命令行工具&&安全防护
2018-06-10 本文已影响7人
heart_领
1.debugserver(手机中有,Xcode中也有,手机上的是在Xcode安装app时安装上去的)
*debugserver在Xcode中的位置:Xcode(显示包内容)->content -> developer-> platforms-> iPhoneOS.platform->DeviceSupport->10.0(任意一个都行)->-DeveloperDiskImage.dmg( 双击)>usr->bin->debugserver
*debugserver在手机中的位置:device - >developer- >usr- >bin- >debugserver
![](https://img.haomeiwen.com/i1732937/35b60f7f2d10bdf7.png)
![](https://img.haomeiwen.com/i1732937/bc8420f976971a25.png)
1.1 使用Mac上的lldb调试app:手机上的debugserver 先连接手机上的某一个app,然后debugserver再对外提供一个端口,让外面的lldb连接手机上的debugserver
1.2 debugserver 连接app
$ debugserver *:端口号 -a 进程
注意:
*:端口:使用手机的某个端口提供服务(对外提供端口)
-a 进程:连接app (进程ID或者进程名称—MachO文件的名称)
![](https://img.haomeiwen.com/i1732937/4ff93ba90824d2e4.png)
![](https://img.haomeiwen.com/i1732937/b8c87dba13563373.png)
1.3 LLDB 启动
$ lldb (开启lldb)
1.4 lldb连接debugserver
(lldb) process connect connect:手机IP地址:debugserver服务的端口
![](https://img.haomeiwen.com/i1732937/7ecb4d8f39adb837.png)
通过USB连接
![](https://img.haomeiwen.com/i1732937/e6f04b6e8ea7170e.png)
![](https://img.haomeiwen.com/i1732937/9c940ae45e9c203e.png)
![](https://img.haomeiwen.com/i1732937/fc151496c23271c8.png)
![](https://img.haomeiwen.com/i1732937/723ae39f06cbe9cd.png)
![](https://img.haomeiwen.com/i1732937/0bb363512b3d9ca8.png)
![](https://img.haomeiwen.com/i1732937/a7b33d6e2baa8b56.png)
![](https://img.haomeiwen.com/i1732937/8732faff4af4ca1e.png)
![](https://img.haomeiwen.com/i1732937/f13676f40f4f7819.png)
为了解决有些地方报错需要给权限文件添加两个字段
![](https://img.haomeiwen.com/i1732937/48850463a87c89da.png)
![](https://img.haomeiwen.com/i1732937/4ffb5c342c811d42.png)
![](https://img.haomeiwen.com/i1732937/831ec04c90fd1a1a.png)
![](https://img.haomeiwen.com/i1732937/6250f480ba904ecb.png)
2.命令行工具、
![](https://img.haomeiwen.com/i1732937/b08985bf90637334.png)
![](https://img.haomeiwen.com/i1732937/f8f3d363b1d0393a.png)
![](https://img.haomeiwen.com/i1732937/79ffd1739041ec72.png)
![](https://img.haomeiwen.com/i1732937/0dcbff895e43e681.png)
3.反调试ptrace
![](https://img.haomeiwen.com/i1732937/6e71f465dfd3efb1.png)
![](https://img.haomeiwen.com/i1732937/d0d093665705a8b4.png)
![](https://img.haomeiwen.com/i1732937/b4af15672c3b0f0a.png)
![](https://img.haomeiwen.com/i1732937/10ae585ef5f15494.png)
![](https://img.haomeiwen.com/i1732937/efbae562ec940ae5.png)
![](https://img.haomeiwen.com/i1732937/956c2e54b8714de1.png)
4.反ptrace
![](https://img.haomeiwen.com/i1732937/0728d774e86099cc.png)
5.通过framework防护调试
![](https://img.haomeiwen.com/i1732937/ecab3e118bf20dc0.png)
安全防护