最近家里这个网属实不给力,看个视频都特别卡,好久没写东西了,最近挺喜欢听那首春娇与志明的插曲Drenched,一直用酷狗,以前没想过把右上角那个倒霉的长条广告去掉。今天闲来无聊研究了一下,进入正题。

目标程序(目前最新版本):

img

查克,这个查克工具比PEID强大,强大在不管有没有加壳都能查出编写语言

img

当然看结果都知道,酷狗是用vc++写的,而且没有加壳。

od载入(典型的vc8入口特征)

img

准备工作

到酷狗目录下

img

查看红框那个图片文件属性

img

我们要去的广告图片的大小事620*60,60的十六进制是3C。620是26C。

如何断点

因为要去的是一个图片广告,他在写代码时候可能用到的API就下面2个

1
2
CreateBitmap()函数
BitBlt()函数

倒着来先试试 Bitblt这个函数了。看看 BitBlt 函数的参数:

1
BOOL BitBlt(int x,int y,int nWidth,int nHeight,CDC*pSrcDC,int xSrc,int ySrc,DWORD dwRop);

x:目标矩形区域的左上角x轴坐标点。 y:目标矩形区域的左上角y轴坐标点。 nWidth:在目标设备中绘制位图的宽度。 nHight:在目标设备中绘制位图的高度。 pSrcDC:源设备上下文对象指针。 xSrc:源设备上下文的起点x轴坐标,函数从该起点复制位图到目标设备。 ySrc:源设备上下文的起点y轴坐标,函数从该起点复制位图到目标设备。 dwRop:光栅操作代码

od下此断点分析,排除没用的,此处省略100字,最后找到得关键代码。

 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
00EC7E70  /$  6A FF         push -0x1                                ;  关键断首
00EC7E72  |.  68 E8831501   push KuGou.011583E8
00EC7E77  |.  64:A1 0000000>mov eax,dword ptr fs:[0]
00EC7E7D  |.  50            push eax
00EC7E7E  |.  83EC 20       sub esp,0x20
00EC7E81  |.  53            push ebx
00EC7E82  |.  55            push ebp
00EC7E83  |.  56            push esi
00EC7E84  |.  57            push edi
00EC7E85  |.  A1 30727501   mov eax,dword ptr ds:[0x1757230]
00EC7E8A  |.  33C4          xor eax,esp
00EC7E8C  |.  50            push eax
00EC7E8D  |.  8D4424 34     lea eax,dword ptr ss:[esp+0x34]
00EC7E91  |.  64:A3 0000000>mov dword ptr fs:[0],eax
00EC7E97  |.  8BF9          mov edi,ecx
00EC7E99  |.  8B5C24 48     mov ebx,dword ptr ss:[esp+0x48]
00EC7E9D  |.  895C24 48     mov dword ptr ss:[esp+0x48],ebx
00EC7EA1  |.  C74424 3C 000>mov dword ptr ss:[esp+0x3C],0x0
00EC7EA9  |.  83BF DC010000>cmp dword ptr ds:[edi+0x1DC],0x0
00EC7EB0      0F84 8E000000 je KuGou.00EC7F44   //这个是个关键跳
00EC7EB6  |.  8B4F 04       mov ecx,dword ptr ds:[edi+0x4]
00EC7EB9  |.  8D4424 14     lea eax,dword ptr ss:[esp+0x14]
00EC7EBD  |.  50            push eax                                 ; /pRect
00EC7EBE  |.  51            push ecx                                 ; |hWnd
00EC7EBF  |.  FF15 9CA71B01 call dword ptr ds:[<&USER32.GetClientRec>; \GetClientRect
00EC7EC5  |.  8B8F DC010000 mov ecx,dword ptr ds:[edi+0x1DC]
00EC7ECB  |.  E8 80EEEFFF   call KuGou.00DC6D50
00EC7ED0  |.  8B8F DC010000 mov ecx,dword ptr ds:[edi+0x1DC]
00EC7ED6  |.  8BF0          mov esi,eax
00EC7ED8  |.  E8 53EEEFFF   call KuGou.00DC6D30
00EC7EDD  |.  56            push esi                                 ; /Bottom
00EC7EDE  |.  50            push eax                                 ; |Right
00EC7EDF  |.  6A 00         push 0x0                                 ; |Top = 0
00EC7EE1  |.  6A 00         push 0x0                                 ; |Left = 0
00EC7EE3  |.  8D5424 34     lea edx,dword ptr ss:[esp+0x34]          ; |
00EC7EE7  |.  52            push edx                                 ; |pRect
00EC7EE8  |.  FF15 08A71B01 call dword ptr ds:[<&USER32.SetRect>]    ; \SetRect
00EC7EEE  |.  53            push ebx                                 ; /hDC
00EC7EEF  |.  FF15 28A11B01 call dword ptr ds:[<&GDI32.CreateCompati>; \CreateCompatibleDC
00EC7EF5  |.  8B8F DC010000 mov ecx,dword ptr ds:[edi+0x1DC]
00EC7EFB  |.  8BF0          mov esi,eax
00EC7EFD  |.  E8 0EEEEFFF   call KuGou.00DC6D10
00EC7F02  |.  8B3D 64A11B01 mov edi,dword ptr ds:[<&GDI32.SelectObje>;  GDI32.SelectObject
00EC7F08  |.  50            push eax                                 ; /hObject
00EC7F09  |.  56            push esi                                 ; |hDC
00EC7F0A  |.  FFD7          call edi                                 ; \SelectObject
00EC7F0C  |.  8B5424 18     mov edx,dword ptr ss:[esp+0x18]
00EC7F10  |.  8B4C24 1C     mov ecx,dword ptr ss:[esp+0x1C]
00EC7F14  |.  2B4C24 14     sub ecx,dword ptr ss:[esp+0x14]
00EC7F18  |.  68 2000CC00   push KuGou.00CC0020                      ; /ROP = SRCCOPY
00EC7F1D  |.  6A 00         push 0x0                                 ; |YSrc = 0
00EC7F1F  |.  6A 00         push 0x0                                 ; |XSrc = 0
00EC7F21  |.  8BE8          mov ebp,eax                              ; |
00EC7F23  |.  8B4424 2C     mov eax,dword ptr ss:[esp+0x2C]          ; |
00EC7F27  |.  56            push esi                                 ; |hSrcDC
00EC7F28  |.  2BC2          sub eax,edx                              ; |
00EC7F2A  |.  50            push eax                                 ; |Height
00EC7F2B  |.  8B4424 28     mov eax,dword ptr ss:[esp+0x28]          ; |
00EC7F2F  |.  51            push ecx                                 ; |Width
00EC7F30  |.  52            push edx                                 ; |YDest
00EC7F31  |.  50            push eax                                 ; |XDest
00EC7F32  |.  53            push ebx                                 ; |hDestDC
00EC7F33  |.  FF15 CCA01B01 call dword ptr ds:[<&GDI32.BitBlt>]      ; \关键。。。。。。。。。。这里的call是导入那个AdBarDefault.jpg 
00EC7F39  |.  55            push ebp                                 ; /hObject
00EC7F3A  |.  56            push esi                                 ; |hDC
00EC7F3B  |.  FFD7          call edi                                 ; \SelectObject
00EC7F3D  |.  56            push esi                                 ; /hDC
00EC7F3E  |.  FF15 58A11B01 call dword ptr ds:[<&GDI32.DeleteDC>]    ; \DeleteDC
00EC7F44  |>  C74424 3C FFF>mov dword ptr ss:[esp+0x3C],-0x1 //刚才那个如果跳的话跳到这里
00EC7F4C  |.  33C0          xor eax,eax
00EC7F4E  |.  8B4C24 34     mov ecx,dword ptr ss:[esp+0x34]
00EC7F52  |.  64:890D 00000>mov dword ptr fs:[0],ecx
00EC7F59  |.  59            pop ecx
00EC7F5A  |.  5F            pop edi
00EC7F5B  |.  5E            pop esi
00EC7F5C  |.  5D            pop ebp
00EC7F5D  |.  5B            pop ebx
00EC7F5E  |.  83C4 2C       add esp,0x2C
00EC7F61  \.  C2 1000       retn 0x10

第一步分析告于段落,把00EC7EB0 0F84 8E000000 je KuGou.00EC7F44 //这个是个关键跳 里的je修改为jmp然后保存一份exe。

打开后,发现3秒之内没有广告,但是3秒后一出来了,说明程序后面会有循环来显示一个随机的网络广告,但是尺寸是不变的,就是刚才查过的620*60.

第二步,搞定这个循环里面的检查部分。

这里直接在汇编代码上右键–>查找–>所有命令,输入 mov edi,3C 这个3C就是那个图片的高度的16进制表示,或者查找mov esi,0x26C也行。

img

img

双击第二个,下面是关键代码

 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
00EC7DC0   .  83EC 40       sub esp,0x40
00EC7DC3   .  807C24 4C 00  cmp byte ptr ss:[esp+0x4C],0x0
00EC7DC8      0F84 99000000 je KuGou.00EC7E67    //和上一个同理,改为jmp就ok
00EC7DCE   .  56            push esi
00EC7DCF   .  33C0          xor eax,eax
00EC7DD1   .  8941 E4       mov dword ptr ds:[ecx-0x1C],eax
00EC7DD4   .  33D2          xor edx,edx
00EC7DD6   .  8951 E8       mov dword ptr ds:[ecx-0x18],edx
00EC7DD9   .  57            push edi
00EC7DDA   .  8941 B8       mov dword ptr ds:[ecx-0x48],eax
00EC7DDD   .  8951 BC       mov dword ptr ds:[ecx-0x44],edx
00EC7DE0   .  BE 6C020000   mov esi,0x26C  //宽度620(16进制 26C)
00EC7DE5   .  8971 EC       mov dword ptr ds:[ecx-0x14],esi
00EC7DE8   .  BF 3C000000   mov edi,0x3C  //高度60(16进制 3C)
00EC7DED   .  8979 F0       mov dword ptr ds:[ecx-0x10],edi
00EC7DF0   .  33F6          xor esi,esi
00EC7DF2   .  8971 C0       mov dword ptr ds:[ecx-0x40],esi
00EC7DF5   .  C741 F4 11000>mov dword ptr ds:[ecx-0xC],0x11
00EC7DFC   .  8D71 E0       lea esi,dword ptr ds:[ecx-0x20]
00EC7DFF   .  33FF          xor edi,edi
00EC7E01   .  8979 C4       mov dword ptr ds:[ecx-0x3C],edi
00EC7E04   .  8B06          mov eax,dword ptr ds:[esi]
00EC7E06   .  8B50 0C       mov edx,dword ptr ds:[eax+0xC]
00EC7E09   .  8D4C24 38     lea ecx,dword ptr ss:[esp+0x38]
00EC7E0D   .  51            push ecx
00EC7E0E   .  8BCE          mov ecx,esi
00EC7E10   .  FFD2          call edx
00EC7E12   .  8B06          mov eax,dword ptr ds:[esi]
00EC7E14   .  8B50 10       mov edx,dword ptr ds:[eax+0x10]
00EC7E17   .  8D4C24 18     lea ecx,dword ptr ss:[esp+0x18]
00EC7E1B   .  51            push ecx
00EC7E1C   .  8BCE          mov ecx,esi
00EC7E1E   .  FFD2          call edx
00EC7E20   .  8B06          mov eax,dword ptr ds:[esi]
00EC7E22   .  8B50 18       mov edx,dword ptr ds:[eax+0x18]
00EC7E25   .  8D4C24 08     lea ecx,dword ptr ss:[esp+0x8]
00EC7E29   .  51            push ecx
00EC7E2A   .  8BCE          mov ecx,esi
00EC7E2C   .  FFD2          call edx
00EC7E2E   .  8B46 14       mov eax,dword ptr ds:[esi+0x14]
00EC7E31   .  50            push eax
00EC7E32   .  8D4E 04       lea ecx,dword ptr ds:[esi+0x4]
00EC7E35   .  51            push ecx
00EC7E36   .  8D5424 10     lea edx,dword ptr ss:[esp+0x10]
00EC7E3A   .  52            push edx
00EC7E3B   .  8D4424 24     lea eax,dword ptr ss:[esp+0x24]
00EC7E3F   .  50            push eax
00EC7E40   .  8D4C24 38     lea ecx,dword ptr ss:[esp+0x38]
00EC7E44   .  51            push ecx
00EC7E45   .  E8 7682EAFF   call KuGou.00D700C0
00EC7E4A   .  8B16          mov edx,dword ptr ds:[esi]
00EC7E4C   .  8B52 08       mov edx,dword ptr ds:[edx+0x8]
00EC7E4F   .  83C4 14       add esp,0x14
00EC7E52   .  57            push edi
00EC7E53   .  8D4424 2C     lea eax,dword ptr ss:[esp+0x2C]
00EC7E57   .  50            push eax
00EC7E58   .  8BCE          mov ecx,esi
00EC7E5A   .  FFD2          call edx
00EC7E5C   .  8B06          mov eax,dword ptr ds:[esi]
00EC7E5E   .  8B50 04       mov edx,dword ptr ds:[eax+0x4]
00EC7E61   .  8BCE          mov ecx,esi
00EC7E63   .  FFD2          call edx
00EC7E65   .  5F            pop edi
00EC7E66   .  5E            pop esi
00EC7E67   >  83C4 40       add esp,0x40
00EC7E6A   .  C2 0C00       retn 0xC

结束

传个结果图。顺便说下下,还有一些小的广告,比如右下角的文字之类的,这些就算是些小鬼,也不会很难的,只是最近没时间细细研究了,今天就这样吧,等以后再说吧。

img