【iOS逆向】theos安装、环境配置、和hook简单使用
安装theos
已安装过brew
1、安装ldid

2、下载theos(直接下载可能不全)

通过gitclone指令下载

recursive表示递归
$THEOS代表下载的路径
因为我在dumpdecrypted-master中执行的命令,所以theos存储在dumpdecrypted-master中,那么
使用的话,也是在这个文件夹中操作,所以最好放在一个系统文件夹中(比如usr)。我已转移到~(home)文件夹中

配置PATH环境变量(方便在任意地方引用theos中的命令)

在bash_profile中编辑

进入编辑

一般修改后执行一遍source命令使得环境变量生效

使用
切换到桌面
nic.pl列出创建类型的项目

原正版包ID查看方法

最后得到

看端口


添加iPad的地址和端口

查找要hook的App功能的类名

通过DYLD_INSERT_LIBRARIES=dumpdecrypted.dylib脱壳得到


去掉后缀名
再通过class-dump得到的头文件


文件夹拖入sublime通过command+p查找类名
查看要hook的方法

实现hook方法

在生成的文件夹中使用make命令编译

如果报错
bogon:letweakting Lin$ make
Makefile:5: /opt/theos/makefiles/common.mk: No such file or directory
Makefile:10: /tweak.mk: No such file or directory
make: *** No rule to make target `/tweak.mk'. Stop.
则在Makefile中添加如下路径

编译完成

然后打包
注释掉theos源码theos/vendor/dm.pl/dm.pl文件中的

修改theos/makefiles/package/deb.mk中第6行的lzma改为gzip

重新make package
得到

如果在make成功之后还想make 发现报了Nothing to be done for `internal-library-compile’错误
那就把你刚才创建出来的obj删掉和packages删掉 , 然后显示隐藏文件, 你就会发现和obj同一个目录有一个.theos , 吧.theos里面的东西删掉就好了

最后安装报错

需要作端口映射[【iOS逆向】usbmuxd的安装和使用 关联sh脚本]https://www.jianshu.com/p/05dec177702d
最后安装成功

iPad会自动重启。
再次打开已经没有XMSoundPatchImageView了
