本帖最后由 清新 于 2026-1-6 23:21 编辑
声明:所有分享的知识都是这些年从一个小白慢慢积累获得,分享的内容都是热乎的。
前期内容适合小白稍微会一点编程语言的,中期内容适合能看懂汇编语言能写C++代码的,
后期看情况分享,需要会的东西比较多,本来就不咋会说话,打几个字分享已经是极限,见谅。
请注意!!!
该篇文章只适合已经有一点基础的小白,会theos,我只分享逆向过程,至于实现
我也会贴代码,如果有问题都需要你自己解决。
关于更新:闲了就更新,不要太期待,做自己。
我的准备工作:
手机:iphone 13 +
电脑:mac
软件:超级手电筒(App Store直接下载)
这是一个最简单的App,里面可供初学者学习的地方很多,以下是说的一些内容:
1、网络关闭后也能进入
2、去除相关广告
自己应该去学习的地方:
1、framework 注入 dylib
2、hook 其他库对指定的库hook
3、通过汇编代码更改代码跳转
4、通过工具进行调试、搜索、寻找有用的东西
5、能用工具尽量用成熟工具,不要想着自己写
提供几个简单易用的(看不懂就搜索一下,这些东西自己想办法搞定,不会就去搜索):
1、frIDA(objection)
2、mac初学暂时用hopper
3、越狱了的手机或者可以安装巨魔的(可能会卡)
开始正题:
我会以最简单的方式达到目的,过程如下:
首先从AppStore下载这个软件:
下载好后我们需要将这个app里面的内容分享到电脑,并且在手机上完成脱壳
安装AppsDump,之后脱壳传到电脑在电脑上进行解压,在superlight.app中寻找到可执行文件,一般比较大的就是。
查看是否脱壳(终端):otool -l superlight | grep -i crypt (0脱壳、1没有、空的脱壳了)
现在我们来导出头文件,头文件可以用很多方式导出,小白暂时使用class-dump(不要用旧的,尽量寻找已经
修改过支持swift的,否则很多软件没法用),或者找个熟悉的人分享自用的工具给你。
图如下:
header文件中就是导出来的文件
现在基本的工作已经算完成了,但是怎么才知道自己需要分析哪个代码呢?
很简单我们依然使用工具,暂时我们不说命令行之类的查看,估计对于初学者有难度。
我们继续安装一个电脑软件Reveal,或者手机直接安装一个FLEX插件(自己寻找,软件长这样,提示:在越狱商店就可以下载)
安装之后点击进入App主屏幕你会发现,关闭网络和打开网络都是同一个页面用的都是HomeViewController:
[Objective-C] 纯文本查看 复制代码 [url=home.php?mod=space&uid=593715]@interface[/url] HomeViewController : UIViewController <UIScrollViewDelegate, UITextFieldDelegate, GADBannerViewDelegate, GADFullScreenContentDelegate, SKStoreProductViewControllerDelegate>
{
UIScrollView *Scrollview;
UIView *TopbarView;
UIView *AdjustLightView;
UIView *flashLightView;
NSMutableArray *CellViewArray;
NSMutableArray *buttonArray;
UITextField *MosiTextFiled;
UIButton *LightButton;
UIView *WhiteScreen;
float brightlevel;
UIButton *blackcancelBtn;
NSArray *codearray;
NSTimer *timer1;
NSTimer *timer2;
int flashindex;
double flashtime;
UIImageView *adsImage;
AVCaptureDevice *_device;
GADBannerView *_bannerView;
GADInterstitialAd *_interstitial;
}
- (void).cxx_destruct;
@property(retain, nonatomic) GADInterstitialAd *interstitial; // @synthesize interstitial=_interstitial;
@property(retain, nonatomic) GADBannerView *bannerView; // @synthesize bannerView=_bannerView;
@property(retain, nonatomic) AVCaptureDevice *device; // @synthesize device=_device;
- (void)productViewControllerDidFinish:(id)arg1;
- (void)OpenUrl;
- (void)CancelBannerAds;
- (void)ShowCuntomads;
- (void)adDidDismissFullScreenContent:(id)arg1;
- (void)adDidPresentFullScreenContent:(id)arg1;
- (void)ad:(id)arg1 didFailToPresentFullScreenContentWithError:(id)arg2;
- (void)showInterAds;
- (void)InterAds;
- (void)bannerViewDidDismissScreen:(id)arg1;
- (void)bannerViewWillDismissScreen:(id)arg1;
- (void)bannerViewWillPresentScreen:(id)arg1;
- (void)bannerViewDidRecordImpression:(id)arg1;
- (void)bannerView:(id)arg1 didFailToReceiveAdWithError:(id)arg2;
- (void)bannerViewDidReceiveAd:(id)arg1;
- (void)addBannerViewToView:(id)arg1;
- (void)BannerAds;
- (void)ShowAdsType;
- (void)ReloadHomeView;
- (void)NoInternetView;
- (void)GetAppSettingInfo;
- (void)StopFlashLight;
- (void)flashon;
- (void)flashoff;
- (void)sliderChange:(id)arg1;
- (void)FlashLightView;
- (void)GE;
- (void)GM;
- (void)LOVE;
- (void)SOS;
- (void)NormalMorseCode;
- (void)TurnOffLight;
- (void)TurnOnLight;
- (_Bool)prefersStatusBarHidden;
- (void)TurnBack;
- (void)TurnOnFront;
- (void)FrontLightView;
- (void)LightButtonResponse:(id)arg1;
- (void)AdjustLightResponse:(id)arg1;
- (void)CancelAdjust;
- (void)CreateAdjustLightView;
- (void)MoreFunction:(id)arg1;
- (void)codeflashoff;
- (void)codeflashon;
- (id)CharToCode:(id)arg1;
- (void)SendMorse;
- (void)TopButtonResponse:(id)arg1;
- (void)viewTapped:(id)arg1;
- (void)CreateMainView;
- (void)viewDidLoad;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
现在你得到了这些方法,就很容易解决问题了,接下来就是写代码hook掉,贴上代码:
[Objective-C] 纯文本查看 复制代码 #import <UIKit/UIKit.h>
#import "AlertWindowHelper.h"
@interface HomeViewController : UIViewController
@end
%hook HomeViewController
-(void)NoInternetView {
NSLog(@"没有网络");
SEL createMainViewSel = NSSelectorFromString(@"CreateMainView");
if ([self respondsToSelector:createMainViewSel]) {
((void (*)(id, SEL))objc_msgSend)(self, createMainViewSel);
}
}
- (void)BannerAds{
NSLog(@"[Light插件] BannerAds");
}
- (void)addBannerViewToView:(id)arg1{
NSLog(@"[Light插件] addBannerViewToView");
}
- (void)ShowCuntomads{
NSLog(@"[Light插件] ShowCuntomads");
}
- (void)showInterAds{
NSLog(@"[Light插件] showInterAds");
}
- (void)InterAds{
NSLog(@"[Light插件] InterAds");
}
%end
是不是很简单,不会的话下次看评论,我会将所有问题都会统计出来,然后进行
解答。
下次分享的内容:
1、framework 注入 dylib
2、hook 指定的库
3、找到目标调用的类
4、更改函数中的逻辑,变成自己的逻辑(可能打字不太好表述)
初学者阶段我会分享这些内容(工具怎么使用都需自己搞定):
1、hook 函数
2、改变函数
3、修改汇编代码
4、分析加解密
5、修改函数内部逻辑
已脱壳的App,懒人请下载
down.txt
(72 Bytes, 下载次数: 0, 售价: 5 CB吾爱币)
|