iOS逆向工程——使用MonkeyDev和Tweak实现app去开屏广告/水印

77 阅读1分钟

本文章中所有内容仅供学习交流使用,不用于其他任何目的,严禁用于商业用途和非法用途,否则由此产生的一切后果均与作者无关;本文章未经许可禁止转载,禁止任何修改后二次传播,擅自使用本文涉及的技术而导致的任何意外,作者均不负责。

将目标App,使用frida-ios-dump砸壳,获得解密后的ipa

把砸壳后的ipa拖入MonkeyDev工程的TargetApp目录中

使用Lookin分析UI,在MonkeyDev添加podfile文件,添加配置,执行pod install

target 'Dylib' do
    use_frameworks!
    pod 'LookinServer'
end

把ipa的machO文件拖入IDA,进行静态分析

去广告

image.png 通过Lookin,得知了开屏广告页的类和可以关闭广告的UIButton 在BURewardedVideoWebViewController这个类,,打开.h文件查看

class BURewardedVideoWebViewController: BUWebViewController <BURewardedVideoWebDefaultViewDelegate> {
    BURewardedVideoWebViewControllerVM * _videoWebVM;
    struct CGSize _originSize;
}
@property(nonatomic) struct CGSize originSize;
@property(retain, nonatomic) BURewardedVideoWebViewControllerVM *videoWebVM;
- (void).cxx_destruct;
- (void)silentButtonTappedPlayableHandle:(_Bool)arg1;
- (void)webCloseButtonTapped;
- (void)appendURLParameters;
@property(nonatomic) unsigned long long transformDirection;
@property(nonatomic) __weak UIButton * superVCCloseBtn;
@property(nonatomic) _Bool hiddenEndCardClose;
@property(nonatomic) _Bool mute;
@property(copy, nonatomic) NSString * ritScene;
@property(nonatomic) _Bool isRewardedVideo;
@property(nonatomic) _Bool isTransform;
@property(nonatomic) __weak id <BURewardedVideoWebViewDelegate> delegate;

从webCloseButtonTapped,可以推测出是一个关闭按钮的方法,现在要做的是手动调用这个方法,写hook代码

%hook BURewardedVideoWebViewController

- (void)viewDidAppeard{
     %orig;
    [self webCloseButtonTapped];
}

%end

去水印

Lookin加载水印页面,进行分析

image.png 可以看到DTWaterMarkView是水印view的类,那init的时候返回nil,看看会怎么样,写入hook代码

%hook DTWaterMarkView

- (id)initWithFrame:(CGRect)frame{
    return nil;
}

%end

可以看到app的水印消失了。