详解iOS的冲顶大会辅助

2025-05-29 0 41

本文介绍了ios的冲顶大会辅助,分享给大家,具体如下:

详解iOS的冲顶大会辅助

详解iOS的冲顶大会辅助

由于最近冲顶大会越来越热,网上就出现了各种辅助。大都是和“跳一跳”辅助一样的套路,截图使用python文字识别然后拿到题目和选项去搜索。我想做的是脱离电脑,直接在app里拿到题目进行搜索。以上截图就是最终实现的效果。话不多说让我们直接开始。

工具

我们需要hookapp里的一些方法和修改一些界面所以就需要逆向的一些工具,我使用的是monkeydev直接安装使用,不懂的可以查看教程。至于不带壳的app可以从某助手里下载或则自己选择手动砸壳。最后就是分析工具hopper。

分析页面

我们把砸完壳的app扔进项目运行起来,查看页面

详解iOS的冲顶大会辅助

我们可以很清楚的看到问题在qacontentview下面的label中我们用hopper查看类名后面会用到

详解iOS的冲顶大会辅助

我们依照同样的方法也可以找到选项的view。我们只需要取出这些view就能获取我们想得到的信息。

编写

先说说思路通过观察界面

详解iOS的冲顶大会辅助

我发现一开始questionview就在界面上的只是alpha为0然后缩小了

详解iOS的冲顶大会辅助

所以我打算监听alpha值的变化当值为1的时候,这个时候各个view中肯定是有值也就能拿到题目和选项了(别问我为什么不用其它方法,试了很多种方法最后被迫使用这种)

接下来:

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35
chdeclareclass(_ttc10livetrivia18liveviewcontroller)

choptimizedmethod(0, self,void,_ttc10livetrivia18liveviewcontroller,viewdidload){

chsuper(0, _ttc10livetrivia18liveviewcontroller,viewdidload);

uiwindow *win = [uiapplication sharedapplication].keywindow;

uiview *view = chivar(self, _view, __strong uiview *);

cgfloat offsety = 80;

uiwebview *web = [[uiwebview alloc] initwithframe:cgrectmake(0, cgrectgetheight(view.frame)/2 + offsety, cgrectgetwidth(view.frame), cgrectgetheight(view.frame)/2 - offsety)];

web.layer.cornerradius = 4;

web.layer.maskstobounds = yes;

[win addsubview:web];

objc_setassociatedobject(self, @"searchweb", web, objc_association_retain_nonatomic);

uibutton *moveweb = [uibutton buttonwithtype:uibuttontypesystem];

[moveweb settitle:@"move" forstate:uicontrolstatenormal];

[moveweb addtarget:self action:@selector(movewebaction:) forcontrolevents:uicontroleventtouchupinside];

[moveweb setframe:cgrectmake(0, 0, cgrectgetwidth(web.frame), 45)];

moveweb.backgroundcolor = [uicolor whitecolor];

[web addsubview:moveweb];

nslog(@"%@",view.subviews[1].subviews[1]);

uiview *questionview = view.subviews[1].subviews[1];

[questionview addobserver:self forkeypath:@"alpha" options:nskeyvalueobservingoptionnew context:nil];

uilabel *qalabel = questionview.subviews[3].subviews.firstobject;

uibutton *option1 = questionview.subviews[5].subviews[0];

uibutton *option2 = questionview.subviews[5].subviews[1];

uibutton *option3 = questionview.subviews[5].subviews[2];

objc_setassociatedobject(self, @"qalabel", qalabel, objc_association_retain_nonatomic);

objc_setassociatedobject(self, @"opation1", option1, objc_association_retain_nonatomic);

objc_setassociatedobject(self, @"opation2", option2, objc_association_retain_nonatomic);

objc_setassociatedobject(self, @"opation3", option3, objc_association_retain_nonatomic);

nslog(@"%@--%@---%@---%@",qalabel,option1,option2,option3);

}

先添加到webview到window上,然后关联对象到liveviewcontroller上,留着后面用,加上button是用来控制webview的frame,下面的qalabel是存放问题的,三个optionbutton分别是三个选项。同样我们关联到controller上,我们还要监听questionview的alpha值的变化。

alpha值改变我们获取问题和选项去搜索

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20
choptimizedmethod(4, self,void,_ttc10livetrivia18liveviewcontroller,observevalueforkeypath,nsstring *,keypath,ofobject,id,object,change,nsdictionary*,change,context,void *,context){

nslog(@"%@,%@",change,keypath);

if ([change[@"new"] intvalue] != 1) return;

nsstring *questionstr = nil;

uilabel *qalabel = objc_getassociatedobject(self, @"qalabel");

uibutton *option1 = objc_getassociatedobject(self, @"opation1");

uibutton *option2 = objc_getassociatedobject(self, @"opation2");

uibutton *option3 = objc_getassociatedobject(self, @"opation3");

questionstr = [nsstring stringwithformat:@"%@ %@ %@ %@",qalabel.text,option1.titlelabel.text,option2.titlelabel.text,option3.titlelabel.text];

nsstring *wd = [questionstr stringbyaddingpercentescapesusingencoding:nsutf8stringencoding];

nsurl *url = [nsurl urlwithstring:[nsstring stringwithformat:@"http://www.baidu.com/s?wd=%@",wd]];

uiwebview *web = objc_getassociatedobject(self, @"searchweb");

[web loadrequest:[nsurlrequest requestwithurl:url]];

nslog(@"%@",questionstr);

}

最后点击button的事件我们得添加新的方法

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17
%hook _ttc10livetrivia18liveviewcontroller

%new

- (void)movewebaction:(uibutton *)btn{

nslog(@"%@",btn.superview);

uiwebview *web = btn.superview;

cgfloat top = 150;

cgfloat offsety = 80;

cgfloat originy = cgrectgetminy(web.frame) == top?(kheight/2 + offsety):top;

cgfloat webheight = cgrectgetminy(web.frame) == top?(kheight - top):(kheight/2 - offsety);

[uiview animatewithduration:.3 animations:^{

cgrect newframe = cgrectmake(0, offsety, kwidth, webheight);

web.frame = newframe;

} completion:^(bool finished) {

}];

}

采用tweak的方式写的。忘了说试图class-dump出头文件的就放弃吧,代码是oc和swift混编,所以………

代码地址因为项目过大只上传了重要的代码文件。

最后还是声明一下,写这个纯属娱乐,请勿用作商业用途,否则后果自负。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持快网idc。

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

快网idc优惠网 建站教程 详解iOS的冲顶大会辅助 https://www.kuaiidc.com/89512.html

相关文章

发表评论
暂无评论