首页
社区
课程
招聘
[旧帖] [求助]Themida 1.8.2壳,程序VC8写,有问题,请高手指点! 0.00雪花
发表于: 2008-3-2 23:36 5802

[旧帖] [求助]Themida 1.8.2壳,程序VC8写,有问题,请高手指点! 0.00雪花

2008-3-2 23:36
5802
首先

1.我要脱的程序PEID查壳后:Themida|WinLicense 1.8.2.0 Plus  -> Oreans Technologies *
用Fly老大的userdb.txt是Themida|WinLicense 1.8.2.0+
2.程序包里其他exe程序脱壳后是VC8 -> Microsoft Corporation,由此我判断我要脱的程序也是VC8
随便找个VC8的程序,参考入口代码:
0040FDA7 > $  E8 E8020000   call    00410094
0040FDAC   .^ E9 35FDFFFF   jmp     0040FAE6

00410094:

00410094  /$  55            push    ebp
00410095  |.  8BEC          mov     ebp, esp
00410097  |.  83EC 10       sub     esp, 10
0041009A  |.  A1 10504100   mov     eax, dword ptr [415010]
0041009F  |.  8365 F8 00    and     dword ptr [ebp-8], 0
004100A3  |.  8365 FC 00    and     dword ptr [ebp-4], 0
004100A7  |.  53            push    ebx
004100A8  |.  57            push    edi
004100A9  |.  BF 4EE640BB   mov     edi, BB40E64E
004100AE  |.  3BC7          cmp     eax, edi
004100B0  |.  BB 0000FFFF   mov     ebx, FFFF0000
004100B5  |.  74 0D         je      short 004100C4
004100B7  |.  85C3          test    ebx, eax
004100B9  |.  74 09         je      short 004100C4
004100BB  |.  F7D0          not     eax
004100BD  |.  A3 14504100   mov     dword ptr [415014], eax
004100C2  |.  EB 60         jmp     short 00410124
004100C4  |>  56            push    esi
004100C5  |.  8D45 F8       lea     eax, dword ptr [ebp-8]
004100C8  |.  50            push    eax                              ; /pFileTime
004100C9  |.  FF15 A4114000 call    dword ptr [<&KERNEL32.GetSystemT>; \GetSystemTimeAsFileTime
004100CF  |.  8B75 FC       mov     esi, dword ptr [ebp-4]
004100D2  |.  3375 F8       xor     esi, dword ptr [ebp-8]
004100D5  |.  FF15 A8114000 call    dword ptr [<&KERNEL32.GetCurrent>; [GetCurrentProcessId
004100DB  |.  33F0          xor     esi, eax
004100DD  |.  FF15 AC114000 call    dword ptr [<&KERNEL32.GetCurrent>; [GetCurrentThreadId
004100E3  |.  33F0          xor     esi, eax
004100E5  |.  FF15 B0114000 call    dword ptr [<&KERNEL32.GetTickCou>; [GetTickCount
004100EB  |.  33F0          xor     esi, eax
004100ED  |.  8D45 F0       lea     eax, dword ptr [ebp-10]
004100F0  |.  50            push    eax                              ; /pPerformanceCount
004100F1  |.  FF15 B8114000 call    dword ptr [<&KERNEL32.QueryPerfo>; \QueryPerformanceCounter

0040FAE6:

0040FAE6   > /6A 58         push    58
0040FAE8   . |68 30304100   push    00413030
0040FAED   . |E8 FA040000   call    0040FFEC
0040FAF2   . |33DB          xor     ebx, ebx
0040FAF4   . |895D E4       mov     dword ptr [ebp-1C], ebx
0040FAF7   . |895D FC       mov     dword ptr [ebp-4], ebx
0040FAFA   . |8D45 98       lea     eax, dword ptr [ebp-68]
0040FAFD   . |50            push    eax                              ; /pStartupinfo
0040FAFE   . |FF15 BC114000 call    dword ptr [<&KERNEL32.GetStartup>; \GetStartupInfoA
0040FB04   . |C745 FC FEFFF>mov     dword ptr [ebp-4], -2
0040FB0B   . |C745 FC 01000>mov     dword ptr [ebp-4], 1
0040FB12   . |64:A1 1800000>mov     eax, dword ptr fs:[18]
0040FB18   . |8B70 04       mov     esi, dword ptr [eax+4]
0040FB1B   . |BF 0C724100   mov     edi, 0041720C
0040FB20   > |6A 00         push    0
0040FB22   . |56            push    esi
0040FB23   . |57            push    edi
0040FB24   . |FF15 C0114000 call    dword ptr [<&KERNEL32.Interlocke>;  kernel32.InterlockedCompareExchange
0040FB2A   . |85C0          test    eax, eax

然后

1.OD设置HIDE完毕载入程序,来到:
00552014 >  B8 00000000     mov     eax, 0
00552019    60              pushad
0055201A    0BC0            or      eax, eax
0055201C    74 68           je      short 00552086
0055201E    E8 00000000     call    00552023
00552023    58              pop     eax
00552024    05 53000000     add     eax, 53
00552029    8038 E9         cmp     byte ptr [eax], 0E9
0055202C    75 13           jnz     short 00552041
0055202E    61              popad
0055202F    EB 45           jmp     short 00552076
00552031    DB2D 37205500   fld     tbyte ptr [552037]
00552037    FFFF            ???                                      ; Unknown command
00552039    FFFF            ???                                      ; Unknown command
0055203B    FFFF            ???                                      ; Unknown command
0055203D    FFFF            ???                                      ; Unknown command
0055203F    3D 40E80000     cmp     eax, 0E840
00552044    0000            add     byte ptr [eax], al

2.接着载入okdodo  2007/03 ->1.8.2.0+版本脚本 或 fxyang -> Themida & WinLicen 1.9.1 - 1.9.5 系列脱壳脚本都到达004C06CD:
004C06CD  /.  55            push    ebp
004C06CE  |.  8BEC          mov     ebp, esp
004C06D0  |.  83EC 10       sub     esp, 10
004C06D3  |.  A1 245C5200   mov     eax, dword ptr [525C24]
004C06D8  |.  8365 F8 00    and     dword ptr [ebp-8], 0
004C06DC  |.  8365 FC 00    and     dword ptr [ebp-4], 0
004C06E0  |.  53            push    ebx
004C06E1  |.  57            push    edi
004C06E2  |.  BF 4EE640BB   mov     edi, BB40E64E
004C06E7  |.  3BC7          cmp     eax, edi
004C06E9  |.  BB 0000FFFF   mov     ebx, FFFF0000
004C06EE  |.  74 0D         je      short 004C06FD
004C06F0  |.  85C3          test    ebx, eax
004C06F2  |.  74 09         je      short 004C06FD
004C06F4  |.  F7D0          not     eax
004C06F6  |.  A3 285C5200   mov     dword ptr [525C28], eax
004C06FB  |.  EB 60         jmp     short 004C075D
004C06FD  |>  56            push    esi
004C06FE  |.  8D45 F8       lea     eax, dword ptr [ebp-8]
004C0701  |.  50            push    eax
004C0702  |.  90            nop
004C0703  |.  E8 7C035702   call    02A30A84
004C0708  |.  8B75 FC       mov     esi, dword ptr [ebp-4]
004C070B  |.  3375 F8       xor     esi, dword ptr [ebp-8]
004C070E  |.  E8 F8005D02   call    02A9080B
004C0713  |.  90            nop
004C0714  |.  33F0          xor     esi, eax
004C0716  |.  E8 48015D02   call    02A90863
004C071B  |?  90            nop
004C071C  |.  33F0          xor     esi, eax
004C071E  |.  90            nop
004C071F  |.  E8 D4FC6002   call    02AD03F8
004C0724  |.  33F0          xor     esi, eax
004C0726  |.  8D45 F0       lea     eax, dword ptr [ebp-10]

通过比较,发现结构类似VC8入口CALL段.

3.接着把次函数跑完,来到006D58F0:
006D58F0    68 76CC4E0A     push    0A4ECC76
006D58F5  ^ E9 B2FFF4FF     jmp     006258AC

通过比较,发现结构类似VC8入口.

4.接着进入JMP段,发现代码结构完全不同!

006258AC    60              pushad
006258AD    9C              pushfd
006258AE    FC              cld
006258AF    E8 00000000     call    006258B4
006258B4    5F              pop     edi
006258B5    81EF 5085430A   sub     edi, 0A438550
006258BB    8BC7            mov     eax, edi
006258BD    81C7 6482430A   add     edi, 0A438264
006258C3    3B47 2C         cmp     eax, dword ptr [edi+2C]
006258C6    75 02           jnz     short 006258CA
006258C8    EB 13           jmp     short 006258DD
006258CA    8947 2C         mov     dword ptr [edi+2C], eax
006258CD    B9 A8000000     mov     ecx, 0A8
006258D2    EB 05           jmp     short 006258D9
006258D4    01448F 40       add     dword ptr [edi+ecx*4+40], eax
006258D8    49              dec     ecx
006258D9    0BC9            or      ecx, ecx
006258DB  ^ 75 F7           jnz     short 006258D4
006258DD    8B7424 24       mov     esi, dword ptr [esp+24]
006258E1    8BDE            mov     ebx, esi
006258E3    03F0            add     esi, eax

最后

想请教高手脱Themida壳的大体思路,和这个壳我该怎么深入!

            希 望 高 手 能 赐 教,小 弟 感 激 不 禁

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

收藏
免费 0
支持
分享
最新回复 (6)
雪    币: 219
活跃值: (25)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
谁能帮帮忙?
2008-3-4 14:57
1
雪    币: 201
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
我今天也碰到个这样的壳,我也不太确定我做的对不对,下面是我做的:

我用脚本来到这里:
0045E271     55                 push ebp
0045E272     8BEC               mov ebp,esp
0045E274     83EC 10            sub esp,10
0045E277     A1 F41D4700        mov eax,dword ptr ds:[471DF4]
0045E27C     8365 F8 00         and dword ptr ss:[ebp-8],0
0045E280     8365 FC 00         and dword ptr ss:[ebp-4],0
0045E284     53                 push ebx                              ; abc.00465000
0045E285     57                 push edi
0045E286     BF 4EE640BB        mov edi,BB40E64E
0045E28B     3BC7               cmp eax,edi
0045E28D     BB 0000FFFF        mov ebx,FFFF0000
0045E292     74 0D              je short 0045E2A1                     ; abc.0045E2A1
0045E294     85C3               test ebx,eax                          ; abc.005873B7




提示伪OEP和查看是否有偷代码,我看了整天发现没偷,上面是函数的结束点,我DUMP下后修复,查不到是用什么软件写的,并且运行错误,而后我再次回到这里,我按两次 CTRL-F9 后到了下面这里:
00453AFE d>  6A 60              push 60
00453B00     68 F0DC4600        push 46DCF0
00453B05     E8 A21A0000        call 004555AC                         ; abc.004555AC
00453B0A     8365 FC 00         and dword ptr ss:[ebp-4],0
00453B0E     8D45 90            lea eax,dword ptr ss:[ebp-70]
00453B11     50                 push eax
00453B12     FF15 5C524600      call dword ptr ds:[46525C]            ; kernel32.GetStartupInfoA
00453B18     C745 FC FEFFFFFF   mov dword ptr ss:[ebp-4],-2
00453B1F     BF 94000000        mov edi,94
00453B24     57                 push edi                              ; ntdll.7C930738
00453B25     6A 00              push 0
00453B27     8B1D 58524600      mov ebx,dword ptr ds:[465258]         ; kernel32.GetProcessHeap

非常像VC的开头,但我没见过VC8的开头不能确定,但是我DUMP下修复后能运行,查是VC7,这应该不是的,但是软件内部还有保护,不能正常运行,老提示程序内设置的错误。我到这里就没法进行下去了,也希望高人指点。
2008-3-5 07:43
0
雪    币: 201
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
我已经解决问题了,现在可以正常运行了。方法如上运行脚本停下的假OEP后按两次执行到返回就可以到下面这里了:
00453AFE d>  6A 60              push 60                               ;这里是真正的OEP
00453B00     68 F0DC4600        push 46DCF0
00453B05     E8 A21A0000        call 004555AC                         ; abc.004555AC
00453B0A     8365 FC 00         and dword ptr ss:[ebp-4],0
00453B0E     8D45 90            lea eax,dword ptr ss:[ebp-70]
00453B11     50                 push eax
00453B12     FF15 5C524600      call dword ptr ds:[46525C]            ; kernel32.GetStartupInfoA
00453B18     C745 FC FEFFFFFF   mov dword ptr ss:[ebp-4],-2
00453B1F     BF 94000000        mov edi,94
00453B24     57                 push edi                              ; ntdll.7C930738
00453B25     6A 00              push 0
00453B27     8B1D 58524600      mov ebx,dword ptr ds:[465258]         ; kernel32.GetProcessHeap

不过DUMP后可能会漏掉检验数据可能是脱得不干净的缘故吧,我只试过开一个软件,也不太确定,如果不能正常运行,就要检查一下原文件的区段。因为这部分在软件运行过程中并没有读进内存中,只在Themida检查完整性的时候直接读文件。你在lordpe里看到的可能是 WinLicen 段的 ROffset:  00054A00; size: 00079200 ,最大也就是 000CDC00 ,但是你用16进制编辑软件打开软件结尾绝对比 CDC00 还要大,这部分数据里有检验完整的数据,所以把这部分放回到DUMP文件里就可以了,然后再修复IAT,完成。
2008-3-5 12:54
0
雪    币: 201
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
不过我看还有些还没清除掉,这些就要看那位高手帮帮忙了。
2008-3-5 13:22
0
雪    币: 219
活跃值: (25)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
脚本完了后,对code段下写入断点发现了和VC8 JMP后一样的结构!
但oep就是找不到,上面这位兄弟,如果有兴趣,一起研究下,我qq:59195152
2008-3-7 16:11
0
雪    币: 340
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
Themia,变态到了极点,1.9更没法了..
2008-3-8 02:10
0
游客
登录 | 注册 方可回帖
返回