zoukankan      html  css  js  c++  java
  • Reveal

    一、安装和简介

      a) download url

      b) Reveal 使用的方法有两种: Static Library Intefration, Dynamic Library Intefration。(我们使用 Dynamic Library Intefration)


     二、Dynamic Library Intefration

      a) 打开 Reveal -> Help -> Show Reveal Library In Finder, copy libReveal.dylib 到目标 app 的 Documents 目录。(我使用的是新浪的天气通)

      b) 创建 RevealUtil.h 和 RevealUtil.m,来自《iOS应用逆向工程》。

      RevealUtil.h

    #import <Foundation/Foundation.h>
    
    @interface RevealUtil : NSObject {
        @private
            void* revealLib;
    }
    
    - (void)startReveal;
    - (void)stopReveal;
    
    @end
    

      RevealUtil.m  

    #import "RevealUtil.h"
    #import <dlfcn.h>
    
    @implementation RevealUtil
    
    - (void)startReveal {
        NSString* revealLibName = @"libReveal.dylib";
        NSString* documentDirectory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
        NSString* dyLibPath = [documentDirectory stringByAppendingPathComponent:revealLibName];
        
        revealLib = dlopen([dyLibPath cStringUsingEncoding:NSUTF8StringEncoding], RTLD_NOW);
        
        if (revealLib == nil) {
            char *error = dlerror();
            NSLog(@"dlopen error: %s", error);
    
        } else {
            [[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:self];
        }
    }
    
    - (void)stopReveal {
        if (revealLib != nil) {
            [[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStop" object:self];
            
            if (dlclose(revealLib) == 0) {
                revealLib = nil;
                
            } else {
                char *error = dlerror();
                NSLog(@"Reveal Library could not be unloaded: %s", error);
            }
        }
    }
    
    @end
    

      c) 创建一个 Theos Tweak 项目(ref

      d) 修改 xxxtweak.plist,如下

      e) 修改 Tweak.xm 如下, (注意:这里 hook 的 class name 一定要对应,我这里是凭感觉猜的)

      f) 修改 makefile 文件,如下

      g) 打包安装到 ios 设备上,先关闭之前代开的目标应用,然后重新打开,并打开 mac 端的 Reveal,会有如下效果:(注意:保持 ios 设备和 mac 处于同一网段)

      

      

  • 相关阅读:
    Python魔法函数
    Python变量的本质与intern机制
    Python中IO概述
    自用官方文档索引(日常更新)
    关于 mysql json类型参数的查询过滤
    由于升级iOS版本导致证书丢失等一系列问题汇总
    Android系统获取手机型号和系统版本号,以及其他配置信息
    Android Debug证书过期的最佳解决方案
    关于编写高德导航Demo的手记(一)
    iOS6.0以上版本,关于NSDateFormatter的问题
  • 原文地址:https://www.cnblogs.com/eileenleung/p/3843028.html
Copyright © 2011-2022 走看看