- 一款強大的iOS View Hierarchy工具,支持動態修改view的屬性。
- 效果優于Xcode自帶的Capture View Hierarchy。
0x00 安裝與破解
V1.6.3安裝文件與破解文件
http://pan.baidu.com/s/1i4ZENrf
0x01 集成Xcode項目方法
- 為工程添加Reveal.framework
- 如果是模擬器,在工程【Build Settings】下【Other Linker Flags】添加【Any iOS Simulator SDK = -ObjC】
- 引入libz.dylib
0x02 lldb集成方法,不需要修改xcode工程
- 暫停APP運行(Pause)
- 依次輸入兩條命令
expr (Class)NSClassFromString(@"IBARevealLoader") == nil ? (void *)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2) : ((void*)0)
expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
如果運行正常,會輸出:INFO:Reveal Server Start
每運行都需要輸入別名,有點麻煩哦,可以設置一個別名來替代:
touch ~/.lldbinit
open ~/.lldbinit
command alias reveal_load expr (Class)NSClassFromString(@"IBARevealLoader") == nil ? (void *)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2) : ((void*)0)
command alias reveal_start expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
后續可以直接使用別名:
reveal_load
reveal_start
- 繼續運行 Continue
- 打開Reveal,點擊No Connection,選擇自己的程序
0x03 越獄機器上分析其他APP
Reveal的真正用途絕不是用來查看自己App的視圖結構,在越獄機器上,利用Reveal可以分析任意App的視圖結構,這對于逆向和學習優秀App的設計有很大的幫助。
前置條件
- 越獄機器
- 良好的網絡環境,Mac和iPhone處于同一WiFi
方法一 需上傳dylib和plist文件到iPhone
步驟1 越獄iPhone上安裝 OpenSSH
步驟2 ssh登錄iPhone
ssh root@IP
默認密碼:alpine
退出:exit
步驟3 準備上傳文件到iPhone
- Mac上打開Reveal -> Help -> Show Reveal Library in Finder -> iOS Library
- 拷貝libReveal.dylib, Reveal.framework到桌面
- Mac桌面創建libReveal.plist,填寫目標APP的Bundle ID
{
Filter = {
Bundles = ("com.microsoft.officelens");
};
}
步驟4 上傳文件到iPhone
scp Desktop/libReveal.dylib root@192.168.x.x:/Library/MobileSubstrate/DynamicLibraries
scp Desktop/libReveal.plist root@192.168.x.x:/Library/MobileSubstrate/DynamicLibraries
步驟5 重啟iPhone
reboot
(or)
killall SpringBoard
步驟 6 打開Reveal,打開iPhone上指定的App,在Reveal左上方選擇App。
視圖結構
方法二 無需上傳文件到iPhone
步驟1:
Cydia搜索安裝插件 Reveal Loader
步驟2:
iPhone設置里配置 Reveal Loader
配置圖