邪恶八进制信息安全团队技术讨论组's Archiver

cnhcerkf 2006-11-25 00:37

[转载]菜鸟脱ASPR从这个软件开始学习 系列教程

[b]原始连接:[url]http://bbs.unpack.cn/viewthread.php?tid=6144[/url]
machenglin 发表于: 2006-7-27 11:21 [/b]
软件名称: Express Thumbnail Creator  v1.81
官方主页 :[url]http://www.neowise.com/[/url]
下载页面: [url]http://www.neowise.com/downloads/[/url]
软件大小: 1.9 MB
软件语言: 英文
软件类别: 国外软件 / 共享版
应用平台: WinAll
软件介绍: Express Thumbnail Creator帮你件快速的建立HTML网页相簿或图库,内置向导,帮你一步一步的完成设定,完成后就可以导出HTML文件。
[code]
PEid 0.94 : ASProtect 2.1x SKE -> Alexey Solodovnikov
ver0.14 : ASProtect 1.35 build 01.26 Release [Extract]

编译语言: Delphi
SDK使用 : 无Stolen Code,无Stolen OEP
API使用 :  GetRegistrationInformation
这个东东非常非常的简单, 适合初学Asprotect的朋友上手^_^
[/code]
[code]
脱壳参考文件:[url]http://www.unpack.cn/attachment.php?aid=3459[/url]
[/code]
自[一蓑烟雨]论坛建立2个试练场后,版主和一些朋友提供了很多的脱壳参考软件,在此感谢。
由于对初学者相对来说ASPR是属于一个猛壳,所以,本人从最简单的ASPR开始,把自己的学习脱壳过程贴上来,希望能对初学者有些帮助,以增强他们学习脱壳的信心。

00401000 e>  68 018074>push etc.00748001                ; 程序入口点。
00401005    E8 010000>call etc.0040100B
0040100A    C3      retn
0040100B    C3      retn
0040100C  - E3 8E    jecxz short etc.00400F9C
============================================================================================================
一、脱壳。
运行VolX大侠脚本Aspr2.XX_IATfixer_v1.02s。
当出现 “import table is fixed....................”的讯息框, 点确定键后,再到 OD 点击 plugin-ODGscript-resume, 就可到 OEP。
0061B3C4    55      push ebp                      ; etc.00400000
0061B3C5    8BEC    mov ebp,esp
0061B3C7    83C4 F0  add esp,-10
0061B3CA    53      push ebx
0061B3CB    B8 F4AD61>mov eax,etc.0061ADF4
0061B3D0    E8 43BADE>call etc.00406E18
0061B3D5    A1 343663>mov eax,dword ptr ds:[633634]
0061B3DA    8B00    mov eax,dword ptr ds:[eax]
0061B3DC    E8 2F88E7>call etc.00493C10
0061B3E1    A1 343663>mov eax,dword ptr ds:[633634]
0061B3E6    8B00    mov eax,dword ptr ds:[eax]
0061B3E8    BA 30B461>mov edx,etc.0061B430              ; ASCII "Express Thumbnail Creator"
============================================================================================================
OEP=0061B3C4-00400000=21B3C4

Alt+L,打开记录数据窗口。

iatstartaddr: 0064121C-400000=24121C  //RVA
iatsize: 00000974               //Size

LordPE--->完整转存--->dumped.exe

ImportREC--->OEP=21B3C4,RVA=24121C,Size=974--->获取输入表,显示2个无效指针。
显示未解决的指针2个,右键--->插件跟踪--->ASPRotect 1.2--->修复这2个无效指针。

修复转储文件,得到dumped_.exe。
============================================================================================================
二、注册。

OD载入dumped_.exe,F9,程序运行正常,出来要求注册的提示。

菜单--->Help--->About....--->TRIAL VERSION,是实验版。

内存搜索: TRIAL VERSION

找到这里。
[code]
005DC0C7    E8 CC0FEB>call dumped_.0048D098
005DC0CC    A1 A83763>mov eax,dword ptr ds:[6337A8]        ; [6337A8]=用户信息地址
===========================
ds:[006337A8]=0061D3DC
eax=000000C8
===========================
在当前的区段尾找一块空地,写入你要注册的信息,复制到可执行文件。
==============================================================================
0061BF00  6D 61 63 68 65 6E 67 6C 69 6E 0D 0A 68 74 74 70  machenglin..http
0061BF10  2F 2F 77 77 77 2E 75 6E 70 61 63 6B 2E 63 6E 00  //www.unpack.cn.
==============================================================================

并将这个地址填写到0061D3DC,这里是0061BF00,复制到可执行文件。
==============================================================================
0061D3DC  00 BF 61 00 9C 77 12 01 B1 5F 9D 76 F3 42 9A 76  .縜.渨盻漹驜歷
0061D3EC  5B 55 A4 76 65 55 A4 76 84 DF 9C 76 6F 35 9D 76  [UeU勥渧o5漹
0061D3FC  FF FF FF FF 00 00 00 00 4C 62 49 00 60 62 49 00  ....LbI.`bI.
==============================================================================

005DC0D1    8338 00  cmp dword ptr ds:[eax],0            ; 有无注册信息
005DC0D4    74 3F    je short dumped_.005DC115           ; 没有就跳到5DC115-->TRIAL
005DC0D6    8D45 F8  lea eax,dword ptr ss:[ebp-8]
005DC0D9    50      push eax
005DC0DA    8D55 F4  lea edx,dword ptr ss:[ebp-C]         ; [ebp-C]=12FC4C
005DC0DD    A1 4C3163>mov eax,dword ptr ds:[63314C]
005DC0E2    E8 79AAE2>call dumped_.00406B60
005DC0E7    8B45 F4  mov eax,dword ptr ss:[ebp-C]
005DC0EA    50      push eax
005DC0EB    A1 A83763>mov eax,dword ptr ds:[6337A8]
005DC0F0    8B00    mov eax,dword ptr ds:[eax]          ; [eax]=61BF00=用户信息
005DC0F2    8945 EC  mov dword ptr ss:[ebp-14],eax
005DC0F5    C645 F0 0>mov byte ptr ss:[ebp-10],0B
005DC0F9    8D55 EC  lea edx,dword ptr ss:[ebp-14]
005DC0FC    33C9    xor ecx,ecx
005DC0FE    58      pop eax
005DC0FF    E8 60E8E2>call dumped_.0040A964
......
0040A802    8B4E FC  mov ecx,dword ptr ds:[esi-4]         ; [esi-4]=注册信息大小
0040A805    3B4D DC  cmp ecx,dword ptr ss:[ebp-24]
0040A808    77 01    ja short dumped_.0040A80B
0040A80A    C3      retn
[/code]
[esi-4]=注册信息大小中,我的注册信息是31个字,在[esi-4]写入1Fh,复制到可执行文件。

cnhcerkf 2006-11-25 00:40

[code]软件名称: NeoDownloader v2.02
下载页面: [url]http://www.neowise.com/ftp/NeoDownloaderSetup.zip[/url]
软件大小: 1.9 MB
软件语言: 英文
软件类别: 国外软件 / 共享版
应用平台: Windows2000/XP/2003
软件介绍: 超快速的抓图工具!你只要给它一个网址,它就会自动搜寻图片,把图片全抓回你的计算机里面。还具有秀图、桌布设置..等功能,若再搭配上 Express Thumbnail Creator 就可制作网络相簿!
[/code]

[code]
PEid 0.94 : ASProtect 1.2x - 1.3x [Registered] -> Alexey Solodovnikov
ver0.14 : Version: ASProtect 1.35 build 04.25 Release [Self]

编译语言: Delphi
SDK使用 : 无Stolen Code,有Stolen OEP
API使用 :  GetRegistrationInformation
[/code]

脱壳参考文件:[url]http://www.unpack.cn/attachment.php?aid=3401[/url]
一些ASPR的壳,有Stolen OEP、Stolen Code的话,初学者很难从壳内恢复OEP或Stolen Code的代码,这里我们可以采用SYSCOM大侠补区段的方法来解决,达到脱壳的目的。

00401000 N>  68 01C082>push NeoDownl.0082C001             ; 程序入口点
00401005    E8 010000>call NeoDownl.0040100B
0040100A    C3      retn
0040100B    C3      retn
============================================================================================================
一、运行脚本。

运行VolX大侠脚本Aspr2.XX_IATfixer_v1.02s。
当出现 “import table is fixed....................”的讯息框, 点确定键后,再到 OD 点击 plugin-ODGscript-resume, 就可到 OEP。

013C0521    55      push ebp                      ; 000655E90
013C0522    EB 01    jmp short 013C0525
013C0524    9A BDF64E>call far 6500:464EF6BD
013C052B    EB 01    jmp short 013C052E

OEP=00655E90-00400000=255E90

Alt+L,打开记录数据。

iatstartaddr: 0067E258-400000=27E258  //RVA
iatsize: 00000A14               //Size

LordPE--->完整转存--->dumped.exe

ImportREC--->OEP=255E90,RVA=27E258,Size=A14--->获取输入表。
显示未解决的指针2个,右键--->插件跟踪--->ASPRotect 1.22,修复完成。
修复转储文件,得到dumped_.exe。
============================================================================================================
二、补区段。

Alt+M,打开内存窗口。
在011170000~01490000下所有Priv类型F2断点,为啥在该范围下断?我们先用寻找OEP的脚本运行后,在内存窗口记录下这个程序后面的最高区段,在这里作为参考。

F9多次,直到运行到出现程序界面,Alt+M,打开内存窗口。
发现使用的区段为:
011F0000
01230000
01390000
013C0000
01430000
01450000
01460000
01470000
01480000
01490000
共10个区段,LordPE--->区域转存--->上面的10个区段。

载入补区段的dumped_.exe,在补的区段上全部F2下断。

F9,到这里开始准备修正Route Check。
012184FC    55      push ebp
012184FD    8BEC    mov ebp,esp
012184FF    83C4 F8  add esp,-8
01218502    53      push ebx
01218503    56      push esi
01218504    57      push edi
01218505    8B5D 08  mov ebx,dword ptr ss:[ebp+8]
01218508    EB 01    jmp short AAAA_.0121850B
0121850A    9A 8B4518>call far 08E8:8318458B

来到这里。
01218536    698B 7330>imul ecx,dword ptr ds:[ebx+7B8B3073],97E>
01218540    2101    and dword ptr ds:[ecx],eax
01218542    8B40 34  mov eax,dword ptr ds:[eax+34]        ; nop
01218545    FFD0    call eax                      ; nop
01218547    2945 0C  sub dword ptr ss:[ebp+C],eax         ; mov eax,dword ptr ss:[esp+58]
0121854A    8B45 0C  mov eax,dword ptr ss:[ebp+C]         ; sub eax,5
0121854D    2B43 18  sub eax,dword ptr ds:[ebx+18]
01218550    2B43 68  sub eax,dword ptr ds:[ebx+68]

二进制:90 90 8B 44 24 58 83 E8 05 90 90

修补后的代码。
01218536    698B 7330>imul ecx,dword ptr ds:[ebx+7B8B3073],97E>
01218540    2101    and dword ptr ds:[ecx],eax
01218542    90      nop                          ; nop
01218543    90      nop
01218544    8B4424 58 mov eax,dword ptr ss:[esp+58]
01218548    83E8 05  sub eax,5
0121854B    90      nop
0121854C    90      nop
0121854D    2B43 18  sub eax,dword ptr ds:[ebx+18]
01218550    2B43 68  sub eax,dword ptr ds:[ebx+68]
============================================================================================================
三、注册。

OD载入dumped_.exe,F9,程序运行正常,出来要求注册的提示。

菜单--->Help--->About....--->TRIAL VERSION,是实验版。

内存搜索: TRIAL VERSION

找到这里。

006425C8    55      push ebp
006425C9    8BEC    mov ebp,esp
006425CB    8B45 08  mov eax,dword ptr ss:[ebp+8]
006425CE    85C0    test eax,eax
006425D0    74 0C    je short dumped_A.006425DE
006425D2    8038 00  cmp byte ptr ds:[eax],0
006425D5    74 07    je short dumped_A.006425DE
006425D7    C605 40C5>mov byte ptr ds:[66C540],1
006425DE    8B15 34C5>mov edx,dword ptr ds:[66C534]        ; dumped_A.0067E000
006425E4    8915 30C5>mov dword ptr ds:[66C530],edx
006425EA    A3 34C566>mov dword ptr ds:[66C534],eax
006425EF    5D      pop ebp
006425F0    C2 0400  retn 4
006425F3    90      nop
006425F4    53      push ebx
006425F5    8BD8    mov ebx,eax
006425F7    8BC3    mov eax,ebx
006425F9    8B15 34C5>mov edx,dword ptr ds:[66C534]        ; dumped_A.0067E000
006425FF    E8 D02ADC>call dumped_A.004050D4

右键--->跟随66C534,到数据窗口,写入你要注册的信息,复制到可执行文件。
=============================================================================
0067E000  6D 61 63 68 65 6E 67 6C 69 6E 0D 0A 68 74 74 70  machenglin..http
0067E010  2F 2F 77 77 77 2E 75 6E 70 61 63 6B 2E 63 6E 00  //www.unpack.cn.
=============================================================================

OK,脱壳结束。

cnhcerkf 2006-11-25 00:42

[code]
软件名称: Web.Log.Explorer.V3.1.Professional.Edition
下载页面: [url]http://www.exacttrend.com/wleprosetup.exe[/url]
软件大小: 9.24M
软件语言: 英文
软件类别: 国外软件 / 共享版 /
应用平台: Windows2000/XP/2000
加入时间: 2006-06-29
软件介绍: How do you tell the difference between a good log analyzer and a great one? Good log analyzers create "multilevel" and cross-linked reports. But only the best log analyzers give you the full freedom of exploring the data. Web Log Explorer is one of the best. This program creates dynamic reports on-the-fly. It allows you to dig as deep into your data as you need to. Explore your site, proxy or other logs without any limits!
[/code]
[code]
PEid V0.94 : ASProtect 2.1x SKE -> Alexey Solodovnikov
ver0.14 : Version: ASProtect 1.35 build 04.25 Release [Extract]

编译语言: VC6
加壳选项: 无Stolen OEP
SDK 使用: 无UserBuffer, 1处CRC, 1处Envelope
API 使用: GetRegistrationInformation , GetTrialDays
[/code]
脱壳参考文件:[url]http://www.unpack.cn/attachment.php?aid=3622[/url]
前面的二个脱壳过程,没有CRC和Envelope,这里主要对这个问题叙述的详尽一些,希望能看懂。
本人系一菜鸟,方法可能很苯,不过,多跟跟能熟悉软件的流程,增加些记忆。

00401000 w>  68 01B059>push wlexplor.0059B001             ; 程序入口点
00401005    E8 010000>call wlexplor.0040100B
0040100A    C3      retn
0040100B    C3      retn
============================================================================================================
一、运行脚本。

运行VolX大侠脚本Aspr2.XX_IATfixer_v1.02s。
手动找到OEP。
004777D9    55      push ebp                      ; OEP!
004777DA    8BEC    mov ebp,esp
004777DC    6A FF    push -1
004777DE    68 78604C>push wlexplor.004C6078
004777E3    68 60DB47>push wlexplor.0047DB60
004777E8    64:A1 000>mov eax,dword ptr fs:[0]
004777EE    50      push eax
004777EF    64:8925 0>mov dword ptr fs:[0],esp
004777F6    83EC 58  sub esp,58
004777F9    53      push ebx
004777FA    56      push esi
004777FB    57      push edi
004777FC    8965 E8  mov dword ptr ss:[ebp-18],esp
004777FF    FF15 4C82>call dword ptr ds:[4B824C]          ; kernel32.GetVersion

OEP=4777D9-400000=777D9

iatstartaddr: 004B8000
iatsize: 00000840

RVA=004B8000-00400000=B8000
Size=840
LordPE--->完整转存--->dumped.exe

ImportREC--->OEP=255E90,RVA=27E258,Size=A14--->获取输入表。
显示未解决的指针1个,右键--->插件跟踪--->ASPRotect 1.22,修复完成。
修复转储文件,得到dumped_.exe。
============================================================================================================
二、修复CRC、注册。

从入口开始,F8步进,这个CALL异常,F7进去看看.
004778B4    E8 178301>call dumped_.0048FBD0              ; F7进入
004778B9    8945 A0  mov dword ptr ss:[ebp-60],eax
004778BC    50      push eax
004778BD    E8 701F00>call dumped_.00479832
......
0049B38D    FF90 8400>call dword ptr ds:[eax+84]
0049B393    85C0    test eax,eax
0049B395    74 29    je short dumped_.0049B3C0
0049B397    8B06    mov eax,dword ptr ds:[esi]
0049B399    8BCE    mov ecx,esi
0049B39B    FF50 50  call dword ptr ds:[eax+50]          ; F7 进去看看.
......
0041BCB0    E8 9BD000>call dumped_.00428D50
0041BCB5    83C4 1C  add esp,1C
0041BCB8    B9 F09550>mov ecx,dumped_.005095F0
0041BCBD    68 C03A41>push dumped_.00413AC0
0041BCC2    E8 29CF00>call dumped_.00428BF0
0041BCC7    E8 24C500>call dumped_.004281F0
0041BCCC    8B15 0860>mov edx,dword ptr ds:[4D6008]        ; [4D6008]=存放注册信息
0041BCD2    83C9 FF  or ecx,FFFFFFFF

在当前的区段尾找一块空地,写入你要注册的信息,复制到可执行文件。
==============================================================================
004B7DFF  6D 61 63 68 65 6E 67 6C 69 6E 0D 0A 68 74 74 70  machenglin..http
004B7E0F  2F 2F 77 77 77 2E 75 6E 70 61 63 6B 2E 63 6E 00  //www.unpack.cn.
===============================================================================
并将这个地址填写到0061D3DC,右键--->修改数据--->004B7DFF.
ds:[004D6008]=004B7DFF (dumped_.004B7DFF), ASCII "machenglin http//www.unpack.cn"
复制到可执行文件。

0041BD90    A1 D89550>mov eax,dword ptr ds:[5095D8]
0041BD95    893D E085>mov dword ptr ds:[5085E0],edi
0041BD9B    A3 408C50>mov dword ptr ds:[508C40],eax
0041BDA0    A3 488C50>mov dword ptr ds:[508C48],eax
0041BDA5    C605 408C>mov byte ptr ds:[508C40],1
0041BDAC    893D DC85>mov dword ptr ds:[5085DC],edi
0041BDB2    E8 B98AFE>call dumped_.00404870              ; F7 进去看看.
0041BDB7    85C0    test eax,eax
......
004048C3    8D9C03 26>lea ebx,dword ptr ds:[ebx+eax+B651CA26]
004048CA    2BD8    sub ebx,eax
004048CC    8D1C33   lea ebx,dword ptr ds:[ebx+esi]
004048CF    85DB    test ebx,ebx
004048D1    0F85 1900>jnz dumped_.004048F0              ; nop这个跳转
004048D7    035C24 38 add ebx,dword ptr ss:[esp+38]
004048DB    83CB F3  or ebx,FFFFFFF3
......
0041BE3A    8D9402 43>lea edx,dword ptr ds:[edx+eax+F59F0A43]
0041BE41    2BD0    sub edx,eax
0041BE43    8D140A   lea edx,dword ptr ds:[edx+ecx]
0041BE46    85D2    test edx,edx
0041BE48    0F84 2300>je dumped_.0041BE71               ; 修改je--->jmp
0041BE4E    83CD AF  or ebp,FFFFFFAF
0041BE51    BD 968844>mov ebp,dumped_.00448896
0041BE56    0BF7    or esi,edi
0041BE58    BF 523545>mov edi,dumped_.00453552

OK,脱壳结束,运行顺畅。

注:脱壳参考文件是(318),我试练的是(314)。

cnhcerkf 2006-11-25 00:43

首先,感谢fly、shoooo、VolX、syscom兄弟的教程和脱壳参考文件,没有他们的指点和帮助,我也写不出来这4篇初学者脱ASPR的脱壳笔记。
算是“热蒸现卖”,多指点了。
这一篇可把学到的一点“水水”倒干净了,相对前面的稍微难一些。

00440DD7 d>  6A 60    push 60                       ; OEP!
00440DD9    68 80BF4A>push dumped_.004ABF80
00440DDE    E8 CD3100>call dumped_.00443FB0              
============================================================================================================
F9运行,出现错误提示后,在堆栈中找到:

0012F69C  0045088A  返回到 dumped_.0045088A 来自 dumped_.00443F50
右键--->在反汇编窗口中跟随,来到这里,向上看。

00450885    E8 C636FF>call dumped_.00443F50              ; 里面就是jmp 01490000。
0045088A    83C4 0C  add esp,0C                     ; 来到这里。往上看!
0045088D    834D FC F>or dword ptr ss:[ebp-4],FFFFFFFF
00450891    EB 15    jmp short dumped_.004508A8
============================================================================================================
另开一个OD,载入原版,运行脚本。

Ctrl+G: 00450885
F2,下断。F9,运行,中断在00450885,F7进入,来到这里。

00414E40    8B5424 0C mov edx,dword ptr ss:[esp+C]
00414E44    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00414E48    85D2    test edx,edx
00414E4A    74 4F    je short GeoVidSo.00414E9B
00414E4C    33C0    xor eax,eax
00414E4E    8A4424 08 mov al,byte ptr ss:[esp+8]
00414E52    57      push edi
00414E53    8BF9    mov edi,ecx
00414E55    83FA 04  cmp edx,4
00414E58    72 31    jb short GeoVidSo.00414E8B
选择00414E40、00414E44,二进制复制。

再开一个OD,载入参考程序,Ctrl+B,二进制粘贴。

00414E40    8B5424 0C mov edx,dword ptr ss:[esp+C]         ; 找到这里。开始二进制复制。
00414E44    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00414E48    85D2    test edx,edx
00414E4A    74 4F    je short GeoVidSo.00414E9B
00414E4C    33C0    xor eax,eax
00414E4E    8A4424 08 mov al,byte ptr ss:[esp+8]
00414E52    57      push edi
00414E53    8BF9    mov edi,ecx
00414E55    83FA 04  cmp edx,4
00414E58    72 31    jb short GeoVidSo.00414E8B
00414E5A    F7D9    neg ecx
00414E5C    83E1 03  and ecx,3
00414E5F    74 0C    je short GeoVidSo.00414E6D
00414E61    2BD1    sub edx,ecx
00414E63    8807    mov byte ptr ds:[edi],al
00414E65    83C7 01  add edi,1
00414E68    83E9 01  sub ecx,1
00414E6B  ^ 75 F6    jnz short GeoVidSo.00414E63
00414E6D    8BC8    mov ecx,eax
00414E6F    C1E0 08  shl eax,8
00414E72    03C1    add eax,ecx
00414E74    8BC8    mov ecx,eax
00414E76    C1E0 10  shl eax,10
00414E79    03C1    add eax,ecx
00414E7B    8BCA    mov ecx,edx
00414E7D    83E2 03  and edx,3
00414E80    C1E9 02  shr ecx,2
00414E83    74 06    je short GeoVidSo.00414E8B
00414E85    F3:AB    rep stos dword ptr es:[edi]
00414E87    85D2    test edx,edx
00414E89    74 0A    je short GeoVidSo.00414E95
00414E8B    8807    mov byte ptr ds:[edi],al
00414E8D    83C7 01  add edi,1
00414E90    83EA 01  sub edx,1
00414E93  ^ 75 F6    jnz short GeoVidSo.00414E8B
00414E95    8B4424 08 mov eax,dword ptr ss:[esp+8]
00414E99    5F      pop edi
00414E9A    C3      retn
00414E9B    8B4424 04 mov eax,dword ptr ss:[esp+4]
00414E9F    C3      retn                         ; 到这里结束。

在运行dumoed.exe的OD中,Ctrl+G: 00450885,F7进入,开始二进制粘贴。

00443F50  - E9 ABC004>jmp 01490000                    ; 这里开始二进制粘贴。
00443F55    38B8 C488>cmp byte ptr ds:[eax+232488C4],bh
00443F5B    4F      dec edi
00443F5C    9F      lahf
00443F5D    DAA5 C777>fisub dword ptr ss:[ebp+4EFC77C7]
00443F63    B0 84    mov al,84
00443F65    1F      pop ds
00443F66    23A0 F83C>and esp,dword ptr ds:[eax+5CE43CF8]
00443F6C    37      aaa
00443F6D    B5 75    mov ch,75
00443F6F    DCDE    fcomp esi                      ; 非法使用寄存器
00443F71    2F      das
00443F72    8E3A    mov seg?,word ptr ds:[edx]          ; 不明确的段位寄存器
00443F74    4E      dec esi
00443F75    E7 F3    out 0F3,eax
00443F77    B6 DD    mov dh,0DD
00443F79    6956 6E 2>imul edx,dword ptr ds:[esi+6E],5A7DB024
00443F80    0820    or byte ptr ds:[eax],ah
00443F82    87AE 7CE2>xchg dword ptr ds:[esi+C73EE27C],ebp
00443F88    17      pop ss
00443F89    9A DA28F3>call far 3CC2:65F328DA
00443F90    85B4F5 ED>test dword ptr ss:[ebp+esi*8+617245ED],e>
00443F97    2C 76    sub al,76
00443F99    6A 36    push 36
00443F9B    0054F7 EF add byte ptr ds:[edi+esi*8-11],dl
00443F9F    D070 78  sal byte ptr ds:[eax+78],1
00443FA2    CD DF    int 0DF
00443FA4    15 F7C341>adc eax,E841C3F7
00443FA9    0F36    ???                          ; 未知命令
00443FAB    8B4424 04 mov eax,dword ptr ss:[esp+4]
00443FAF    C3      retn                         ; 到这里结束。

修补后的代码:
00443F50    8B5424 0C mov edx,dword ptr ss:[esp+C]         ; 这里开始二进制粘贴.
00443F54    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00443F58    85D2    test edx,edx
00443F5A    74 4F    je short dumped_.00443FAB
00443F5C    33C0    xor eax,eax
00443F5E    8A4424 08 mov al,byte ptr ss:[esp+8]
00443F62    57      push edi
00443F63    8BF9    mov edi,ecx
00443F65    83FA 04  cmp edx,4
00443F68    72 31    jb short dumped_.00443F9B
00443F6A    F7D9    neg ecx
00443F6C    83E1 03  and ecx,3
00443F6F    74 0C    je short dumped_.00443F7D
00443F71    2BD1    sub edx,ecx
00443F73    8807    mov byte ptr ds:[edi],al
00443F75    83C7 01  add edi,1
00443F78    83E9 01  sub ecx,1
00443F7B  ^ 75 F6    jnz short dumped_.00443F73
00443F7D    8BC8    mov ecx,eax
00443F7F    C1E0 08  shl eax,8
00443F82    03C1    add eax,ecx
00443F84    8BC8    mov ecx,eax
00443F86    C1E0 10  shl eax,10
00443F89    03C1    add eax,ecx
00443F8B    8BCA    mov ecx,edx
00443F8D    83E2 03  and edx,3
00443F90    C1E9 02  shr ecx,2
00443F93    74 06    je short dumped_.00443F9B
00443F95    F3:AB    rep stos dword ptr es:[edi]
00443F97    85D2    test edx,edx
00443F99    74 0A    je short dumped_.00443FA5
00443F9B    8807    mov byte ptr ds:[edi],al
00443F9D    83C7 01  add edi,1
00443FA0    83EA 01  sub edx,1
00443FA3  ^ 75 F6    jnz short dumped_.00443F9B
00443FA5    8B4424 08 mov eax,dword ptr ss:[esp+8]
00443FA9    5F      pop edi
00443FAA    C3      retn
00443FAB    8B4424 04 mov eax,dword ptr ss:[esp+4]
00443FAF    C3      retn                         ; 这里结束.

保存到文件。
重新载入,F9运行,又出现跳到壳了去了,在01480000。
在堆栈中找到:
0012EA5C  004517D5  返回到 dumped_A.004517D5 来自 dumped_A.00443C00
右键--->在反汇编窗口中跟随,来到这里,向上看。

004517CD   /74 36    je short dumped_A.00451805
004517CF   |53      push ebx
004517D0   |E8 2B24FF>call dumped_A.00443C00             ; 找到这里,F7进入。
004517D5   |59      pop ecx
004517D6   |8BF8    mov edi,eax
......
00443C00  - E9 FBC303>jmp 01480000
00443C05    9A 69D18F>call far F3AF:698FD169
00443C0C    F5      cmc
00443C0D    98      cwde
00443C0E    24 0B    and al,0B

老一套了,在原版OD中跟随00443C00,来到:
01480000    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
01480004    F7C1 0300>test ecx,3
0148000A    0F84 3802>je 01480248
01480010    8A01    mov al,byte ptr ds:[ecx]
01480012    8D49 1D  lea ecx,dword ptr ds:[ecx+1D]
01480015    56      push esi
01480016    50      push eax
01480017    52      push edx
01480018    36:EB 01  jmp short 0148001C

选择01480000、01480004,二进制复制。

在载入参考程序的OD中,Ctrl+B,二进制粘贴。

找到这里:
00414B10    8B4C24 04 mov ecx,dword ptr ss:[esp+4]         ; 从这里开始二进制复制。
00414B14    F7C1 0300>test ecx,3
00414B1A    74 24    je short GeoVidSo.00414B40
00414B1C    8A01    mov al,byte ptr ds:[ecx]
00414B1E    83C1 01  add ecx,1
00414B21    84C0    test al,al
00414B23    74 4E    je short GeoVidSo.00414B73
00414B25    F7C1 0300>test ecx,3
00414B2B  ^ 75 EF    jnz short GeoVidSo.00414B1C
00414B2D    05 000000>add eax,0
00414B32    8DA424 00>lea esp,dword ptr ss:[esp]
00414B39    8DA424 00>lea esp,dword ptr ss:[esp]
00414B40    8B01    mov eax,dword ptr ds:[ecx]
00414B42    BA FFFEFE>mov edx,7EFEFEFF
00414B47    03D0    add edx,eax
00414B49    83F0 FF  xor eax,FFFFFFFF
00414B4C    33C2    xor eax,edx
00414B4E    83C1 04  add ecx,4
00414B51    A9 000101>test eax,81010100
00414B56  ^ 74 E8    je short GeoVidSo.00414B40
00414B58    8B41 FC  mov eax,dword ptr ds:[ecx-4]
00414B5B    84C0    test al,al
00414B5D    74 32    je short GeoVidSo.00414B91
00414B5F    84E4    test ah,ah
00414B61    74 24    je short GeoVidSo.00414B87
00414B63    A9 0000FF>test eax,0FF0000
00414B68    74 13    je short GeoVidSo.00414B7D
00414B6A    A9 000000>test eax,FF000000
00414B6F    74 02    je short GeoVidSo.00414B73
00414B71  ^ EB CD    jmp short GeoVidSo.00414B40
00414B73    8D41 FF  lea eax,dword ptr ds:[ecx-1]
00414B76    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00414B7A    2BC1    sub eax,ecx
00414B7C    C3      retn
00414B7D    8D41 FE  lea eax,dword ptr ds:[ecx-2]
00414B80    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00414B84    2BC1    sub eax,ecx
00414B86    C3      retn
00414B87    8D41 FD  lea eax,dword ptr ds:[ecx-3]
00414B8A    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00414B8E    2BC1    sub eax,ecx
00414B90    C3      retn
00414B91    8D41 FC  lea eax,dword ptr ds:[ecx-4]
00414B94    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00414B98    2BC1    sub eax,ecx
00414B9A    C3      retn                         ; 到这里结束。

修补后的代码:
00443C00    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00443C04    F7C1 0300>test ecx,3
00443C0A    74 24    je short dumped_A.00443C30
00443C0C    8A01    mov al,byte ptr ds:[ecx]
00443C0E    83C1 01  add ecx,1
00443C11    84C0    test al,al
00443C13    74 4E    je short dumped_A.00443C63
00443C15    F7C1 0300>test ecx,3
00443C1B  ^ 75 EF    jnz short dumped_A.00443C0C
00443C1D    05 000000>add eax,0
00443C22    8DA424 00>lea esp,dword ptr ss:[esp]
00443C29    8DA424 00>lea esp,dword ptr ss:[esp]
00443C30    8B01    mov eax,dword ptr ds:[ecx]
00443C32    BA FFFEFE>mov edx,7EFEFEFF
00443C37    03D0    add edx,eax
00443C39    83F0 FF  xor eax,FFFFFFFF
00443C3C    33C2    xor eax,edx
00443C3E    83C1 04  add ecx,4
00443C41    A9 000101>test eax,81010100
00443C46  ^ 74 E8    je short dumped_A.00443C30
00443C48    8B41 FC  mov eax,dword ptr ds:[ecx-4]
00443C4B    84C0    test al,al
00443C4D    74 32    je short dumped_A.00443C81
00443C4F    84E4    test ah,ah
00443C51    74 24    je short dumped_A.00443C77
00443C53    A9 0000FF>test eax,0FF0000
00443C58    74 13    je short dumped_A.00443C6D
00443C5A    A9 000000>test eax,FF000000
00443C5F    74 02    je short dumped_A.00443C63
00443C61  ^ EB CD    jmp short dumped_A.00443C30
00443C63    8D41 FF  lea eax,dword ptr ds:[ecx-1]
00443C66    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00443C6A    2BC1    sub eax,ecx
00443C6C    C3      retn
00443C6D    8D41 FE  lea eax,dword ptr ds:[ecx-2]
00443C70    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00443C74    2BC1    sub eax,ecx
00443C76    C3      retn
00443C77    8D41 FD  lea eax,dword ptr ds:[ecx-3]
00443C7A    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00443C7E    2BC1    sub eax,ecx
00443C80    C3      retn
00443C81    8D41 FC  lea eax,dword ptr ds:[ecx-4]
00443C84    8B4C24 04 mov ecx,dword ptr ss:[esp+4]
00443C88    2BC1    sub eax,ecx
00443C8A    C3      retn
00443C8B    55      push ebp
00443C8C    8BEC    mov ebp,esp
00443C8E    83EC 20  sub esp,20
00443C91    8B45 08  mov eax,dword ptr ss:[ebp+8]
00443C94    8945 E8  mov dword ptr ss:[ebp-18],eax
00443C97    8945 E0  mov dword ptr ss:[ebp-20],eax
00443C9A    8B45 0C  mov eax,dword ptr ss:[ebp+C]
00443C9D    03C0    add eax,eax
00443C9F    8945 E4  mov dword ptr ss:[ebp-1C],eax
00443CA2    56      push esi
00443CA3    8D45 14  lea eax,dword ptr ss:[ebp+14]
00443CA6    50      push eax
00443CA7    FF75 10  push dword ptr ss:[ebp+10]
00443CAA    8D45 E0  lea eax,dword ptr ss:[ebp-20]
00443CAD    50      push eax
00443CAE    C745 EC 4>mov dword ptr ss:[ebp-14],42
00443CB5    E8 573300>call dumped_A.00447011
00443CBA    83C4 0C  add esp,0C
00443CBD    FF4D E4  dec dword ptr ss:[ebp-1C]
00443CC0    8BF0    mov esi,eax
00443CC2    78 0B    js short dumped_A.00443CCF
00443CC4    8B45 E0  mov eax,dword ptr ss:[ebp-20]
00443CC7    C600 00  mov byte ptr ds:[eax],0
00443CCA    FF45 E0  inc dword ptr ss:[ebp-20]
00443CCD    EB 0D    jmp short dumped_A.00443CDC
00443CCF    8D45 E0  lea eax,dword ptr ss:[ebp-20]
00443CD2    50      push eax
00443CD3    6A 00    push 0
00443CD5    E8 8E3100>call dumped_A.00446E68
00443CDA    59      pop ecx
00443CDB    59      pop ecx
00443CDC    FF4D E4  dec dword ptr ss:[ebp-1C]
00443CDF    78 08    js short dumped_A.00443CE9
00443CE1    8B45 E0  mov eax,dword ptr ss:[ebp-20]
00443CE4    C600 00  mov byte ptr ds:[eax],0
00443CE7    EB 0D    jmp short dumped_A.00443CF6
00443CE9    8D45 E0  lea eax,dword ptr ss:[ebp-20]
00443CEC    50      push eax
00443CED    6A 00    push 0
00443CEF    E8 743100>call dumped_A.00446E68
00443CF4    59      pop ecx
00443CF5    59      pop ecx
00443CF6    8BC6    mov eax,esi
00443CF8    5E      pop esi
00443CF9    C9      leave
00443CFA    C3      retn
00443CFB    55      push ebp
00443CFC    8BEC    mov ebp,esp
00443CFE    83EC 20  sub esp,20
00443D01    8B45 08  mov eax,dword ptr ss:[ebp+8]
00443D04    50      push eax
00443D05    C745 EC 4>mov dword ptr ss:[ebp-14],49
00443D0C    8945 E8  mov dword ptr ss:[ebp-18],eax
00443D0F    8945 E0  mov dword ptr ss:[ebp-20],eax
00443D12    E8 94D2FF>call dumped_A.00440FAB
00443D17    D1E0    shl eax,1
00443D19    8945 E4  mov dword ptr ss:[ebp-1C],eax
00443D1C    8D45 10  lea eax,dword ptr ss:[ebp+10]
00443D1F    50      push eax

保存到可执行文件。
============================================================================================================
修复自校验。

重新载入OD,F9运行,这里出现错误了。
0047F509    FF76 50  push dword ptr ds:[esi+50]

堆栈窗口,找到:
0012FE8C  0046845C  返回到 dumped_A.0046845C
右键--->在反汇编窗口跟随。
00468459    FF50 50  call dword ptr ds:[eax+50]          ; F7 进入看看
0046845C    85C0    test eax,eax                    ; 来到这里,向上看。
0046845E    75 16    jnz short dumped_A.00468476

原来藏在这里,修改。
......
00419BB7    8D9C03 FE>lea ebx,dword ptr ds:[ebx+eax+ACE88DFE]
00419BBE    2BD8    sub ebx,eax
00419BC0    03DE    add ebx,esi
00419BC2    85DB    test ebx,ebx
00419BC4    0F84 2B00>je dumped_A.00419BF5              ; 修改je--->jmp
00419BCA    336C24 08 xor ebp,dword ptr ss:[esp+8]

保存到可执行文件。
============================================================================================================
注册

重新载入OD,F9运行,这里又出现错误了。

堆栈窗口,找到:
0012F3AC  00413FB7  返回到 dumped_A.00413FB7 来自 dumped_A.0045819A

右键--->在反汇编窗口跟随。

00413FA8    C705 4486>mov dword ptr ds:[4C8644],1
00413FB2    E8 E34104>call dumped_A.0045819A             ; F7 进入看看。
00413FB7    85C0    test eax,eax                    ; 来到这里。
00413FB9    74 18    je short dumped_A.00413FD3
......
0045818E  - FF25 74C6>jmp dword ptr ds:[<&softbitmaplib.SoftBi>; SoftBitm.SoftBitmapLib_FlipHorizontal
00458194    FF25 44C0>jmp dword ptr ds:[48C044]           ; dumped_u.0048B6AD
0045819A    FF25 40C0>jmp dword ptr ds:[48C040]           ; dumped_u.0048B650
004581A0    FF25 3CC0>jmp dword ptr ds:[48C03C]           ; dumped_u.0048B688
004581A6    FF25 48C0>jmp dword ptr ds:[48C048]           ; dumped_u.0048B66C
004581AC  - FF25 7CC0>jmp dword ptr ds:[<&aviinfo.AVIInfo_Clos>; aviinfo.AVIInfo_Close
004581B2  - FF25 78C0>jmp dword ptr ds:[<&aviinfo.AVIFrameInfo>; aviinfo.AVIFrameInfo_Close

呵呵,这几个就是注册的东东了。

F2,在00458194~004581A6下断,重新启动,看哪个先报道就处理哪个。

45819A先中断了。
堆栈中:
==========================================================================
0012F3AC  00413FB7  返回到 dumped_A.00413FB7 来自 dumped_A.0045819A
0012F3B0  00000000
0012F3B4  0012F3BC  //0012F3B4-0012F3AC=8
0012F3B8  0012F3C0  //0012F3B8-0012F3AC=C
===========================================================================
在该区段尾找一块空地,键入如下PATCH。
0048B650    8B4424 08 mov eax,dword ptr ss:[esp+8]
0048B654    C700 00B7>mov dword ptr ds:[eax],dumped_u.0048B700 ; ASCII "Business License"
0048B65A    8B4424 0C mov eax,dword ptr ss:[esp+C]
0048B65E    C700 0301>mov dword ptr ds:[eax],103
0048B664    B8 010000>mov eax,1
0048B650   C2 0C00  retn 0C
我找的是0048B650,至于为什么要103,我不知道。后来SYSCOM大侠指点说大于3既可。

选择保存0048B650~0048B650部分。

再在该区段尾找一块空地,键入如下PATCH。
==============================================================================
0048B700  42 75 73 69 6E 65 73 73 20 4C 69 63 65 6E 73 65  Business License
0048B710  00 00 00 00 00 00 6D 61 63 68 65 6E 67 6C 69 6E  ......machenglin
==============================================================================
保存到可执行文件。

重新载入OD,Ctrl+G: 0045819A
ds:[0048C040]=00CD7FD8--->修改成ds:[0048C040]=0048B650,在数据窗口保存到可执行文件。

F9,运行,进入软件界面。

到菜单help-->About,中断在004181A6。

堆栈中:
============================================================================
0012F3AC  00413FB7  返回到 dumped_u.00413FB7 来自 dumped_u.0045819A
0012F3B0  00000000
0012F3B4  0012F3BC  //0012F3B4-0012F3AC=8
0012F3B8  0012F3C0  //0012F3B8-0012F3AC=C
=============================================================================

在该区段尾找一块空地,键入如下PATCH。

0048B66C    8B4424 08 mov eax,dword ptr ss:[esp+8]
0048B670    C700 00B7>mov dword ptr ds:[eax],dumped_u.0048B700 ; ASCII "Business License"
0048B676    8B4424 0C mov eax,dword ptr ss:[esp+C]
0048B67A    C700 16B7>mov dword ptr ds:[eax],dumped_u.0048B716 ; ASCII "machenglin"
0048B680    B8 010000>mov eax,1
0048B685    C2 0C00  retn 0C

我找的是0048B66C。

选择保存0048B66C~0048B685部分。

重新载入OD,Ctrl+G: 0045819A
修改成ds:[0048C040]=0048B66C,在数据窗口保存到可执行文件。

重新载入OD,F9运行,这里又出现错误了。

跟踪到这里。
0041A06E    8DBC07 44>lea edi,dword ptr ds:[edi+eax+DA8FD044]
0041A075    2BF8    sub edi,eax
0041A077    03FA    add edi,edx
0041A079    85FF    test edi,edi
0041A07B    0F84 2000>je dumped_A.0041A0A1              ; 修改je--->jmp
0041A081    C1DD 99  rcr ebp,99
0041A084    83DD 95  sbb ebp,-6B
0041A087    23F1    and esi,ecx
0041A089    83DF A3  sbb edi,-5D
0041A08C    037C24 38 add edi,dword ptr ss:[esp+38]
0041A090    68 369749>push dumped_A.00499736             ; UNICODE "reate system enumerator"

OK,脱壳结束。

菜鸟脱壳,能脱下是目的。
量功力而行,从基础学习,尽量参照大侠的脱壳文件,多问为什么要这样做,确实是学习的好方法。
希望初学者不要依靠动画来“速成”,教程只能作为引路的作用,参悟大侠的脱壳文件才能进步。

Download
[url]http://www.geovid.com/download/vidlogo.exe[/url]
Peid:
ASProtect 2.1x SKE -> Alexey Solodovnikov

cnhcerkf 2006-11-25 00:43

加壳:ASProtect V2.X Registered -> Alexey Solodovnikov *
下载:[url]http://www.geovid.com/download/vidlogo.exe[/url]
这个软件还有些特别,在程序入口点前有5次字符中断,F9,5次到了程序入口点。
00401000 V>  68 01F042>push VidLogo.0042F001                  ; 程序入口点。
00401005    E8 010000>call VidLogo.0040100B
0040100A    C3      retn
0040100B    C3      retn
============================================================================================================
一、运行脚本,dump

运行VolX大侠的脚本,停在这里了,OEP=00040A1D2
0594051E    6A 74    push 74                            ; 00040A1D2
05940520    68 4E6754>push 6F54674E
05940525    66:9C    pushfw
05940527    51      push ecx
05940528    0BCD    or ecx,ebp
0594052A    F2:     prefix repne:
0594052B    EB 01    jmp short 0594052E

Alt+L,到记录窗口,查RVA、Size。

信息=iatstartaddr: RVA=0040C000-00400000=C000
信息=iatsize: Size=000008E8

LordPE-->完整转存-->dumped.exe。

ImportREC-->OEP=A1D2 RVA=C000 Size=8E8。
选项-->取消来自磁盘的PE头勾选-->新建输入表全部不勾选。
获取输入表,有3个无效指针,注意记录这有3个无效指针的地址后,剪切掉。
修复转存文件,保存为dumped_.exe。

为何要取消来自磁盘的PE头勾选?如果勾选自磁盘的PE头则很多的函数不能正确还原。
============================================================================================================
二、区域转存。

这个文件的壳区段和以前我们熟悉的是跟在运行软件后不同,它的壳区段集中在若干系统程序后面。

运行原版程序,停在程序入口点,Alt+M,到内存窗口看看,在Commondi后,先请记下它的最高Priv区段在04740000。

运行运行VolX大侠的脚本,停在伪OEP。

呵呵,增加的壳区段数了近800个还多,别怕,先请记下它的最高Priv区段为59B0000。

Alt+M,到内存窗口看看,范围缩小到04750000~59B0000,不管前面的区段了,全部F2下断。

参考OEP开始就跳到0594051E,这可是重要的一个。

F9运行,直到出现软件界面,返回到内存窗口看看,用到12个区段,分析,区域dump下以下6个区段或12个区段。

47B0000,4810000,487C0000,5940000,59A0000,59B0000。

将这6个区域dump区段附加在文件后面。

注意,要先减去基址400000,最好用区段地址命名区段名,便于记忆。

附加完毕,重建PE。

============================================================================================================
三、壳自检Route CHECK

syscom大侠说:
-----------------------------------------------------------------------------------------------------------
当你脱壳之后,B=会发生错误 ERROR 111,所以我们只要,抓出正确的 CALL Route Address,就可以通过CHECK SUM ,也就是

在 [ESP+58]的 STACK 位址。
所以我们使用 MOV  EAX,[ESP+58] ,来还原B值+5 后修正B值 Address。

Route CHECK,算是壳的自我检查,它是由 A,B 两数值,作互减运算:

A=GetCurrentThreadID
B=CALL Route Address

运算后 ...
B=B-A
------------------------------------------------------------------------------------------------------------
引用syscom大侠的原语是给朋友们对Route CHECK有一个明确的概念。在这里我也详尽一些,希望大家能看懂。

在新补的区段全部F2下断,F9,停在这里时开始修改。

047D4CB4    55      push ebp                           ; 断在这里准备壳自我检查
047D4CB5    8BEC    mov ebp,esp
047D4CB7    83C4 F8  add esp,-8
047D4CBA    53      push ebx
047D4CBB    56      push esi
047D4CBC    57      push edi
047D4CBD    8B5D 08  mov ebx,dword ptr ss:[ebp+8]
047D4CC0    EB 01    jmp short 复件_AAA.047D4CC3                ; 无条件跳到47D4CC3
......
047D4CC3    8B45 18  mov eax,dword ptr ss:[ebp+18]
047D4CC6    83E8 08  sub eax,8
047D4CC9    8B00    mov eax,dword ptr ds:[eax]
047D4CCB    50      push eax
047D4CCC    8A8B 9600>mov cl,byte ptr ds:[ebx+96]
047D4CD2    8B55 14  mov edx,dword ptr ss:[ebp+14]
047D4CD5    8BC3    mov eax,ebx
047D4CD7    E8 B4FFFF>call 复件_AAA.047D4C90
047D4CDC    8B45 18  mov eax,dword ptr ss:[ebp+18]
047D4CDF    50      push eax
047D4CE0    B1 04    mov cl,4
047D4CE2    8B55 14  mov edx,dword ptr ss:[ebp+14]
047D4CE5    8BC3    mov eax,ebx
047D4CE7    E8 A4FFFF>call 复件_AAA.047D4C90
047D4CEC    EB 01    jmp short 复件_AAA.047D4CEF                ; 无条件跳到047D4CEF
......
047D4CEF    8B73 30  mov esi,dword ptr ds:[ebx+30]
047D4CF2    8B7B 14  mov edi,dword ptr ds:[ebx+14]
047D4CF5    A1 D02B7F>mov eax,dword ptr ds:[47F2BD0]
047D4CFA    8B40 34  mov eax,dword ptr ds:[eax+34]             ; nop
047D4CFD    FFD0    call eax                           ; nop
047D4CFF    2945 0C  sub dword ptr ss:[ebp+C],eax              ; mov eax,dword ptr ss:[esp+58]
047D4D02    8B45 0C  mov eax,dword ptr ss:[ebp+C]              ; sub eax,5
047D4D05    2B43 18  sub eax,dword ptr ds:[ebx+18]
047D4D08    2B43 68  sub eax,dword ptr ds:[ebx+68]
047D4D0B    8945 FC  mov dword ptr ss:[ebp-4],eax
047D4D0E    8D43 24  lea eax,dword ptr ds:[ebx+24]
047D4D11    8945 F8  mov dword ptr ss:[ebp-8],eax
047D4D14    85FF    test edi,edi

二进制:90 90 8B 44 24 58 83 E8 05 90 90

修改后代码:
047D4CEF    8B73 30  mov esi,dword ptr ds:[ebx+30]             ; 复件_AAA.05941DFC
047D4CF2    8B7B 14  mov edi,dword ptr ds:[ebx+14]
047D4CF5    A1 D02B7F>mov eax,dword ptr ds:[47F2BD0]
047D4CFA    90      nop
047D4CFB    90      nop
047D4CFC    8B4424 58 mov eax,dword ptr ss:[esp+58]
047D4D00    83E8 05  sub eax,5
047D4D03    90      nop
047D4D04    90      nop
047D4D05    2B43 18  sub eax,dword ptr ds:[ebx+18]
047D4D08    2B43 68  sub eax,dword ptr ds:[ebx+68]
047D4D0B    8945 FC  mov dword ptr ss:[ebp-4],eax
047D4D0E    8D43 24  lea eax,dword ptr ds:[ebx+24]
047D4D11    8945 F8  mov dword ptr ss:[ebp-8],eax
047D4D14    85FF    test edi,edi
============================================================================================================
四、CRC自校验。

重新载入修复的dumped_.exe,F9运行,在这里出现错误“被调试的程序无法处理异常”。

047B2010    8320 FE  and dword ptr ds:[eax],FFFFFFFE
047B2013    8B42 04  mov eax,dword ptr ds:[edx+4]
047B2016    3BD0    cmp edx,eax
047B2018    75 1A    jnz short 复件_AAA.047B2034

ds:[001C001B]=???

通过代码分析,堆栈中找到:
0012F348  |047D1A41  返回到 复件_AAA.047D1A41 来自 复件_AAA.047B7788

Ctrl+G: 047D1A41。

跟踪来到这里,看到上面有一个大跳转,047D1A28下F2断点,重新载入。

断在这里,修改修改je-->jmp。
047D1A28    E8 63FFFF>call 复件_AAA.047D1990                   ; 在这里F2下断。
047D1A2D    8BF8    mov edi,eax
047D1A2F    85FF    test edi,edi
047D1A31    74 70    je short 复件_AAA.047D1AA3                ; 修改je-->jmp
047D1A33    8D55 F4  lea edx,dword ptr ss:[ebp-C]
047D1A36    8D87 CB02>lea eax,dword ptr ds:[edi+2CB]
047D1A3C    E8 475DFE>call 复件_AAA.047B7788
047D1A41    8B45 F4  mov eax,dword ptr ss:[ebp-C]              ; 跟踪到这里,往上看。

可以运行到软件出现界面,看菜单-->help-->About-->“未注册版本”!
============================================================================================================
五、注册

在dump时记录的3个无效指针的地址,在这里就用上了。

数据窗口在0040C000,0040C004,0040C008下内存断点,F9运行。

0040A9B0  - FF25 F4C7>jmp dword ptr ds:[<&medialog.MediaLog_Create>]  ; medialog.MediaLog_Create
0040A9B6  - FF25 00C0>jmp dword ptr ds:[40C000]                ; 复件_AAA.047DBDE0
0040A9BC  - FF25 04C0>jmp dword ptr ds:[40C004]                ; 复件_AAA.047DBAB8
0040A9C2  - FF25 08C0>jmp dword ptr ds:[40C008]                ; 复件_AAA.047DB97C

中断在0040A9B6,这里就是有关注册的3个指针了。

在这3个地址F2下断。

这个软件有些吝啬,注册的PATCH不让在区段尾写,请教几位大侠,灵活了一下,这里感谢。

在区段中钻空子,找到0040EDD4,写入以下代码:

0040EDD4    8B4424 08 mov eax,dword ptr ss:[esp+8]
0040EDD8    C700 F4ED>mov dword ptr ds:[eax],dumped_u.0040EDF4      ; ASCII "Business License"
0040EDDE    8B4424 0C mov eax,dword ptr ss:[esp+C]
0040EDE2    C700 0301>mov dword ptr ds:[eax],103
0040EDE8    B8 010000>mov eax,1
0040EDED    C2 0C00  retn 0C

在0040EDF4写入Business License。
在0040F975写入[url]www.unpack.cn[/url]

修改:ds:[0040C000]=0040EDD4 (复件_AAA.0040EDD4)

保存可执行文件,重新载入。

菜单-->help-->About-->0040A9C2-->F9-->中断在0040A9C2。

再在区段中钻空子,找到0040F959,写入以下代码:
0040F959    8B4424 08 mov eax,dword ptr ss:[esp+8]
0040F95D    C700 F4ED>mov dword ptr ds:[eax],dumped_u.0040EDF4      ; ASCII "Business License"
0040F963    8B4424 0C mov eax,dword ptr ss:[esp+C]
0040F967    C700 75F9>mov dword ptr ds:[eax],dumped_u.0040F975      ; ASCII "[url]www.unpack.cn[/url]"
0040F96D    B8 010000>mov eax,1
0040F972    C2 0C00  retn 0C

修改:ds:[0040C008]=0040F959 (复件_AAA.0040F959)

菜单-->help-->About-->注册了。

还有1个0040A9BC没有用到,如果你有时间的话就全面测试各项功能,它就会向你招手了。
============================================================================================================
在调试的过程中发现Video to Flash Converter PRO v5.5和它很相似,不知道是谁抄谁了?!有兴趣的朋友也可以参照脱壳


本来是想捡个软柿子玩,发现这个软件有近800个壳区段,用补区段的方法很适合,就玩了玩。

页: [1]
© 1999-2008 EvilOctal Security Team