ASPotect 1.23 RC4 脱壳+暗桩消除——PowerStrip V3.47
下载页面: http://www.skycn.com/soft/2378.html
软件大小: 723 KB
软件语言: 简体中文
软件类别: 国外软件 / 共享版 / 桌面工具
应用平台: Win9x/NT/2000/XP
加入时间: 2003-11-03 15:19:18
下载次数: 97337
推荐等级: *****
【软件简介】:功能非常强悍的显示卡/屏幕功能配置工具,诸如调整桌面尺寸、屏幕更新频率、放大缩小桌面、屏幕位置调整、桌面字型调整、鼠标游标放大缩小、图形与显示卡系统资讯、显示卡执行效能调整等;而这些功能都可利用附在桌面上的Toolbar或是快速键来快速变更你的喜好。另外,此程序内建12种文字显示方式,包括繁体和简体中文,而且可支持多屏幕到9个屏幕。
【作者声明】:只是感兴趣,没有其他目的。失误之处敬请诸位大侠赐教!
【调试环境】:WinXP、Ollydbg1.09、PEiD、LordPE、AsprDbgr、ImportREC
—————————————————————————————————
【脱壳过程】:
一、寻找OEP
老规矩:用IsDebug 1.4插件去掉Ollydbg的调试器标志。
设置Ollydbg忽略除了“内存访问异常”之外的所有其他异常选项。
00401000 68 01305F00 push pstrip.005F3001//进入OD后停在这!
F9运行,程序会中断在异常处,Shift+F9通过异常
00BA39EC 3100 xor dword ptr ds:[eax],eax//最后1次异常
00BA39EE 64:8F05 00000000 pop dword ptr fs:[0]
00BA39F5 58 pop eax
00BA39F6 833D B07EBA00 00 cmp dword ptr ds:[BA7EB0],0
00BA39FD 74 14 je short 00BA3A13
00BA39FF 6A 0C push 0C
00BA3A01 B9 B07EBA00 mov ecx,0BA7EB0
00BA3A06 8D45 F8 lea eax,dword ptr ss:[ebp-8]
00BA3A09 BA 04000000 mov edx,4
00BA3A0E E8 2DD1FFFF call 00BA0B40
00BA3A13 FF75 FC push dword ptr ss:[ebp-4]
00BA3A16 FF75 F8 push dword ptr ss:[ebp-8]
00BA3A19 8B45 F4 mov eax,dword ptr ss:[ebp-C]
00BA3A1C 8338 00 cmp dword ptr ds:[eax],0
00BA3A1F 74 02 je short 00BA3A23
00BA3A21 FF30 push dword ptr ds:[eax]
00BA3A23 FF75 F0 push dword ptr ss:[ebp-10]
00BA3A26 FF75 EC push dword ptr ss:[ebp-14]
00BA3A29 C3 retn//此处下断,Shift+F9,断在这!返回 00BB6A14
00BB6A14 66:BA E4D8 mov dx,0D8E4
00BB6A18 E8 12000000 call 00BB6A2F
使用模拟跟踪:TC EIP<600000 几十秒后Ollydbg自动暂停在00403548
00403548 E8 B3FFFFFF call pstrip.00403500//暂停在这!记下各寄存器的值
0040354D 6A 00 push 0
0040354F E8 A8DDFFFF call pstrip.004012FC
00403554 8905 14C05500 mov dword ptr ds:[55C014],eax
0040355A E8 85DDFFFF call pstrip.004012E4
0040355F 8905 1CC05500 mov dword ptr ds:[55C01C],eax
00403565 C705 18C05500 0A0000>mov dword ptr ds:[55C018],0A
0040356F B8 A0324000 mov eax,pstrip.004032A0
00403574 C3 retn//返回 00555DF8
00555DED 0000 add byte ptr ds:[eax],al
00555DEF 0000 add byte ptr ds:[eax],al
00555DF1 0000 add byte ptr ds:[eax],al
00555DF3 E8 50D7EAFF call pstrip.00403548
00555DF8 E8 77F4EAFF call pstrip.00405274//00403574返回到这里
00555DFD E8 D637EBFF call pstrip.004095D8
00555E02 E8 A9B2EBFF call pstrip.004110B0
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
暂停在00403548处时的相关寄存器的值: 修复OEP处Stolen Code的参考!
EAX=00000000
ESI=00000024
EDI=00000000
ESP=0012FFAC
EBP=0012FFC0
堆栈值:
0012FFA8 00403548 pstrip.00403548
0012FFAC 00555DF8 返回到 pstrip.00555DF8 来自 pstrip.00403548
0012FFB0 7FFDF000
0012FFB4 7FFDF000
0012FFB8 00BB6BDA
0012FFBC 0012FFF0
0012FFC0 0012FFF0
0012FFC4 77E5EB69 返回到 kernel32.77E5EB69
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
查看 运行跟踪 ,很容易看见从壳中返回程序的地方
00BBE9DF 51 push ecx
00BBE9E0 57 push edi
00BBE9E1 9C pushfd
00BBE9E2 FC cld
00BBE9E3 BF 20EABB00 mov edi,0BBEA20
00BBE9E8 B9 5E140000 mov ecx,145E
00BBE9ED F3:AA rep stos byte ptr es:[edi]
00BBE9EF 9D popfd
00BBE9F0 5F pop edi
00BBE9F1 59 pop ecx
00BBE9F2 C3 retn//这里返回程序 00403548
———————————————————————
二、补上OEP处的Stolen Code
参考上面记录的数据,这个Stolen Code可以作如下简单修复:
00555DED 55 push ebp//在这儿用LordPE纠正ImageSize后完全DUMP这个进程
00555DEE 8BEC mov ebp,esp
00555DF0 83C4 F4 add esp,-0C//上面的是补上的Stolen Bytes
00555DF3 E8 50D7EAFF call PowerStr.00403548
00555DF8 E8 77F4EAFF call PowerStr.00405274
00555DFD E8 D637EBFF call PowerStr.004095D8
—————————————————————————————————
三、修复输入表
用AsprDbgr v1.0 修复ASPotect 1.23 RC4壳的输入表还是比较方便的。用AsprDbgr v1.0beta载入pstrip.exe
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
AsprDbgr v1.0beta () Made by me... Manko.
iEP=401000 (E:试炼场脱壳学习ASProtectPowerStrip 3.47pstrip.exe)
GST returns to: B92667
Trick aspr GST... (EAX=12121212h)
GV returns to: BA1A61
IAT Start: 56E12C
End: 56E880
Length: 754
IATentry 56E160 = BA1C64 resolved as GetModuleHandleA
IATentry 56E16C = BA1CD8 resolved as GetCommandLineA
IATentry 56E65C = BA1CC8 resolved as LockResource
IATentry 56E6A0 = BA1C8C resolved as GetVersion
IATentry 56E6C8 = BA17A4 resolved as GetProcAddress
IATentry 56E6D8 = BA1C64 resolved as GetModuleHandleA
IATentry 56E700 = BA1CC0 resolved as GetCurrentProcessId
IATentry 56E704 = BA1CB8 resolved as GetCurrentProcess
IATentry 56E708 = BA1CF0 resolved as FreeResource
14 invalid entries erased.
Dip-Table at adress: BA7AB4
0 52947C 0 0 529494 5294AC 0 0 0 0 0 0 0 0
Last SEH passed. Searching for signatures. Singlestepping to OEP!
Call + OEP-jump-setup at: BB6B3A ( Code: E8000000 5D81ED )
Mutated, stolen bytes at: BB6B85 ( Code: 61EB02CD 20EB01F0 )
Erase of stolen bytes at: BB6AE9 ( Code: 9CFCBF28 6BBB00B9 )
Repz ... found. Skipping erase of stolen bytes.
Dip from pre-OEP: 403548 (Reached from: BB6AFA)
Sugested tempOEP at: 555DF3
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
运行ImportREC,选择这个进程。把OEP改为00003548,点IT AutoSearch,点“Get Import”,呵呵,函数全部有效。把OEP改回00155DED ,FixDump。
—————————————————————————————————
四、消除暗桩
现在脱壳后的程序可以运行起来,但是点击右键却无法弹出主程序窗口了。
为了这个暗桩偶找了很久,原先偶以为是有自校验,后来 jingulong 兄给了偶可以运行的去壳程序,确定还是壳的问题。jingulong 兄真是牛人,偶望尘莫及!
————————————————————————
用Ollydbg载入dumped_.exe,设置Ollydbg忽略除了“内存访问异常”之外的所有其它异常选项。
F9运行,停在0055B1E1异常处。
0055B1DA 8B40 02 mov eax,dword ptr ds:[eax+2]
0055B1DD 8B00 mov eax,dword ptr ds:[eax]
0055B1DF FF30 push dword ptr ds:[eax]
0055B1E1 8F00 pop dword ptr ds:[eax]//异常
0055B1E3 FFE3 jmp ebx
重新Load,在0055B1DA内存处下 内存访问断点,经过分析,确定以下2个可疑点:
1、00522BC1处
00522B95 C745 F4 0D000000 mov dword ptr ss:[ebp-C],0D
00522B9C B8 D8B15500 mov eax,dumped_.0055B1D8
00522BA1 FE08 dec byte ptr ds:[eax]//[eax]=0055B1D8
00522BA3 40 inc eax
00522BA4 FF4D F4 dec dword ptr ss:[ebp-C]//[ebp-C]=D
00522BA7 75 F8 jnz short dumped_.00522BA1//循环12次
00522BA9 33D2 xor edx,edx
00522BAB 55 push ebp
00522BAC 68 92305200 push dumped_.00523092
00522BB1 64:FF32 push dword ptr fs:[edx]
00522BB4 64:8922 mov dword ptr fs:[edx],esp
00522BB7 68 08544000 push <jmp.&kernel32.ExitThread>
00522BBC B8 D8B15500 mov eax,dumped_.0055B1D8
00522BC1 FFD0 call eax ; dumped_.0055B1D8//进入
00522BC3 803D 48335600 00 cmp byte ptr ds:[563348],0
00522BCA 74 43 je short dumped_.00522C0F
00522BA1-00522BA7处的循环是使0055B1D8处的12个字节值各自-1:
0055B1D8 5C 59 8C 41 03 8C 01 00 31 90 01 00 E4 8D 40 00 //原先值
0055B1D8 5B 58 8B 40 02 8B 00 FF 30 8F 00 FF E3 8D 40 00 //改变值
进入00522BC1 call eax ; dumped_.0055B1D8 看看:
0055B1D8 5B pop ebx
0055B1D9 58 pop eax
0055B1DA 8B40 02 mov eax,dword ptr ds:[eax+2]
0055B1DD 8B00 mov eax,dword ptr ds:[eax]
0055B1DF FF30 push dword ptr ds:[eax]
0055B1E1 8F00 pop dword ptr ds:[eax]//[eax]=[77E53C49]=0868146A 异常!
0055B1E3 FFE3 jmp ebx
————————————————————————
2、0052487D 处 这里和上面的一样
00524855 BB 0D000000 mov ebx,0D
0052485A B8 D8B15500 mov eax,dumped_.0055B1D8//[eax]=0055B1D8
0052485F FE08 dec byte ptr ds:[eax]
00524861 40 inc eax
00524862 4B dec ebx//EBX=D
00524863 75 FA jnz short dumped_.0052485F//循环
00524865 33D2 xor edx,edx
00524867 55 push ebp
00524868 68 D54B5200 push dumped_.00524BD5
0052486D 64:FF32 push dword ptr fs:[edx]
00524870 64:8922 mov dword ptr fs:[edx],esp
00524873 68 08544000 push <jmp.&kernel32.ExitThread>
00524878 B8 D8B15500 mov eax,dumped_.0055B1D8
0052487D FFD0 call eax ; dumped_.0055B1D8//这里也使0055B1E1处发生了异常!
0052485F-00524863处的循环是使0055B1D8处的12个字节值各自-1:
0055B1D8 5C 59 8C 41 03 8C 01 00 31 90 01 00 E4 8D 40 00 //原先值
0055B1D8 5B 58 8B 40 02 8B 00 FF 30 8F 00 FF E3 8D 40 00 //改变值
————————————————————————
3、解决方法
0055B1E1 8F00 pop dword ptr ds:[eax]//异常处
偶偷了一下懒 使程序把上面的异常处NOP掉!
0055B1E1 90 01 //原先值
0055B1E1 91 91 //修改值
改了0055B1E1处的2个字节,呵呵,终于运行正常了!
—————————————————————————————————
, _/
/| _.-~/ _ , 青春都一饷
( /~ / ~-._ |
`\ _/ ~ ) 忍把浮名
_-~~~-.) )__/;;,. _ //'
/'_, --~ ~~~- ,;;___( (.-~~~-. 换了破解轻狂
`~ _( ,_..-- ( ,;'' / ~-- /._`
/~~//' /' `~ ) /--.._, )_ `~
" `~" " `" /~'` `\~~
" " "~' ""
Cracked By: jingulong
整 理: fly
2004-01-15 17:20