吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 36263|回复: 122
收起左侧

[原创] QQ收割小分队脱壳去广告记录

  [复制链接]
Hmily 发表于 2010-3-2 16:19
QQ收割小分队4.2(beta版)这个最新版,一直都用其他会员的脱壳去广告版,今天无意自己看了下这个软件,发现其实这软件很容易去广告,下面教大家方法,我不说多详细,做个大概的记录吧

程序下载地址:http://www.176web.com/xiazai/shouge4.2.rar

看区段就知道是VMProtect所加的壳,大家别看到VMProtect就害怕,其实他只用了VMProtect的压缩功能,IAT没有加密,连入口点都没有被虚拟变形,所以难度相当于UPX,脱起来也很简单,首先你要先学会怎么调试它,关于OD被发现的问题,可以看本区的置顶帖:
http://www.52pojie.cn/thread-15368-1-1.html
http://www.52pojie.cn/thread-31095-1-1.html

第一部分:脱壳

载入OD,脱壳思路就是解码dump修复iat,直接在VirtualProtect断尾F2断点吧,然后就一直F9,从数据窗口观察数据是否被解码了,也就是401000这的代码是否被恢复了,等到发现代码恢复就可以取消断点,然后再程序的代码段.text下段,再F9下就停在程序的OEP了
0045647C     E8 68F10000            call 收割小分.004655E9                             ; VC++ 2008 OEP
00456481   ^ E9 78FEFFFF            jmp 收割小分.004562FE
00456486     8BFF                   mov edi,edi
00456488     55                     push ebp
00456489     8BEC                   mov ebp,esp
0045648B     6A 00                  push 0

IAT也很清晰:
00477000  77DCC110  ADVAPI32.LookupPrivilegeValueA
00477004  77DA796B  ADVAPI32.OpenProcessToken
00477008  77DA6C07  ADVAPI32.RegCloseKey
0047700C  77DB42F0  ADVAPI32.RegQueryValueA
00477010  77DA7832  ADVAPI32.RegOpenKeyExA
00477014  77DAEE4C  ADVAPI32.AdjustTokenPrivileges
00477018  77DA7A9B  ADVAPI32.RegQueryValueExA
0047701C  77DAE834  ADVAPI32.RegCreateKeyExA
00477020  77DAE927  ADVAPI32.RegSetValueExA
00477024  77DCB6BE  ADVAPI32.RegDeleteKeyA
00477028  77DC86A3  ADVAPI32.RegEnumKeyA

我习惯用UIF修复下IAT,很多人不会使用,做个简单的截图吧,先看程序进程的PID,填入UIF就可以了

1.jpg

设置好PID点start就自动修复IAT了,然后用LordPE来dump程序,再用ImpREC来修复IAT,关于怎么获取IAT看图

1.jpg

从UIF上可以看到:

IAT RVA  : 00800000
IAT Size : 000006D0

从OD里知道OEP的RVA是:5647C

ImpREC的选项里勾上创建新的IAT,将上面3个地址填入ImpREC,不要点自动查找IAT了,直接点获取输入表就能获取到IAT了,获取到之后修复dump下来的文件就可以了.

再说下优化程序,用CFF打开脱好的程序,其中.vmp0 .vmp1 .tls .vmp2 .reloc 这几个区段都是VMP的代码重定位还有tls区段,可以直接删除直接用CFF删除区段和数据,删除完保存再用LoadPE看PE信息,会发现很多出错的地方,什么输出表啊 重定位啊 TLS啊 还有一个载入配置啊 全部都清0:

1.jpg

这些清0后还有一个重要的地方要修改一下,是这个程序特殊的地方,特征值改成103,就是勾上选项里的一个重定位已分离选项,这样勾上后保存,才可以在win7上运行,谢谢海风指点

1.jpg

程序优化完再用海风的利器PeRebuilder优化下大小,还可以用Resource Binder或者PE_Optimizer,优化完程序大概有六百多K,差不多了,下面说说自校验

运行程序,发现挂掉了,程序还有个自校验,bp CreateFileA,然后F9,知道发现打开自身了然后返回:
0012B78C   0040D45D  /CALL 到 CreateFileA 来自 dumped_.0040D457
0012B790   0012E344  |FileName = "C:\Documents and Settings\Administrator\桌面\QQ收割小分队4.2(beta版)\dumped_.exe"
0012B794   80000000  |Access = GENERIC_READ
0012B798   00000000  |ShareMode = 0
0012B79C   00000000  |pSecurity = NULL
0012B7A0   00000004  |Mode = OPEN_ALWAYS
0012B7A4   00000000  |Attributes = 0
0012B7A8   00000000  \hTemplateFile = NULL

打开文件读文件啊,这些东西,我们一直F8走,主要是找返回,目的是回朔到断首,走到这就可以看到了:
0040E965  |.  E8 56EDFFFF      call dumped_.0040D6C0                             ;  这里就是刚刚获取文件进行校验的地方
0040E96A  |.  8B35 58E55100    mov esi,dword ptr ds:[<&shell32.ShellExecuteA>]   ;  shell32.ShellExecuteA
0040E970  |.  85C0             test eax,eax
0040E972  |.  74 1B            je short dumped_.0040E98F                         ;  校验失败就打开窗口并退出
0040E974  |.  6A 05            push 5                                            ; /IsShown = 5
0040E976  |.  6A 00            push 0                                            ; |DefDir = NULL
0040E978  |.  6A 00            push 0                                            ; |Parameters = NULL
0040E97A  |.  68 34064800      push dumped_.00480634                             ; |FileName = " http://www.176web.com/index.html"
0040E97F  |.  68 9CFE4700      push dumped_.0047FE9C                             ; |Operation = "open"
0040E984  |.  6A 00            push 0                                            ; |hWnd = NULL
0040E986  |.  FFD6             call esi                                          ; \ShellExecuteA
0040E988  |.  8BCF             mov ecx,edi
0040E98A  |.  E8 8C580200      call dumped_.0043421B
0040E98F  |>  57               push edi                                          ; /Arg1
0040E990  |.  E8 0B340000      call dumped_.00411DA0                             ; \dumped_.00411DA0

我的修改方法是直接连文件都不让他取,直接跳过去,2个字节就可以:
0040E965     /EB 28            jmp short dumped_.0040E98F                        ;  这里就是刚刚获取文件进行校验的地方

改完保存,可以运行了.

第二部分:去广告

去广告其实也不难,广告无非联网获取广告地址,然后再属性框显示出来,我们可以干掉他联网获取广告,把广告显示的属性框用资源工具设置成不可见

首先还是载入程序进入OD,搜索字符串,然后在字符串里搜索 http:// 吧,搜到不是腾讯的地址就下个段,然后直接让程序跑起来,他就自动断下来了

第一处在这里:
0040EB80   .  FFD0             call eax
0040EB82   .  83C0 10          add eax,10
0040EB85   .  894424 44        mov dword ptr ss:[esp+44],eax
0040EB89   .  6A 0D            push 0D
0040EB8B   .  8D4C24 48        lea ecx,dword ptr ss:[esp+48]
0040EB8F   .  68 D0064800      push Unpack.004806D0            ;  http://update.176web.com/farm/notice.html?v=%d
0040EB94   .  51               push ecx
0040EB95   .  C68424 D4000000 >mov byte ptr ss:[esp+D4],18
0040EB9D   .  E8 2E6EFFFF      call Unpack.004059D0

这就是软件打开程序上的广告了,可以看看地址的内容就知道,一种简单的方法就是nop掉这个地址的第一个字节,这样地址就失效了,广告自然没有了,我喜欢直接跳过这段,我是这样改的:
0040EB4F   .  8B47 20          mov eax,dword ptr ds:[edi+20]
0040EB52   .  6A 00            push 0                          ; /Timerproc = NULL
0040EB54   .  6A 64            push 64                         ; |Timeout = 100. ms
0040EB56   .  6A 64            push 64                         ; |TimerID = 64 (100.)
0040EB58   .  50               push eax                        ; |hWnd
0040EB59   .  FF15 60E25100    call dword ptr ds:[<&user32.Set>; \SetTimer
0040EB5F      E9 BC010000      jmp Unpack.0040ED20             ;  直接跳过这段,上面的SetTime不能跳过,那里是弹登陆框和检测升级用的,从这里跳到结尾就可以了
0040EB64   .  33C9             xor ecx,ecx
0040EB66   .  85C0             test eax,eax
0040EB68   .  0F95C1           setne cl
0040EB6B   .  85C9             test ecx,ecx
0040EB6D   .  75 0A            jnz short Unpack.0040EB79
0040EB6F   .  68 05400080      push 80004005

保存下修改的,继续F9,这里断下来了,这就是上面SetTimer设置的地方:
00417A68  |.  E8 03980000      call Unpack.00421270
00417A6D  |.  51               push ecx
00417A6E  |.  8BCC             mov ecx,esp
00417A70  |.  896424 28        mov dword ptr ss:[esp+28],esp
00417A74  |.  33DB             xor ebx,ebx
00417A76  |.  68 001A4800      push Unpack.00481A00            ;  update.176web.com
00417A7B  |.  899C24 18010000  mov dword ptr ss:[esp+118],ebx
00417A82  |.  E8 99E1FEFF      call Unpack.00405C20
00417A87  |.  8D4C24 48        lea ecx,dword ptr ss:[esp+48]
00417A8B  |.  E8 90990000      call Unpack.00421420
00417A90  |.  68 141A4800      push Unpack.00481A14            ;  http://update.176web.com/farm/version_v2.js
00417A95  |.  FF15 5CE65100    call dword ptr ds:[<&wininet.De>;  wininet.DeleteUrlCacheEntryA
00417A9B  |.  51               push ecx
00417A9C  |.  8BCC             mov ecx,esp
00417A9E  |.  896424 28        mov dword ptr ss:[esp+28],esp
00417AA2  |.  68 401A4800      push Unpack.00481A40            ;  /farm/version_v2.js
00417AA7  |.  E8 74E1FEFF      call Unpack.00405C20
00417AAC  |.  8D4C24 48        lea ecx,dword ptr ss:[esp+48]
00417AB0  |.  E8 EB990000      call Unpack.004214A0
00417AB5  |.  3BC3             cmp eax,ebx
00417AB7  |.  74 2F            je short Unpack.00417AE8

这个广告比较恶心,判断升级就在这里,这里的JS脚本里有点击广告,最讨厌这玩意,里面还有个地址应该是升级程序的地址,这一点要干掉,我是这样改的:
00417A20      C2 0400          retn 4      ;  直接返回,不让它检测升级点击广告!

保存下,大的广告基本已经全部去除了,个别小广告可以小搞一下,比如左下角的那个网站啊和标题栏的私服发布啊,直接用资源工具Restorator去编辑掉,我就改成我们吾爱破解的吧:
00418110   .  6A 03            push 3                                         ; /(Initial CPU selection)
00418112   .  68 2FEC4700      push Unpack.0047EC2F                           ; |CConfigDlg
00418117   .  68 2FEC4700      push Unpack.0047EC2F                           ; |CConfigDlg
0041811C   .  68 D41A4800      push Unpack.00481AD4                           ; |http://www.176web.com/
00418121   .  68 9CFE4700      push Unpack.0047FE9C                           ; |open
00418126   .  6A 00            push 0                                         ; |hWnd = NULL
00418128   .  FF15 50E55100    call dword ptr ds:[<&shell32.ShellExecuteA>]   ; \ShellExecuteA
0041812E   .  C3               retn

左下角的,我改成了www.52pojie.cn
00418280   .  6A 03            push 3                                         ; /IsShown = 3
00418282   .  68 2FEC4700      push Unpack.0047EC2F                           ; |CConfigDlg
00418287   .  68 2FEC4700      push Unpack.0047EC2F                           ; |CConfigDlg
0041828C   .  68 041B4800      push Unpack.00481B04                           ; |http://www.hj02.com/?source=farm
00418291   .  68 9CFE4700      push Unpack.0047FE9C                           ; |open
00418296   .  6A 00            push 0                                         ; |hWnd = NULL
00418298   .  FF15 50E55100    call dword ptr ds:[<&shell32.ShellExecuteA>]   ; \ShellExecuteA
0041829E   .  C3               retn

这里是菜单栏的地址,我也改成论坛的了

另外有2个地址广告虽然没被访问到,我们也把他干掉,以防万一,地址如下:
00406F40  /.  55               push ebp                        ;  广告
00406F41  |.  8BEC             mov ebp,esp
00406F43  |.  83E4 F8          and esp,FFFFFFF8
00406F46  |.  6A FF            push -1
00406F48  |.  68 80224700      push Unpack.00472280
00406F4D  |.  64:A1 00000000   mov eax,dword ptr fs:[0]
00406F53  |.  50               push eax
00406F54  |.  83EC 28          sub esp,28
00406F57  |.  56               push esi
00406F58  |.  A1 44364900      mov eax,dword ptr ds:[493644]
00406F5D  |.  33C4             xor eax,esp
00406F5F  |.  50               push eax
00406F60  |.  8D4424 30        lea eax,dword ptr ss:[esp+30]
00406F64  |.  64:A3 00000000   mov dword ptr fs:[0],eax
00406F6A  |.  8BF1             mov esi,ecx
00406F6C  |.  E8 EED50200      call Unpack.0043455F
00406F71  |.  33C0             xor eax,eax
00406F73  |.  68 7CEE4700      push Unpack.0047EE7C            ;  http://update.176web.com/farm/notice_v2.html
00406F78  |.  8D4C24 20        lea ecx,dword ptr ss:[esp+20]
00406F7C  |.  66:894424 20     mov word ptr ss:[esp+20],ax
00406F81  |.  E8 7B700300      call Unpack.0043E001
00406F86  |.  8D4C24 0C        lea ecx,dword ptr ss:[esp+C]
00406F8A  |.  51               push ecx                        ; /Arg1
00406F8B  |.  C74424 3C 000000>mov dword ptr ss:[esp+3C],0     ; |
00406F93  |.  E8 DD6A0300      call Unpack.0043DA75            ; \Unpack.0043DA75
00406F98  |.  8D5424 0C        lea edx,dword ptr ss:[esp+C]
00406F9C  |.  52               push edx                        ; /Arg11
00406F9D  |.  8BC2             mov eax,edx                     ; |
00406F9F  |.  50               push eax                        ; |Arg10
00406FA0  |.  8BCA             mov ecx,edx                     ; |
00406FA2  |.  51               push ecx                        ; |Arg9
00406FA3  |.  52               push edx                        ; |Arg8
00406FA4  |.  8D4424 2C        lea eax,dword ptr ss:[esp+2C]   ; |
00406FA8  |.  50               push eax                        ; |Arg7
00406FA9  |.  68 5C4C4900      push Unpack.00494C5C            ; |LLLLL
00406FAE  |.  6A 00            push 0                          ; |Arg5 = 00000000
00406FB0  |.  6A 00            push 0                          ; |Arg4 = 00000000
00406FB2  |.  6A 01            push 1                          ; |Arg3 = 00000001
00406FB4  |.  68 F4010000      push 1F4                        ; |Arg2 = 000001F4
00406FB9  |.  83C6 74          add esi,74                      ; |
00406FBC  |.  56               push esi                        ; |Arg1
00406FBD  |.  C64424 64 01     mov byte ptr ss:[esp+64],1      ; |
00406FC2  |.  E8 5F370300      call Unpack.0043A726            ; \Unpack.0043A726
00406FC7  |.  8B35 B4E55100    mov esi,dword ptr ds:[<&oleaut3>;  oleaut32.VariantClear
00406FCD  |.  83C4 2C          add esp,2C
00406FD0  |.  8D4C24 0C        lea ecx,dword ptr ss:[esp+C]
00406FD4  |.  51               push ecx
00406FD5  |.  FFD6             call esi                        ;  <&oleaut32.VariantClear>
00406FD7  |.  8D5424 1C        lea edx,dword ptr ss:[esp+1C]
00406FDB  |.  52               push edx
00406FDC  |.  FFD6             call esi                        ;  <&oleaut32.VariantClear>
00406FDE  |.  B8 01000000      mov eax,1
00406FE3  |.  8B4C24 30        mov ecx,dword ptr ss:[esp+30]
00406FE7  |.  64:890D 00000000 mov dword ptr fs:[0],ecx
00406FEE  |.  59               pop ecx
00406FEF  |.  5E               pop esi
00406FF0  |.  8BE5             mov esp,ebp
00406FF2  |.  5D               pop ebp
00406FF3  \.  C3               retn
00433010  /.  55               push ebp                        ;  广告
00433011  |.  8BEC             mov ebp,esp
00433013  |.  83E4 F8          and esp,FFFFFFF8
00433016  |.  6A FF            push -1
00433018  |.  68 80224700      push Unpack.00472280
0043301D  |.  64:A1 00000000   mov eax,dword ptr fs:[0]
00433023  |.  50               push eax
00433024  |.  83EC 28          sub esp,28
00433027  |.  56               push esi
00433028  |.  A1 44364900      mov eax,dword ptr ds:[493644]
0043302D  |.  33C4             xor eax,esp
0043302F  |.  50               push eax
00433030  |.  8D4424 30        lea eax,dword ptr ss:[esp+30]
00433034  |.  64:A3 00000000   mov dword ptr fs:[0],eax
0043303A  |.  8BF1             mov esi,ecx
0043303C  |.  E8 1E150000      call Unpack.0043455F
00433041  |.  33C0             xor eax,eax
00433043  |.  68 643A4800      push Unpack.00483A64            ;  http://update.176web.com/farm/version.html
00433048  |.  8D4C24 20        lea ecx,dword ptr ss:[esp+20]
0043304C  |.  66:894424 20     mov word ptr ss:[esp+20],ax
00433051  |.  E8 ABAF0000      call Unpack.0043E001
00433056  |.  8D4C24 0C        lea ecx,dword ptr ss:[esp+C]
0043305A  |.  51               push ecx                        ; /Arg1
0043305B  |.  C74424 3C 000000>mov dword ptr ss:[esp+3C],0     ; |
00433063  |.  E8 0DAA0000      call Unpack.0043DA75            ; \Unpack.0043DA75
00433068  |.  8D5424 0C        lea edx,dword ptr ss:[esp+C]
0043306C  |.  52               push edx                        ; /Arg11
0043306D  |.  8BC2             mov eax,edx                     ; |
0043306F  |.  50               push eax                        ; |Arg10
00433070  |.  8BCA             mov ecx,edx                     ; |
00433072  |.  51               push ecx                        ; |Arg9
00433073  |.  52               push edx                        ; |Arg8
00433074  |.  8D4424 2C        lea eax,dword ptr ss:[esp+2C]   ; |
00433078  |.  50               push eax                        ; |Arg7
00433079  |.  68 5C4C4900      push Unpack.00494C5C            ; |LLLLL
0043307E  |.  6A 00            push 0                          ; |Arg5 = 00000000
00433080  |.  6A 00            push 0                          ; |Arg4 = 00000000
00433082  |.  6A 01            push 1                          ; |Arg3 = 00000001
00433084  |.  68 F4010000      push 1F4                        ; |Arg2 = 000001F4
00433089  |.  81C6 D8000000    add esi,0D8                     ; |
0043308F  |.  56               push esi                        ; |Arg1
00433090  |.  C64424 64 01     mov byte ptr ss:[esp+64],1      ; |
00433095  |.  E8 8C760000      call Unpack.0043A726            ; \Unpack.0043A726
0043309A  |.  8B35 B4E55100    mov esi,dword ptr ds:[<&oleaut3>;  oleaut32.VariantClear
004330A0  |.  83C4 2C          add esp,2C
004330A3  |.  8D4C24 0C        lea ecx,dword ptr ss:[esp+C]
004330A7  |.  51               push ecx
004330A8  |.  FFD6             call esi                        ;  <&oleaut32.VariantClear>
004330AA  |.  8D5424 1C        lea edx,dword ptr ss:[esp+1C]
004330AE  |.  52               push edx
004330AF  |.  FFD6             call esi                        ;  <&oleaut32.VariantClear>
004330B1  |.  B8 01000000      mov eax,1
004330B6  |.  8B4C24 30        mov ecx,dword ptr ss:[esp+30]
004330BA  |.  64:890D 00000000 mov dword ptr fs:[0],ecx
004330C1  |.  59               pop ecx
004330C2  |.  5E               pop esi
004330C3  |.  8BE5             mov esp,ebp
004330C5  |.  5D               pop ebp
004330C6  \.  C3               retn

看代码就清楚的知道,这里就是那个属性框的广告,我们直接在断首返回就行了,这样改:
00406F40      C3               retn                            ;  广告

00433010      C3               retn                            ;  广告

1.jpg

这里菜单栏文字也给改了,也可以删除掉

2.jpg

原始的那个广告属性框,我们设置成不可见禁用好了.然后其他哦随便改改就完工了.


1.jpg

最后完工了,用着自己的放心啊,不怕被放后门,用起来也很舒心啊,文件我打包下,大家自己手动尝试下吧,大部分我都说了,大家也可以补充其他方法.



     吾爱破解
     Hmily[LCG]
    2010年3月2号
http://Www.52PoJiE.Cn

练习文件.7z

648.54 KB, 下载次数: 318, 下载积分: 吾爱币 -1 CB

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

CHHSun 发表于 2010-3-2 16:54
占二楼,膜拜一下,回头试试
hixiaosheng 发表于 2010-3-2 18:52
疯子韩 发表于 2010-3-2 19:36
刚才我说看看阅读权限居然是200…还好现在改回来了…
 楼主| Hmily 发表于 2010-3-2 19:36
回复 4# 疯子韩


那时候在写,没有开放,写好就开放了.
wuhanqi 发表于 2010-3-2 19:37
前排欣赏
coolszy 发表于 2010-3-2 20:04
给我个权限,我给你加精:)eee
蓝雪儿 发表于 2010-3-2 20:45
精品文章
huyijunjj 发表于 2010-3-2 20:50
高手还有分析图强悍!!!支持!
王者之剑 发表于 2010-3-2 21:32
小蓝不是正在搞这个的脱壳么。。。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-10 01:38

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表