您的位置:首页 > 移动开发

APP逆向(上)

2016-08-04 00:12 253 查看

需求

最近在学习英语,下载了《每日英语听力》APP。使用几天之后,发现没有中文翻译,VIP权限限制,用起来不顺畅。萌生修改的想法,纯属学习,记录历程。(需越狱手机)

想法

一、 导出APP中的头文件

在这些头文件中,发现一个UserInfo类,其中有+ (BOOL)isVip函数。

get it!

二、 Theos

安装相关配置:

Theos

$ export THEOS=/opt/theos
$ sudo git clone git://github.com/DHowett/theos.git $THEOS
# password


ldid

$ sudo -s
# password
$ cp -R Desktop/nq/myTheos/ldid /opt/theos/bin
$ sudo chmod 777 /opt/theos/bin/ldid


CydiaSubstrate

$ sudo /opt/theos/bin/bootstrap.sh substrate
$ sudo -s

# password
$ cp -R Desktop/nq/myTheos/libsubstrate.dylib /opt/theos/lib/libsubstrate.dylib
$ sudo chmod 777 /opt/theos/lib/libsubstrate.dylib


dpkg-deb

$ cp ~/Desktop/nq/myTheos/dpkg-deb.pl /opt/theos/bin/
$ sudo chmod 777 /opt/theos/bin/dpkg-deb.pl


Theos NIC templates

$ cp ~/Desktop/nq/myTheos/theos-nic-templates-master/cydget.nic.tar /opt/theos/templates/iphone/

$ cp ~/Desktop/nq/myTheos/theos-nic-templates-master/framework.nic.tar /opt/theos/templates/iphone/

$ cp ~/Desktop/nq/myTheos/theos-nic-templates-master/notification_center_widget.nic.tar /opt/theos/templates/iphone/

$ cp ~/Desktop/nq/myTheos/theos-nic-templates-master/sbsettingstoggle.nic.tar /opt/theos/templates/iphone/

$ cp ~/Desktop/nq/myTheos/theos-nic-templates-master/xpc_service.nic.tar /opt/theos/templates/iphone/


创建工程:

启动NIC

$ /opt/theos/bin/nic.pl


输入iphone/tweak对应的数字,如为 9:

Choose a Template (required): 9


注:导出头文件时已知com.eusoft.ting-en和tingen,其余可自填

Project Name (required): hooktingen
Package Name [com.yourcompany.hooktingen]: com.leek.tingen
Author/Maintainer Name [leek]: leek
[iphone/tweak] MobileSubstrate Bundle filter [com.apple.springboard]: com.eusoft.ting-en
[iphone/tweak] List of applications to terminate upon installation (space-separated, '-' for none) [SpringBoard]: tingen
Instantiating iphone/tweak in iosregreetings/...


编写Tweak.xm:

现在可以修改之前发现的UserInfo类。

%hook UserInfo
+ (BOOL)isVip
return YES;
}
%end


修改Makefile

添加THEOS_DEVICE_IP,192.168.96.180为iPhoneIP,需与电脑同一网络。

THEOS_DEVICE_IP = 192.168.96.180


安装

make package install


结果

进入APP以后,发现部分VIP功能可用,界面卡顿。

哪里出了问题,如何处理?下回分解。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  逆向 app iOS