美文网首页Swift&Objective-C
Reveal-分析任意App视图结构的利器(Reveal Loa

Reveal-分析任意App视图结构的利器(Reveal Loa

作者: 郭秀才 | 来源:发表于2016-07-10 22:52 被阅读2292次
  • 一款强大的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


配置图
步骤3:打开Reveal,左上方选择App,Done!

相关文章

网友评论

    本文标题:Reveal-分析任意App视图结构的利器(Reveal Loa

    本文链接:https://www.haomeiwen.com/subject/bwwdjttx.html