用Hopper搞定Mac迅雷的会员之去自校验

本文主要讲解最新版的子校验■■方法,离线等■■方法请看此文http://bbs.iosre.com/t/hopper-mac/1428

进入正题:
搜索特征字符串 “ForceQuit”,然后查看交叉引用,一共有2出,我们看第一处
来到这里:
000000010000b5fc mov rsi, qword [ds:0x10016ec58] ; @selector(boolForKey:), argument “selector” for method imp___got__objc_msgSend, XREF=_main+239
000000010000b603 lea rdx, qword [ds:cfstring_ForceQuit] ; @“ForceQuit”
000000010000b60a mov rdi, r13
000000010000b60d call qword [ds:imp___got__objc_msgSend]
000000010000b613 test al, al
000000010000b615 jmp 0x10000b61b

通过阅读上面的代码,我们发现有个md5的计算,下面就是几个跳转语句:把那几个跳转语句nop掉就可以了。我为了省事,就直接跳转到下一句:

000000010000b5ca mov bl, al
000000010000b5cc mov r14b, byte [ss:rbp+var_29]
000000010000b5d0 mov rdi, qword [ds:objc_cls_ref_NSUserDefaults] ; objc_cls_ref_NSUserDefaults, argument “instance” for method _objc_msgSend
000000010000b5d7 mov r12, qword [ds:0x10016ec40] ; @selector(standardUserDefaults)
000000010000b5de mov rsi, r12 ; argument “selector” for method _objc_msgSend
000000010000b5e1 call r15 ; _objc_msgSend
000000010000b5e4 mov r13, rax
000000010000b5e7 test bl, bl
000000010000b5e9 jmp 0x10000b5ef
000000010000b5eb sbb al, 0x1
000000010000b5ed add byte [ds:rax], al

000000010000b5ef movzx eax, r14b ; XREF=_main+226
000000010000b5f3 cmp eax, 0x1
000000010000b5f6 jmp 0x10000b5fc
000000010000b5f8 sgdt qword [ds:rax]
000000010000b5fb db 0x00 ; ‘.’

000000010000b5fc mov rsi, qword [ds:0x10016ec58] ; @selector(boolForKey:), argument “selector” for method imp___got__objc_msgSend, XREF=_main+239
000000010000b603 lea rdx, qword [ds:cfstring_ForceQuit] ; @“ForceQuit”
000000010000b60a mov rdi, r13
000000010000b60d call qword [ds:imp___got__objc_msgSend]
000000010000b613 test al, al
000000010000b615 jmp 0x10000b61b
000000010000b617 db 0x3f ; ‘?’
000000010000b618 db 0x01 ; ‘.’
000000010000b619 db 0x00 ; ‘.’
000000010000b61a db 0x00 ; ‘.’

000000010000b61b mov rbx, qword [ds:objc_cls_ref_NSMutableDictionary] ; objc_cls_ref_NSMutableDictionary, XREF=_main+270
000000010000b622 mov r12, qword [ds:0x10016e748] ; @selector(objectForKey:)
000000010000b629 lea rdx, qword [ds:cfstring_ThunderInstallCountDict] ; @“ThunderInstallCountDict”
000000010000b630 mov rdi, r13 ; argument “instance” for method _objc_msgSend
000000010000b633 mov rsi, r12 ; argument “selector” for method _objc_msgSend
000000010000b636 call r15 ; _objc_msgSend
000000010000b639 mov rsi, qword [ds:0x10016ec60] ; @selector(dictionaryWithDictionary:), argument “selector” for method _objc_msgSend
000000010000b640 mov rdi, rbx ; argument “instance” for method _objc_msgSend
000000010000b643 mov rdx, rax
000000010000b646 call r15 ; _objc_msgSend

3 个赞

我还以为你们谁是其中一个的马甲呢,原来是2个人,都在今天发,太巧了……

为什么我没有找到

ForceQuit
呢?

@wsdlwx @ChiChou 两位能不能把整个分析的来龙去脉再写得更清楚一点,比如,怎么发现的“ForceQuit”;逆向工程的思路比编写代码和工具使用要重要多了

新版本修改后不能正常启动,跟进以往的逆向经验,多半是再启动的时候加入了子校验,一般子校验的方法就是计算文件的crc,md5,sha等方法,windows下一般都是下createfile这个断点。因为迅雷这个代码没有经过混淆,直接找到main函数,看一下流程图就发现有个md5计算,下面有个forcequit字符串,大胆猜测就是这里了,然后仔细阅读md5下面的几个跳转语句就找到关键点了。

哈哈,太巧了,看了一下你的补丁代码,不错。

ChiChou的python写的好6,每1k文件有一个字节参与运算,这很大几率patch不到参与校验的字节,:sweat_smile:

搞了i奇艺,可以看到普通会员变vip了,也是闪退,找不到自校验。

你确定唉奇异是本地VIP?

请问Hopper如何查看交叉引用

跟IDA一样,x

谢谢狗神!

-。- 我在hopper也找不到forcequit呢?另外迅雷更新3.0了,之前的py补丁不能用了呢

迅雷更新3.0了 有方法吗

OC的方法在Hopper里面有办法查到交叉引用的地址吗?

可以先找 oc方法的字符串,看哪里引用了字符串

正解, 谢谢 @everettjf