V6.9 Build400 加了四层壳,最里面是两层PEbundle 3.01壳,然后是Aspack2.12压缩壳,最外层是Armadillo 3.6标准单进程壳。
ArmFP1.6察看:
<------- 05-06-2008 16:27:10 ------->
E:\FAp\FAp.exe
!- Protected Armadillo
Protection system (Basic)
!- <Protection Options>
Standard protection or Minimum protection
!- <Backup Key Options>
Fixed Backup Keys
!- <Compression Options>
Best/Slowest Compression
!- <Other Options>
!- Version 3.60 22Jan2004
Armadillo 3.60标准单进程壳,且已知程序为VB程序,可不用修改Magic jmp,直接OD载入
bp CreateThread,Shift+F9运行停下,看堆栈:
0012F568 00F1D550 /CALL 到 CreateThread 来自 00F1D54A //返回的是壳代码
0012F56C 00000000 |pSecurity = NULL
0012F570 00000000 |StackSize = 0
0012F574 00F1DAE5 |ThreadFunction = 00F1DAE5
0012F578 00000000 |pThreadParm = NULL
0012F57C 00000000 |CreationFlags = 0
0012F580 0012F588 \pThreadId = 0012F588
Alt+F9来到:
00F1D550 5E pop esi ; FAp.0083A0F0
00F1D551 C9 leave
00F1D552 C3 retn
F7走过retn来到下面,向下看找call edi,就是到入口的call
00F3457D 6A 00 push 0 //retn后来到这里
00F3457F C705 DCDBF300 E>mov dword ptr [F3DBDC], 0F3E6E8 ; ASCII "RC"
00F34589 E8 7231FEFF call 00F17700
00F3458E 59 pop ecx
00F3458F 59 pop ecx
00F34590 E8 4A11FFFF call 00F256DF
略......
00F345DA EB 25 jmp short 00F34601
00F345DC 83F9 01 cmp ecx, 1
00F345DF 75 22 jnz short 00F34603
00F345E1 FF76 04 push dword ptr [esi+4]
00F345E4 FF76 08 push dword ptr [esi+8]
00F345E7 6A 00 push 0
00F345E9 E8 F110FFFF call 00F256DF
00F345EE 50 push eax
00F345EF A1 9455F400 mov eax, dword ptr [F45594]
00F345F4 8B48 70 mov ecx, dword ptr [eax+70]
00F345F7 3348 68 xor ecx, dword ptr [eax+68]
00F345FA 3348 04 xor ecx, dword ptr [eax+4]
00F345FD 2BF9 sub edi, ecx
00F345FF FFD7 call edi //这里就是到入口的Call
00F34601 8BD8 mov ebx, eax
00F34603 5F pop edi
00F34604 8BC3 mov eax, ebx
00F34606 5E pop esi
00F34607 5B pop ebx
00F34608 C3 retn
取消CreateThread断点,在00F345FF处按F4,断下,F7进入来到Aspack 2.12的壳入口:
007F1001 60 pushad //这里Aspack 2.12的壳入口
007F1002 E8 03000000 call 007F100A
007F1007 - E9 EB045D45 jmp 45DC14F7
007F100C 55 push ebp
007F100D C3 retn
007F100E E8 01000000 call 007F1014
007F1013 EB 5D jmp short 007F1072
压缩壳,很好跟,注意变形Call和运用F4跳出大循环就行,来到这里:
007F13B0 /75 08 jnz short 007F13BA
007F13B2 |B8 01000000 mov eax, 1
007F13B7 |C2 0C00 retn 0C
007F13BA \68 00F07E00 push 007EF000 //下一个壳PEbundle 3.01的入口
007F13BF C3 retn //返回到007EF000
过了retn就来到PEbundle 3.01的入口:
007EF000 9C pushfd
007EF001 60 pushad
007EF002 E8 02000000 call 007EF009
007EF007 33C0 xor eax, eax
007EF009 8BC4 mov eax, esp
007EF00B 83C0 04 add eax, 4
Ctrl+S搜索命令序列popad/popfd,来到这里:
007EF466 61 popad
007EF467 9D popfd
007EF468 68 00207E00 push 007E2000 //下一个壳PEbundle 3.01的入口
007EF46D C3 retn //返回到007E2000
007EF468处F4,停下,F7走过retn来到007E2000,第二层PEbundle 3.01的入口:
007E2000 9C pushfd //第二层PEbundle 3.01的入口
007E2001 60 pushad
007E2002 E8 02000000 call 007E2009
007E2007 33C0 xor eax, eax
007E2009 8BC4 mov eax, esp
007E200B 83C0 04 add eax, 4
继续Ctrl+S搜索命令序列popad/popfd,来到这里:
007E2457 /E9 7A020000 jmp 007E26D6
007E245C |C785 3D294000 0>mov dword ptr [ebp+40293D], 1
007E2466 |61 popad
007E2467 |9D popfd
007E2468 |68 B8994000 push 004099B8 //呵呵,真正的OEP
007E246D |C3 retn
好了,007E2468处F4,停下,F7走过retn来到真正的入口004099B8:
004099B8 68 049C4000 push 00409C04 ; ASCII "VB5!6&vb6chs.dll"
004099BD E8 EEFFFFFF call 004099B0
004099C2 0000 add byte ptr [eax], al
004099C4 0000 add byte ptr [eax], al
004099C6 0000 add byte ptr [eax], al
打开LordPE-DLX选择FAp.exe进程,Dump Full,得到dumped.exe.打开ImportREC 1.6F,选择FAp.exe进程,
填入OEP:000099B8,IAT AutoSearch,获取输入表,Show Invalid,只有一个:rva:0000104C ptr:00F1B7E1,
这个函数对于VB程序来说就是MSVBVM60!__vbaEnd函数,双击rva:0000104C,替换为MSVBVM60!__vbaEnd函数,
Fix Dump,得到dumped_.exe,运行正常,大小5.58Mb。
优化一下,OD载入dumped_.exe,Alt+M在除.mackt外的所有区段下断点,一直Shift+F9运行到程序界面出现,
查看未使用的区段为4个pebundle区段, .adata, .text1, .adata1, .data1, .reloc, .pdata区段,
用LordPE-DLX打开dumped_.exe,wipe掉这10个区段,重建一下PE,得到dumped__.exe,大小3.48Mb,运行正常。
到此脱壳结束,总结一下,共加了四层壳:
1)Armadillo 3.60 标准单进程壳 脱掉后EP:007F1001
2)Aspack 2.12 压缩壳 脱掉后EP:007EF000
3)PEbundle 3.01 壳 脱掉后EP:007E2000
4)PEbundle 3.01 壳 脱掉后OEP:004099B8
破解:
第一处:
004B9BAC E8 2FB32900 CALL dumped__.00754EE0
004B9BB1 0FBFD0 MOVSX EDX,AX
004B9BB4 85D2 TEST EDX,EDX
004B9BB6 74 12 JE SHORT dumped__.004B9BCA
004B9BB8 C745 FC 12000000 MOV DWORD PTR SS:[EBP-4],12
004B9BBF 66:C705 0C817600 F>MOV WORD PTR DS:[76810C],0FFFF
004B9BC8 EB 10 JMP SHORT dumped__.004B9BDA
修改为如下:
004B9BAC E8 2FB32900 CALL dumped__.00754EE0
004B9BB1 33D2 XOR EDX,EDX
004B9BB3 42 INC EDX
004B9BB4 85D2 TEST EDX,EDX
004B9BB6 74 12 JE SHORT dumped__.004B9BCA
004B9BB8 C745 FC 12000000 MOV DWORD PTR SS:[EBP-4],12
004B9BBF 66:C705 0C817600 F>MOV WORD PTR DS:[76810C],0FFFF
004B9BC8 EB 10 JMP SHORT dumped__.004B9BDA
第二处:
004BA0FA E8 F1680800 CALL dumped__.005409F0
004BA0FF 0FBFD0 MOVSX EDX,AX
004BA102 85D2 TEST EDX,EDX
004BA104 0F84 08010000 JE dumped__.004BA212
004BA10A C745 FC 32000000 MOV DWORD PTR SS:[EBP-4],32
修改为如下:
004BA0FA E8 F1680800 CALL dumped__.005409F0
004BA0FF 33D2 XOR EDX,EDX
004BA101 42 INC EDX
004BA102 85D2 TEST EDX,EDX
004BA104 0F84 08010000 JE dumped__.004BA212
004BA10A C745 FC 32000000 MOV DWORD PTR SS:[EBP-4],32
上传的附件: