iOS风控专题逆向工程

iOS逆向:Theos与Tweak进阶篇

2020-07-23  本文已影响0人  码小菜

目录
一,实现原理
二,使用进阶
三,实战练习:皮皮搞笑
四,实战练习:腾讯视频

一,实现原理

1,编译,打包和安装
2,加载

二,使用进阶

1,文件管理
2,版本号,序号和模式

三,实战练习:皮皮搞笑

1,目标:移除首页广告
2,用MJAppTools查询APP基本信息
3,查询列表控件的地址
4,查询列表控件的数据源
5,hook代码
%hook PPFeedPostADCell
// 移除数据
- (void)bindViewModel:(id)arg1 {

}
%end

%hook IGListAdapter
// 修改高度
- (struct CGSize)collectionView:(UICollectionView *)collectionView 
                         layout:(id)arg2 
         sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
    // %c表示获取class
    if ([cell isKindOfClass:%c(PPFeedPostADCell)]) {
        cell.backgroundColor = UIColor.redColor;
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, 20);
    }
    return %orig;
}
%end
6,最终效果

四,实战练习:腾讯视频

1,目标:移除视频广告
2,用frida-ios-dump进行脱壳
3,用all_class_dump导出头文件

1>class_dump只能导出可执行文件,有些APP会把代码封装成动态库,这样就会导致很多文件找不到
2>all_class_dump能同时导出可执行文件和动态库

4,查询相关控制器
5,hook代码
// 方法在父类中
%hook QNBPlayerVideoAdsViewController
- (id)initWithEventProxy:(id)arg1 
          withPlayerInfo:(id)arg2
withParentViewController:(id)arg3 
  withPageViewController:(id)arg4
withAddToParenViewControllerNow:(_Bool)arg5 {
    return nil;
}
- (id)initWithEventProxy:(id)arg1 
          withPlayerInfo:(id)arg2
withParentViewController:(id)arg3 
withParentEventViewController:(id)arg4
withAddToParenViewControllerNow:(_Bool)arg5 {
    return nil;
}
%end

%hook QADInteractAdBussinessVC
- (id)initWithCustomParentView:(id)arg1 {
    return nil;
}
%end

%hook QADMobileNewVideoController
- (id)initWithScenesType:(long long)arg1 screenMode:(long long)arg2 {
    return nil;
}
%end
6,最终效果
本文章仅供学习交流,如有侵权,请联系删除,谢谢!
上一篇 下一篇

猜你喜欢

热点阅读