dumpdecrypted砸壳

dumpdecrypted 砸壳

一、dumpdecrypted源码地址

github地址

二、确认要砸壳的iOS系统版本

即iOS版本需要与SDK版本相同。注意,5.1版SDK编译出的dylib是向下兼容的,可以用于iOS5.0,6.1版SDK同理。

三、提取需要的SDK版本

下载旧版本的Xcode,然后把里面的SDK提取出来。
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs 把Xcode这个文件夹提取出来放在桌面。

四、修改MakeFile和修改源码

修改

SDK=`xcrun --sdk iphoneos --show-sdk-path`

改成

SDK=~/Desktop/SDKs/iPhoneOS8.X.sdk

再将dumpdecrypted.c第76行的

if (lc->cmd ==LC_ENCRYPTION_INFO || lc->cmd == LC_ENCRYPTION_INFO_64)

改成

if(lc->cmd == LC_ENCRYPTION_INFO)

五、编译dumpdecrypted.dylib

接着直接cd到“~/Desktop/dumpdecrypted-master/”下,然后输入“make”并回车,在当前目录下生成dumpdecrypted.dylib
不想自己编译的话,我已经全部编译好了6.0,7.0,8.0
dumpdecrypted.dylib和源码地址

六、去掉arm64

虽说现在IDA6.9已经支持arm64,但是arm64还是很难看啊,去掉arm64之后就方便多了
1、把/var/mobile/Applications/XXXXXX/TargetApp.app/XXXTargetApp 复制到mac上
2、执行命令行

lipo xxx -remove arm64 -output xxx.remove

七、砸壳

1、把dumpdecrypted.dylib放到iOS砸壳app的Document下

2、cd到iOS中dumpdecrypted.dylib的目录下

3、输入命令行,回车砸壳完毕

DYLD_INSERT_LIBRARIES=dumpdecrypted.dylib /var/mobile/Applications/XXXXXX/TargetApp.app/XXXTargetApp

4、显示

[+] detected 32bit ARM binary in memory.
[+] offset to cryptid found: @0x81a78(from 0x81000) = a78
[+] Found encrypted data at address 00004000 of length 6569984 bytes - type 1.
[+] Opening /private/var/mobile/Containers/Bundle/Application/03B61840-2349-4559-B28E-0E2C6541F879/TargetApp.app/TargetApp for reading.
[+] Reading header
[+] Detecting header type[+] Executable is a plain MACH-O image
[+] Opening TargetApp.decrypted for writing.
[+] Copying the not encrypted start of the file
[+] Dumping the decrypted data into the file
[+] Copying the not encrypted remainder of the file
[+] Setting the LC_ENCRYPTION_INFO->cryptid to 0 at offset a78
[+] Closing original file[+] Closing dump file

八、完成

class-dump、IDA 可以开始使用啦

你可能感兴趣的:(dumpdecrypted砸壳)