能力值:
(RANK:10 )
|
-
-
2 楼
我看别人写的好象是先处理了IAT再处理OEP?
但是我在调试的时候看到我的好象是先把OEP附近的东西改完了以后才去弄的IAT.
我找到了这些,感觉应该就是程序开始附近的东西,但是没看到标志性的
PUSH EBP
MOV EBP,ESP
PUSH -1
??
这是我找到的怀疑是开头附近的代码.先于IAT被壳释放
004058AF ? 8B56 08 mov edx, dword ptr [esi+8]
004058B2 . 8915 783D4600 mov dword ptr [463D78], edx
004058B8 . 8B76 0C mov esi, dword ptr [esi+C]
004058BB . 81E6 FF7F0000 and esi, 7FFF
004058C1 . 8935 6C3D4600 mov dword ptr [463D6C], esi
004058C7 . 83F9 02 cmp ecx, 2
004058CA . 74 0C je short 004058D8
004058CC . 81CE 00800000 or esi, 8000
004058D2 . 8935 6C3D4600 mov dword ptr [463D6C], esi
004058D8 > C1E0 08 shl eax, 8
004058DB . 03C2 add eax, edx
004058DD . A3 703D4600 mov dword ptr [463D70], eax
004058E2 . 33F6 xor esi, esi
004058E4 . 56 push esi ; /pModule => NULL
004058E5 . 8B3D C8414100 mov edi, dword ptr [4141C8] ; |kernel32.GetModuleHandleA
004058EB . FFD7 call edi ; \GetModuleHandleA
004058ED . 66:8138 4D5A cmp word ptr [eax], 5A4D
004058F2 . 75 1F jnz short 00405913
004058F4 . 8B48 3C mov ecx, dword ptr [eax+3C]
004058F7 . 03C8 add ecx, eax
004058F9 . 8139 50450000 cmp dword ptr [ecx], 4550
004058FF . 75 12 jnz short 00405913
00405901 . 0FB741 18 movzx eax, word ptr [ecx+18]
00405905 . 3D 0B010000 cmp eax, 10B
0040590A . 74 1F je short 0040592B
0040590C . 3D 0B020000 cmp eax, 20B
00405911 . 74 05 je short 00405918
00405913 > 8975 E4 mov dword ptr [ebp-1C], esi
00405916 . EB 27 jmp short 0040593F
00405918 > 83B9 84000000 0E cmp dword ptr [ecx+84], 0E
0040591F .^ 76 F2 jbe short 00405913
00405921 . 33C0 xor eax, eax
00405923 . 39B1 F8000000 cmp dword ptr [ecx+F8], esi
00405929 . EB 0E jmp short 00405939
0040592B > 8379 74 0E cmp dword ptr [ecx+74], 0E
0040592F .^ 76 E2 jbe short 00405913
00405931 . 33C0 xor eax, eax
00405933 . 39B1 E8000000 cmp dword ptr [ecx+E8], esi
00405939 > 0F95C0 setne al
0040593C . 8945 E4 mov dword ptr [ebp-1C], eax
0040593F > 6A 01 push 1
00405941 . E8 03150000 call 00406E49
00405946 . 59 pop ecx
00405947 . 85C0 test eax, eax
00405949 . 75 08 jnz short 00405953
0040594B . 6A 1C push 1C
0040594D . E8 02FFFFFF call 00405854
00405952 . 59 pop ecx
00405953 > E8 59330000 call 00408CB1
00405958 . 85C0 test eax, eax
0040595A . 75 08 jnz short 00405964
0040595C . 6A 10 push 10
0040595E . E8 F1FEFFFF call 00405854
00405963 . 59 pop ecx
00405964 > E8 E9440000 call 00409E52
00405969 . 8975 FC mov dword ptr [ebp-4], esi
0040596C . E8 E3420000 call 00409C54
00405971 . 85C0 test eax, eax
00405973 . 7D 08 jge short 0040597D
00405975 . 6A 1B push 1B
00405977 . E8 B3FEFFFF call 0040582F
0040597C . 59 pop ecx
0040597D > 90 nop ; [GetCommandLineA
0040597E ? E8 9AD5407C call kernel32.GetCommandLineA
00405983 . A3 40564600 mov dword ptr [465640], eax
00405988 . E8 A5410000 call 00409B32
0040598D . A3 503D4600 mov dword ptr [463D50], eax
00405992 . E8 F9400000 call 00409A90
00405997 . 85C0 test eax, eax
00405999 . 7D 08 jge short 004059A3
0040599B . 6A 08 push 8
0040599D . E8 8DFEFFFF call 0040582F
004059A2 . 59 pop ecx
004059A3 > E8 B53E0000 call 0040985D
004059A8 . 85C0 test eax, eax
004059AA . 7D 08 jge short 004059B4
004059AC . 6A 09 push 9
004059AE . E8 7CFEFFFF call 0040582F
004059B3 . 59 pop ecx
004059B4 > 6A 01 push 1
004059B6 . E8 FE100000 call 00406AB9
004059BB . 59 pop ecx
004059BC . 8945 D8 mov dword ptr [ebp-28], eax
004059BF . 3BC6 cmp eax, esi
004059C1 . 74 07 je short 004059CA
004059C3 . 50 push eax
004059C4 . E8 66FEFFFF call 0040582F
004059C9 . 59 pop ecx
004059CA > 8975 BC mov dword ptr [ebp-44], esi
004059CD . 8D45 90 lea eax, dword ptr [ebp-70]
004059D0 . 50 push eax ; /pStartupinfo
004059D1 . E8 18C53F7C call kernel32.GetStartupInfoA ; |
004059D6 ? 90 nop
004059D7 . E8 243E0000 call 00409800
004059DC . 8945 E0 mov dword ptr [ebp-20], eax
004059DF . F645 BC 01 test byte ptr [ebp-44], 1
004059E3 . 74 06 je short 004059EB
004059E5 . 0FB745 C0 movzx eax, word ptr [ebp-40]
004059E9 . EB 03 jmp short 004059EE
004059EB > 6A 0A push 0A
004059ED . 58 pop eax
004059EE > 50 push eax
004059EF . FF75 E0 push dword ptr [ebp-20]
004059F2 . 56 push esi
004059F3 . 56 push esi
004059F4 . FFD7 call edi
004059F6 . 50 push eax
004059F7 . E8 F4D5FFFF call 00402FF0
004059FC . 8BF8 mov edi, eax
004059FE . 897D D4 mov dword ptr [ebp-2C], edi
00405A01 . 3975 E4 cmp dword ptr [ebp-1C], esi
00405A04 . 75 06 jnz short 00405A0C
00405A06 . 57 push edi
00405A07 . E8 DA110000 call 00406BE6
00405A0C > E8 F7110000 call 00406C08
00405A11 . EB 2B jmp short 00405A3E
00405A13 . 8B45 EC mov eax, dword ptr [ebp-14]
00405A16 . 8B08 mov ecx, dword ptr [eax]
00405A18 . 8B09 mov ecx, dword ptr [ecx]
00405A1A . 894D DC mov dword ptr [ebp-24], ecx
00405A1D . 50 push eax
00405A1E . 51 push ecx
00405A1F . E8 783C0000 call 0040969C
00405A24 . 59 pop ecx
00405A25 . 59 pop ecx
00405A26 . C3 retn
00405A27 . 8B65 E8 mov esp, dword ptr [ebp-18]
00405A2A . 8B7D DC mov edi, dword ptr [ebp-24]
00405A2D . 837D E4 00 cmp dword ptr [ebp-1C], 0
00405A31 . 75 06 jnz short 00405A39
00405A33 . 57 push edi
00405A34 . E8 BE110000 call 00406BF7
00405A39 > E8 D9110000 call 00406C17
00405A3E > 834D FC FF or dword ptr [ebp-4], FFFFFFFF
00405A42 . 8BC7 mov eax, edi
00405A44 . 8D65 84 lea esp, dword ptr [ebp-7C]
00405A47 . E8 C7040000 call 00405F13
00405A4C . C3 retn
|
能力值:
(RANK:10 )
|
-
-
3 楼
FF 爱死你了.哈哈.
上面粘贴的地方是第四次CODE访问。然后根据PEID查出的结果得知为VC7,然后重新载入,跑完脚本,第一次CODE停下.
看堆栈里面
0013FF80 006FD2C2 mBot.006FD2C2
0013FF84 00415648 mBot.00415648
0013FF88 00000060
对比VC7文件,开始猜解还原OEP
2次CODE堆栈
0013FF08 006FD2CC mBot.006FD2CC
0013FF0C FFFEFCCC
没东西
3次CODE,在VM里
010A8ACE FF33 push dword ptr [ebx] ; kernel32.GetVersionExA
010A8AD0 ^ E9 5C35F1FF jmp 00FBC031
010A8AD5 80FB 03 cmp bl, 3
010A8AD8 ^ 0F85 5335F1FF jnz 00FBC031
4次CODE,到了前面那里
004058AF ? 8B56 08 mov edx, dword ptr [esi+8]
004058B2 . 8915 783D4600 mov dword ptr [463D78], edx
004058B8 . 8B76 0C mov esi, dword ptr [esi+C]
004058BB . 81E6 FF7F0000 and esi, 7FFF
004058C1 . 8935 6C3D4600 mov dword ptr [463D6C], esi
004058C7 . 83F9 02 cmp ecx, 2
004058CA . 74 0C je short 004058D8
004058CC . 81CE 00800000 or esi, 8000
004058D2 . 8935 6C3D4600 mov dword ptr [463D6C], esi
对比VC7普通程序OEP,还原出OEP
00405878 6A 60 PUSH 60
0040587A 68 48564100 PUSH 00415648
0040587F E8 54060000 CALL 00405ED8
00405884 BF 94000000 MOV EDI, 94
00405889 8BC7 MOV EAX, EDI
0040588B E8 E0F4FFFF CALL 00404D70
00405890 8965 E8 MOV [EBP-18], ESP
00405893 8BF4 MOV ESI, ESP
00405895 893E MOV [ESI], EDI
00405897 56 PUSH ESI
00405898 FF15 90114000 CALL GetVersionExA
0040589E 8B4E 10 MOV ECX, [ESI+10]
004058A1 890D 683D4600 MOV [463D68], ECX
004058A7 8B46 04 MOV EAX, [ESI+4]
004058AA A3 743D4600 MOV [463D74], EAX
哈哈.连接到下面,正好是4058AF,DUMP,OEP405878
IAT由于已经用TMD自己解的密,修复了第一个没解密的WRITEFILE,就好了
VM不打算去还原.区段全贴上用着.
|
能力值:
( LV13,RANK:410 )
|
-
-
4 楼
怀疑是不是themida.默认的themida的加壳选项VC的启动代码,几乎被抽干净了。。。
而且似乎IAT也不是一个JMP就能搞定的。
themida的EP应该是mov eax,0.
也预见过jmp xxxxxxxx的情况,不过很少见。
OEP的代码如果没加密,肯定在处理IAT前释放出来。这一点不奇怪。
|
能力值:
(RANK:10 )
|
-
-
5 楼
是TMDA.
原始文件载入后停于
0048F014 > B8 00000000 mov eax, 0
0048F019 60 pushad
0048F01A 0BC0 or eax, eax
0048F01C 74 58 je short 0048F076
0048F01E E8 00000000 call 0048F023
0048F023 58 pop eax
0048F024 05 43000000 add eax, 43
0048F029 8038 E9 cmp byte ptr [eax], 0E9
0048F02C 75 03 jnz short 0048F031
0048F02E 61 popad
0048F02F EB 35 jmp short 0048F066
0048F031 E8 00000000 call 0048F036
0048F036 58 pop eax
至于IAT加密部分,不知道是否设置原因?反正跳过那4个CMP检测,直接JMP到那里去的话,API函数就不被加密的释放出来了.
那个是根据编译器恢复出来的OEP,VM里是一个PUSH 一个JMP到OEP处理,没去管它.直接把恢复出的OEP根据堆栈算出位置,补到算出来的位置就可
|