1、先从手机内存拷贝.ipa文件出来,到当前目录下(拿到可执行MachO文件WeChat)
scp -P 2222 root@localhost:进程路径 ./
2、Xcode附加进程 、也可以通过lldb附加
找一个Xcode的工程(debug --> Attach to process --> 进程)
-
image list拿到首地址0x00000001029b4000
3、otool -l Wechat | grep crypt 查看下面三项,手动砸壳需要
-
cryptoffset 16384起始位置偏移 -
cryptsize 187236352加密部分大小 -
cryptid 1加密标识
4、从Xcode附加的进程中拷贝解密的二进制,得到WeChat.bin
memory read --force --outfile ~/Desktop/WecharDump/WeChat.bin --binary --count 187236352 0x00000001029b4000+16384
5、将二进制文件WeChat.bin写入没有解密的MachO文件,从offset位置,不截掉后面,替换中间187236352大小的部分(需要一定的时间)
-
dd seek=16384 bs=1 conv=notrunc if=./WeChat.bin of=WeCHat-
seek=16384从offset开始写入 -
bs=1一次写入多少个字节,这里是1个字节 -
conv=notrunc不截掉后面,保留后面部分
*if=./WeChat.bin输入文件 -
of=WeCHat输出文件
-
6、写入完成之后,验证class-dump -H WeChat -o ./wechatHeaders 成功即可
-
dump之前要先把cryptid手动改成0(使用MachOView打开,在LoadCommand里面,INFO_64改cryptid)











网友评论