aspr2.2 SKE 外壳简单分析
【破 解 人】:林海雪原
【调试环境】:Win2K、OllyICE
【作者声明】:初学Crack,只是感兴趣,没有其他目的。失误之处敬请诸位大侠赐教!
现在的ASPR没有了那些异常,只有2次int3,在第一次int3后,按十六进制数找"84 C0 75 0A 68 D0 84",共有几处,有ASCII "85"这个标志的地方就是IAT处理之处:
00E28242 5E pop esi
00E28243 EB 0A jmp short 00E2824F
00E28245 68 D084E200 push 0E284D0 ; ASCII "85"
00E2824A E8 C5CEFDFF call 00E05114
00E2824F A1 78A9E200 mov eax,[dword ds:E2A978]
00E28254 8B00 mov eax,[dword ds:eax]
00E28256 E8 410FFFFF call 00E1919C <<<<<<<----进入!
00E2825B 84C0 test al,al
00E2825D 75 0A jnz short 00E28269
00E2825F 68 D084E200 push 0E284D0 ; ASCII "85"
00E28264 E8 ABCEFDFF call 00E05114
00E28269 A1 40AAE200 mov eax,[dword ds:E2AA40]
84 C0 75 0A 68 D0 84
进入后,我们可以十分明显看见,IAT的处理没有变化,仍按shoooo那样处理:
IAT:
00E1919C 53 push ebx
00E1919D 56 push esi
00E1919E 57 push edi
00E1919F 55 push ebp
00E191A0 83C4 F4 add esp,-0C
00E191A3 8BF0 mov esi,eax
00E191A5 C60424 01 mov [byte ss:esp],1
00E191A9 EB 01 jmp short 00E191AC
00E191AB 9A 837E0400 0F84 call far 840F:00047E83
00E191B2 3A01 cmp al,[byte ds:ecx]
00E191B4 0000 add [byte ds:eax],al
00E191B6 8B7E 04 mov edi,[dword ds:esi+4]
00E191B9 8B46 50 mov eax,[dword ds:esi+50]
00E191BC 894424 04 mov [dword ss:esp+4],eax
00E191C0 EB 01 jmp short 00E191C3
00E191C2 698D 4634B909 000>imul ecx,[dword ss:ebp+9B93446],8B00>
00E191CC D7 xlat [byte ds:ebx+al]
00E191CD E8 06CEFDFF call 00DF5FD8
00E191D2 83C7 09 add edi,9
00E191D5 8B15 00A9E200 mov edx,[dword ds:E2A900]
00E191DB 8B12 mov edx,[dword ds:edx]
00E191DD 8BC6 mov eax,esi
00E191DF E8 ECF1FFFF call 00E183D0
00E191E4 84C0 test al,al
00E191E6 0F84 F8000000 je 00E192E4
00E191EC 6A 14 push 14
00E191EE E8 89C4FEFF call 00E0567C
00E191F3 01C7 add edi,eax
00E191F5 E9 EA000000 jmp 00E192E4
00E191FA 894424 08 mov [dword ss:esp+8],eax
00E191FE 6A FF push -1
00E19200 E8 77C4FEFF call 00E0567C
00E19205 40 inc eax
00E19206 8903 mov [dword ds:ebx],eax
00E19208 83C7 04 add edi,4
00E1920B 83C7 06 add edi,6
00E1920E 8BEF mov ebp,edi
00E19210 8BC7 mov eax,edi
00E19212 E8 4D2BFEFF call 00DFBD64
00E19217 40 inc eax
00E19218 0FB7C0 movzx eax,ax
00E1921B 03F8 add edi,eax
00E1921D 8B46 48 mov eax,[dword ds:esi+48]
00E19220 8B00 mov eax,[dword ds:eax]
00E19222 3346 48 xor eax,[dword ds:esi+48]
00E19225 2B46 4C sub eax,[dword ds:esi+4C]
00E19228 E8 EBFEFFFF call 00E19118
00E1922D 25 FF000000 and eax,0FF
00E19232 03F8 add edi,eax
00E19234 8A1F mov bl,[byte ds:edi]
00E19236 47 inc edi
00E19237 8B46 40 mov eax,[dword ds:esi+40]
00E1923A 8B00 mov eax,[dword ds:eax]
00E1923C 3346 40 xor eax,[dword ds:esi+40]
00E1923F 2B46 44 sub eax,[dword ds:esi+44]
00E19242 E8 D1FEFFFF call 00E19118
00E19247 25 FF000000 and eax,0FF
00E1924C 03F8 add edi,eax
00E1924E 8B4424 04 mov eax,[dword ss:esp+4]
00E19252 014424 08 add [dword ss:esp+8],eax
00E19256 E9 80000000 jmp 00E192DB
00E1925B 3A5E 37 cmp bl,[byte ds:esi+37]
00E1925E 75 17 jnz short 00E19277
00E19260 83C7 02 add edi,2
00E19263 8BC7 mov eax,edi
00E19265 50 push eax
00E19266 55 push ebp
00E19267 8D4424 10 lea eax,[dword ss:esp+10]
00E1926B 50 push eax
00E1926C 56 push esi
00E1926D E8 CAFCFFFF call 00E18F3C
00E19272 83C7 04 add edi,4
00E19275 EB 61 jmp short 00E192D8
00E19277 3A5E 38 cmp bl,[byte ds:esi+38]
00E1927A 75 17 jnz short 00E19293
00E1927C 83C7 02 add edi,2
00E1927F 8BC7 mov eax,edi
00E19281 50 push eax
00E19282 55 push ebp
00E19283 8D4424 10 lea eax,[dword ss:esp+10]
00E19287 50 push eax
00E19288 56 push esi
00E19289 E8 AEFCFFFF call 00E18F3C
00E1928E 83C7 02 add edi,2
00E19291 EB 45 jmp short 00E192D8
00E19293 3A5E 3A cmp bl,[byte ds:esi+3A]
00E19296 75 26 jnz short 00E192BE
00E19298 83C7 02 add edi,2
00E1929B 8A07 mov al,[byte ds:edi]
00E1929D E8 0EEEFFFF call 00E180B0
00E192A2 8B5424 08 mov edx,[dword ss:esp+8]
00E192A6 8902 mov [dword ds:edx],eax
00E192A8 85C0 test eax,eax
00E192AA 75 0A jnz short 00E192B6
00E192AC 68 0493E100 push 0E19304 ; ASCII "180"
00E192B1 E8 5EBEFEFF call 00E05114
00E192B6 834424 08 04 add [dword ss:esp+8],4
00E192BB 47 inc edi
00E192BC EB 1A jmp short 00E192D8
00E192BE 83C7 02 add edi,2
00E192C1 8BC7 mov eax,edi
00E192C3 50 push eax
00E192C4 55 push ebp
00E192C5 8D4424 10 lea eax,[dword ss:esp+10]
00E192C9 50 push eax
00E192CA 56 push esi
00E192CB E8 6CFCFFFF call 00E18F3C <<<<<<-----进入!处理IAT
00E192D0 0FB707 movzx eax,[word ds:edi]
00E192D3 83C0 02 add eax,2
00E192D6 03F8 add edi,eax
00E192D8 8A1F mov bl,[byte ds:edi]
00E192DA 47 inc edi
00E192DB 3A5E 34 cmp bl,[byte ds:esi+34]
00E192DE ^ 0F85 77FFFFFF jnz 00E1925B <<<<<<比较API处理完没
00E192E4 8BDF mov ebx,edi
00E192E6 8B03 mov eax,[dword ds:ebx]
00E192E8 85C0 test eax,eax
00E192EA ^ 0F85 0AFFFFFF jnz 00E191FA <<<<<<比较DLL处理完没
00E192F0 8A0424 mov al,[byte ss:esp]
00E192F3 83C4 0C add esp,0C
00E192F6 5D pop ebp
00E192F7 5F pop edi
00E192F8 5E pop esi
00E192F9 5B pop ebx
00E192FA C3 retn
进入上面CALL后:
00E18F3C 55 push ebp
00E18F3D 8BEC mov ebp,esp
00E18F3F 81C4 F8FEFFFF add esp,-108
00E18F45 53 push ebx
00E18F46 56 push esi
00E18F47 57 push edi
00E18F48 8B55 14 mov edx,[dword ss:ebp+14]
00E18F4B 8B5D 08 mov ebx,[dword ss:ebp+8]
00E18F4E 8DBD FAFEFFFF lea edi,[dword ss:ebp-106]
00E18F54 8BC2 mov eax,edx
00E18F56 48 dec eax
00E18F57 83E8 02 sub eax,2
00E18F5A 0FB630 movzx esi,[byte ds:eax]
00E18F5D 8B45 10 mov eax,[dword ss:ebp+10]
00E18F60 83E8 02 sub eax,2
00E18F63 0FB600 movzx eax,[byte ds:eax]
00E18F66 3B43 2C cmp eax,[dword ds:ebx+2C]
00E18F69 76 06 jbe short 00E18F71
00E18F6B 8943 2C mov [dword ds:ebx+2C],eax
00E18F6E EB 01 jmp short 00E18F71
00E18F70 6933 C08A433B imul esi,[dword ds:ebx],3B438AC0
00E18F76 3BF0 cmp esi,eax <<<<<<<-----比较3种情况!!
00E18F78 75 5E jnz short 00E18FD8
00E18F7A EB 01 jmp short 00E18F7D
00E18F7C C7 ??? ; 未知命令
00E18F7D 66:8B02 mov ax,[word ds:edx]
00E18F80 66:8945 FA mov [word ss:ebp-6],ax
00E18F84 83C2 02 add edx,2
00E18F87 8955 FC mov [dword ss:ebp-4],edx
00E18F8A 66:817D FA FF00 cmp [word ss:ebp-6],0FF
00E18F90 76 0B jbe short 00E18F9D
00E18F92 0FB745 FA movzx eax,[word ss:ebp-6]
00E18F96 E8 B195FDFF call 00DF254C
00E18F9B 8BF8 mov edi,eax
00E18F9D 0FB775 FA movzx esi,[word ss:ebp-6]
00E18FA1 8BCE mov ecx,esi
00E18FA3 8B55 FC mov edx,[dword ss:ebp-4]
00E18FA6 8BC7 mov eax,edi
00E18FA8 E8 2BD0FDFF call 00DF5FD8
00E18FAD 6A 0A push 0A
00E18FAF 8D4B 12 lea ecx,[dword ds:ebx+12]
00E18FB2 8BD6 mov edx,esi
00E18FB4 8BC7 mov eax,edi
00E18FB6 E8 B1B4FEFF call 00E0446C
00E18FBB 897D FC mov [dword ss:ebp-4],edi
00E18FBE 8B45 FC mov eax,[dword ss:ebp-4]
00E18FC1 50 push eax
00E18FC2 8B45 10 mov eax,[dword ss:ebp+10]
00E18FC5 50 push eax
00E18FC6 53 push ebx
00E18FC7 E8 7CFDFFFF call 00E18D48 <<<<<<----1
00E18FCC 8B55 0C mov edx,[dword ss:ebp+C]
00E18FCF 8B12 mov edx,[dword ds:edx]
00E18FD1 8902 mov [dword ds:edx],eax
00E18FD3 E9 20010000 jmp 00E190F8
00E18FD8 33C0 xor eax,eax
00E18FDA 8A43 35 mov al,[byte ds:ebx+35]
00E18FDD 3BF0 cmp esi,eax
00E18FDF 74 22 je short 00E19003
00E18FE1 33C0 xor eax,eax
00E18FE3 8A43 36 mov al,[byte ds:ebx+36]
00E18FE6 3BF0 cmp esi,eax
00E18FE8 74 19 je short 00E19003
00E18FEA 33C0 xor eax,eax
00E18FEC 8A43 37 mov al,[byte ds:ebx+37]
00E18FEF 3BF0 cmp esi,eax
00E18FF1 74 10 je short 00E19003
00E18FF3 33C0 xor eax,eax
00E18FF5 8A43 39 mov al,[byte ds:ebx+39]
00E18FF8 3BF0 cmp esi,eax
00E18FFA 0F85 AD000000 jnz 00E190AD
00E19000 EB 01 jmp short 00E19003
00E19002 E8 33C08A43 call 446C503A
00E19007 36:3BF0 cmp esi,eax
00E1900A 74 09 je short 00E19015
00E1900C 33C0 xor eax,eax
00E1900E 8A43 39 mov al,[byte ds:ebx+39]
00E19011 3BF0 cmp esi,eax
00E19013 75 43 jnz short 00E19058
00E19015 66:8B02 mov ax,[word ds:edx]
00E19018 66:8945 FA mov [word ss:ebp-6],ax
00E1901C 83C2 02 add edx,2
00E1901F 8955 FC mov [dword ss:ebp-4],edx
00E19022 66:817D FA FF00 cmp [word ss:ebp-6],0FF
00E19028 76 0B jbe short 00E19035
00E1902A 0FB745 FA movzx eax,[word ss:ebp-6]
00E1902E E8 1995FDFF call 00DF254C
00E19033 8BF8 mov edi,eax
00E19035 0FB74D FA movzx ecx,[word ss:ebp-6]
00E19039 8B55 FC mov edx,[dword ss:ebp-4]
00E1903C 8BC7 mov eax,edi
00E1903E E8 95CFFDFF call 00DF5FD8
00E19043 6A 0A push 0A
00E19045 8D4B 08 lea ecx,[dword ds:ebx+8]
00E19048 0FB755 FA movzx edx,[word ss:ebp-6]
00E1904C 8BC7 mov eax,edi
00E1904E E8 19B4FEFF call 00E0446C
00E19053 897D FC mov [dword ss:ebp-4],edi
00E19056 EB 08 jmp short 00E19060
00E19058 8B02 mov eax,[dword ds:edx]
00E1905A 8945 FC mov [dword ss:ebp-4],eax
00E1905D EB 01 jmp short 00E19060
00E1905F 9A 33C08A43 393B call far 3B39:438AC033
00E19066 F0:75 24 lock jnz short 00E1908D ; 不允许锁定前缀
00E19069 8B45 FC mov eax,[dword ss:ebp-4]
00E1906C 50 push eax
00E1906D 8B45 10 mov eax,[dword ss:ebp+10]
00E19070 50 push eax
00E19071 53 push ebx
00E19072 E8 D1FCFFFF call 00E18D48 ><<<<<<<<<<<----2
00E19077 8B15 10AAE200 mov edx,[dword ds:E2AA10]
00E1907D 8902 mov [dword ds:edx],eax
00E1907F B8 1481E100 mov eax,0E18114
00E19084 8B55 0C mov edx,[dword ss:ebp+C]
00E19087 8B12 mov edx,[dword ds:edx]
00E19089 8902 mov [dword ds:edx],eax
00E1908B EB 6B jmp short 00E190F8
00E1908D 33C0 xor eax,eax
00E1908F 8A43 35 mov al,[byte ds:ebx+35]
00E19092 3BF0 cmp esi,eax
00E19094 74 62 je short 00E190F8
00E19096 8B45 FC mov eax,[dword ss:ebp-4]
00E19099 50 push eax
00E1909A 8B45 10 mov eax,[dword ss:ebp+10]
00E1909D 50 push eax
00E1909E 53 push ebx
00E1909F E8 A4FCFFFF call 00E18D48 <<<<<<<<----------3
00E190A4 8B55 0C mov edx,[dword ss:ebp+C]
00E190A7 8B12 mov edx,[dword ds:edx]
00E190A9 8902 mov [dword ds:edx],eax
00E190AB EB 4B jmp short 00E190F8
00E190AD 33C0 xor eax,eax
00E190AF 8A43 38 mov al,[byte ds:ebx+38]
00E190B2 3BF0 cmp esi,eax
00E190B4 75 42 jnz short 00E190F8
00E190B6 EB 01 jmp short 00E190B9
00E190B8 9A B89482E1 008B call far 8B00:E18294B8
00E190BF 55 push ebp
00E190C0 0C 8B or al,8B
00E190C2 1289 02B80C93 adc cl,[byte ds:ecx+930CB802]
00E190C8 E1 00 loopde short 00E190CA
00E190CA BE 9C82E100 mov esi,0E1829C
00E190CF 2BC6 sub eax,esi
00E190D1 50 push eax
00E190D2 56 push esi
00E190D3 E8 ECA9FEFF call 00E03AC4
00E190D8 3B43 28 cmp eax,[dword ds:ebx+28]
00E190DB 74 1B je short 00E190F8
00E190DD 6A FF push -1
00E190DF E8 98C5FEFF call 00E0567C
00E190E4 8D53 08 lea edx,[dword ds:ebx+8]
00E190E7 8902 mov [dword ds:edx],eax
00E190E9 6A 1E push 1E
00E190EB E8 8CC5FEFF call 00E0567C
00E190F0 8B55 0C mov edx,[dword ss:ebp+C]
00E190F3 0102 add [dword ds:edx],eax
00E190F5 EB 01 jmp short 00E190F8
00E190F7 - E9 8B450C83 jmp 83EDD687
00E190FC 00048D 85FAFEFF add [byte ds:ecx*4+FFFEFA85],al
00E19103 FF3B ??? ; 未知命令
00E19105 F8 clc
00E19106 74 07 je short 00E1910F
00E19108 8BC7 mov eax,edi
00E1910A E8 5594FDFF call 00DF2564
00E1910F 5F pop edi
00E19110 5E pop esi
00E19111 5B pop ebx
00E19112 8BE5 mov esp,ebp
00E19114 5D pop ebp
00E19115 C2 1000 retn 10
处理完IAT后,在第二次int3后,CTRL+B找"83 C4 28 5D 5F 5E 5B C3",共有2处:
1、
00E284A9 68 0085E200 push 0E28500 ; ASCII "60"
00E284AE E8 61CCFDFF call 00E05114
00E284B3 8BC6 mov eax,esi
00E284B5 E8 5AA7FCFF call 00DF2C14
00E284BA E8 1DF5FFFF call 00E279DC
00E284BF 83C4 28 add esp,28
00E284C2 5D pop ebp
00E284C3 5F pop edi
00E284C4 5E pop esi
00E284C5 5B pop ebx
00E284C6 C3 retn
2、
00E289AA 8BC3 mov eax,ebx
00E289AC E8 63A2FCFF call 00DF2C14
00E289B1 E8 26F0FFFF call 00E279DC ; 进!
00E289B6 83C4 28 add esp,28
00E289B9 5D pop ebp
00E289BA 5F pop edi
00E289BB 5E pop esi
00E289BC 5B pop ebx
00E289BD C3 retn
这个“ 83 C4 28 5D 5F 5E 5B C3”就是syscom找OEP的特征码,这个地方ASPR只有点小变化,
以前是这样:按 CTRL+B 搜? 83,C4,2C,5D,5F,5E,5B,C3 ,在 00BDA8C5 ,韵硬件??
00BDA8C5--E8 7ACEFFFF CALL 00BD7744 <= 韵硬件??
00BDA8CA--83C4 2C ADD ESP,2C
00BDA8CD--5D POP EBP
00BDA8CE--5F POP EDI
00BDA8CF--5E POP ESI
00BDA8D0--5B POP EBX
00BDA8D1--C3 RETN
进入后也与以前没有出入:
00E37A46 C1CB CB ror ebx,0CB
00E37A49 68 D7036001 push 16003D7
00E37A4E 81C3 D4B0ED76 add ebx,76EDB0D4
00E37A54 5B pop ebx
00E37A55 53 push ebx
00E37A56 C1D3 25 rcl ebx,25
00E37A59 BB C2A84200 mov ebx,42A8C2
00E37A5E C3 retn <<<<<<<<回到OEP!
00E37A5F 26:EB 02 jmp short 00E37A64
OEP:
015F023F 55 push ebp ; gen.00400000
015F0240 E9 050C0000 jmp 015F0E4A
015F0245 8B42 10 mov eax,[dword ds:edx+10]
在上面回到OEP的retn处,我们可以找到下面:
00E26BA2 66:8B4D EC mov cx,[word ss:ebp-14]
00E26BA6 66:8B55 E8 mov dx,[word ss:ebp-18]
00E26BAA 8B45 F4 mov eax,[dword ss:ebp-C]
00E26BAD E8 F2F6FFFF call 00E262A4
00E26BB2 84C0 test al,al
00E26BB4 8B45 F4 mov eax,[dword ss:ebp-C]
00E26BB7 8B80 E0000000 mov eax,[dword ds:eax+E0]
00E26BBD 0345 E4 add eax,[dword ss:ebp-1C] ;这句之后,eax就是API地址了.
00E26BC0 8945 FC mov [dword ss:ebp-4],eax ; kernel32.GetCommandLineA
00E26BC3 57 push edi
00E26BC4 6A 00 push 0
00E26BC6 8D4D E0 lea ecx,[dword ss:ebp-20]
00E26BC9 8B45 F4 mov eax,[dword ss:ebp-C]
00E26BCC 8B40 3C mov eax,[dword ds:eax+3C]
00E26BCF 8B55 FC mov edx,[dword ss:ebp-4]
eax=77E74B16 (kernel32.GetCommandLineA)
堆栈 [ss:0012FE64]=0012FE84
按 CTRL+B 搜? 89,45,F0,B8,00,07,00,00 ,这以后,就按syscom那样处理了。
00E28B0A 33C0 xor eax,eax
00E28B0C 8945 F0 mov [dword ss:ebp-10],eax
00E28B0F B8 00070000 mov eax,700
00E28B14 E8 339AFDFF call 00E0254C
由于时间的原因我就只能这样简单写一下了,你可以详尽分析它。
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!