吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 23754|回复: 57
收起左侧

[原创] 巧脱Themida/WinLicense Delphi +OEP修复

[复制链接]
estelle 发表于 2008-3-18 19:22
【文章标题】: 巧脱ThemIDA/WinLicense Delphi +OEP修复
【文章作者】: 夜凉如水
【作者邮箱】: Estelle@yeah.net
【作者QQ号】: 272227777
【软件名称】: 某游戏修改器
【下载地址】: 自己搜索下载
【加壳方式】: 代码变形 iat加密 oep偷取
【保护方式】: Themida/WinLicense
【编写语言】: Delphi6.0
【使用工具】: 脱壳机 +OllyDbg修改版
【操作平台】: 电脑疯子
【软件介绍】: 某游戏修改器
【作者声明】: 只是感兴趣,没有其他目的。失误之处敬请诸位大侠赐教!
--------------------------------------------------------------------------------
【详细过程】
最新玩Themida/WinLicense的人越来越多 ,呵呵我也来热闹下
首先PEID查壳为Themida/WinLicense 第一个想到的就是脱壳机 脱壳以后运行无果,发现程序无法运行 引出下面的脱壳过程
该工具检测几乎所有的crack工具和工具目录名称进程 所以只能使用修改版了
运行fxyang的ThemidaScript.for.V1.9.10+.0.4.oSc 运行lordpe dump程序 嘿嘿前人的经验到底不懂

00406380  53            push ebx  //伪oep eax=004e7974  call 00406380 ★
00406381  8BD8           mov ebx,eax                ; un.004E7974
00406383  33C0           xor eax,eax                ; un.004E7974
00406385  A3 A0804E00       mov dword ptr ds:[4E80A0],eax       ; un.004E7974
0040638A  6A 00          push 0
0040638C  E8 2BFFFFFF       call 004062BC               ; <jmp.&kernel32.GetModuleHandleA>
00406391  A3 68D64E00       mov dword ptr ds:[4ED668],eax       ; un.004E7974
00406396  A1 68D64E00       mov eax,dword ptr ds:[4ED668]
0040639B  A3 AC804E00       mov dword ptr ds:[4E80AC],eax       ; un.004E7974
004063A0  33C0           xor eax,eax                ; un.004E7974
004063A2  A3 B0804E00       mov dword ptr ds:[4E80B0],eax       ; un.004E7974
004063A7  33C0           xor eax,eax                ; un.004E7974
004063A9  A3 B4804E00       mov dword ptr ds:[4E80B4],eax       ; un.004E7974
004063AE  E8 C1FFFFFF       call 00406374               ; un.00406374
004063B3  BA A8804E00       mov edx,4E80A8
004063B8  8BC3           mov eax,ebx
004063BA  E8 E5DBFFFF       call 00403FA4               ; un.00403FA4
004063BF  5B            pop ebx                  ; un.004E7CF4
004063C0  C3            retn  //f8运行到此 F4程序就运行 所以只能F8 返回VM

code断下F2断点Shift+F9 2次

0046B540   53        push ebx  //  call 46b540 ★
0046B541   A1 60C34E00    mov eax,dword ptr ds:[4EC360]
0046B546   8338 00      cmp dword ptr ds:[eax],0
0046B549   74 0A       je short 0046B555                 ; 1.0046B555
0046B54B   8B1D 60C34E00   mov ebx,dword ptr ds:[4EC360]           ; 1.004ED044
0046B551   8B1B       mov ebx,dword ptr ds:[ebx]
0046B553   FFD3       call ebx
0046B555   5B        pop ebx                      ; 1.007EDF09
0046B556   C3        retn //f8运行到此返回vm

code断下F2断点Shift+F9第一次

00E00818   FF30       push dword ptr ds:[eax]              ; 1.004EDDF0
00E0081A   8B0424      mov eax,dword ptr ss:[esp]            ; 1.004EC320
00E0081D   53        push ebx
00E0081E   89E3       mov ebx,esp
00E00820   81C3 04000000   add ebx,4
00E00826   51        push ecx
00E00827   B9 04000000    mov ecx,4
00E0082C   01CB       add ebx,ecx
00E0082E   59        pop ecx                      ; 1.004EC320
00E0082F   871C24      xchg dword ptr ss:[esp],ebx
00E00832   5C        pop esp                      ; 1.004EC320

// eax=004ec320 ★


第二次

00E00818   FF30       push dword ptr ds:[eax]              ; 1.004EDBE8
00E0081A   8B0424      mov eax,dword ptr ss:[esp]            ; 1.004EC454
00E0081D   53        push ebx
00E0081E   89E3       mov ebx,esp
00E00820   81C3 04000000   add ebx,4
00E00826   51        push ecx
00E00827   B9 04000000    mov ecx,4
00E0082C   01CB       add ebx,ecx
00E0082E   59        pop ecx                      ; 1.004EC454
00E0082F   871C24      xchg dword ptr ss:[esp],ebx
00E00832   5C        pop esp                      ; 1.004EC454

//eax=004ec454 ★

第3次

00DBF602   FF30       push dword ptr ds:[eax]
00DBF604   8B0424      mov eax,dword ptr ss:[esp]            ; 1.004EDBE8
00DBF607  ^ E9 130EF7FF    jmp 00D3041F

第4次

00D92AB6   FF33       push dword ptr ds:[ebx]              ; 1.004BF81C
00D92AB8   50        push eax
00D92AB9   B8 21224E5E    mov eax,5E4E2221
00D92ABE   014424 04     add dword ptr ss:[esp+4],eax
00D92AC2   58        pop eax                      ; 1.004BF7D0
00D92AC3   FF3424      push dword ptr ss:[esp]              ; 1.004BF7D0
00D92AC6   5B        pop ebx                      ; 1.004BF7D0
00D92AC7   83C4 04      add esp,4
00D92ACA   81EB 21224E5E   sub ebx,5E4E2221

//ebx= 004bf7d0 ★

第5次

0046B558   55        push ebp //call 0046b558 ★
0046B559   8BEC       mov ebp,esp
0046B55B   51        push ecx                     ; 1.004EDDF0
0046B55C   53        push ebx
0046B55D   56        push esi
0046B55E   57        push edi
0046B55F   894D FC      mov dword ptr ss:[ebp-4],ecx           ; 1.004EDDF0
0046B562   8BDA       mov ebx,edx                    ; 1.004BF81C
0046B564   8BF0       mov esi,eax
0046B566   8BC3       mov eax,ebx
0046B568   FF50 F4      call dword ptr ds:[eax-C]

//EIP ==0046B558 ★

code断下F2断点Shift+F9第一次

007EDF16   68 67EEAB5F    push 5FABEE67
007EDF1B  ^ E9 58AAFFFF    jmp 007E8978                   ; 1.007E8978
007EDF20   0941 2E      or dword ptr ds:[ecx+2E],eax
007EDF23   2F        das
007EDF24   07        pop es
007EDF25   9E        sahf
007EDF26   52        push edx                     ; 1.004610FC
007EDF27   0000       add byte ptr ds:[eax],al
007EDF29   0D 0A6D5041    or eax,41506D0A
007EDF2E   2E:2F       das

//EDX =004610FC ★

第二次

00D81B2C   FF32       push dword ptr ds:[edx]              ; 1.004EDDE8
00D81B2E   FF3424      push dword ptr ss:[esp]              ; 1.004EC464
00D81B31   5A        pop edx                      ; 1.004EC464
00D81B32   57        push edi
00D81B33   89E7       mov edi,esp
00D81B35   81C7 04000000   add edi,4
00D81B3B   83C7 04      add edi,4
00D81B3E   873C24      xchg dword ptr ss:[esp],edi

//EDX =004EC464 ★

第3次 向上看没有VM了 呵呵 应该是到了真正的OEP了

004E7D1E  A1 54C44E00       mov eax,dword ptr ds:[4EC454]
004E7D23  8B00           mov eax,dword ptr ds:[eax]
004E7D25  8B15 A0F54B00      mov edx,dword ptr ds:[4BF5A0]       ; un.004BF5EC
004E7D2B  E8 2838F8FF       call 0046B558               ; un.0046B558
004E7D30  8B0D 24C54E00      mov ecx,dword ptr ds:[4EC524]       ; un.004EF25C
004E7D36  A1 54C44E00       mov eax,dword ptr ds:[4EC454]
004E7D3B  8B00           mov eax,dword ptr ds:[eax]
004E7D3D  8B15 E8754E00      mov edx,dword ptr ds:[4E75E8]       ; un.004E7634
004E7D43  E8 1038F8FF       call 0046B558               ; un.0046B558
004E7D48  A1 54C44E00       mov eax,dword ptr ds:[4EC454]
004E7D4D  8B00           mov eax,dword ptr ds:[eax]
004E7D4F  E8 8438F8FF       call 0046B5D8               ; un.0046B5D8
004E7D54  E8 2FC4F1FF       call 00404188               ; un.00404188
004E7D59  8D40 00         lea eax,dword ptr ds:[eax]


找个delphi6.0的程序对比修复下

push ebp
mov ebp,esp
add esp,-10
mov eax,004e7974        
call 00406380         
mov eax,dword ptr ds:[4Ec454]  
mov eax,dword ptr ds:[eax]
call 0046B540           
mov ecx,dword ptr ds:[004EC320]
mov eax,dword ptr ds:[4Ec454]
mov eax,dword ptr ds:[eax]
mov edx,dword ptr ds:[004BF7D0]
call 0046B558
mov ecx,dword ptr ds:[4Ec464]

用WinHex,打开Dump文件查找原来的OEP被VM的十六进制代码

55 8B EC 83 C4 F0 B8 74 79 4E 00 E8 8C E6 F1 FF A1 54 C4 4E 00 8B 00 E8 40 38 F8 FF 8B 0D 20 C3
4E 00 A1 54 C4 4E 00 8B 00 8B 15 D0 F7 4B 00 E8 40 38 F8 FF 8B 0D 64 C4 4E 00 A1 54 C4 4E 00

然后保存,用LorePE修正OEP,ImportREC修复IAT 保存tree文件(后面会用到的) ,程序就可以运行 但是某些按钮功能失效了, 这可难倒了我难道要我全部修复 我可没哪么厉害

这个想到了 前面脱壳机 不是脱了一个吗 但是不能运行,死马当活马医吧 ,od打开程序停止在VM段,于是猜想应该是堆栈不平衡吧 拿出lordpe 修改 oep的入口点为真正的OEP入口点

补上所有的被偷的代码 新建EIP 保存 打开importREC载入tree文件 修复 运行程序 呵呵 没错了 按钮功能回来了 。程序破解就不说了 嘿嘿毕竟事国产的东西。

--------------------------------------------------------------------------------
【版权声明】: 本文原创于UNpack技术论坛, 转载请注明作者并保持文章的完整, 谢谢!

                            2008年03月18日 18:58:07

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

Squn 发表于 2008-3-18 19:24
[s:39] [s:39] [s:39]
.// 凉水的大作 偶喜欢~~
Hmily 发表于 2008-3-18 19:26
hackwm 发表于 2008-3-18 19:39
小菜还不知道这么深奥的知识哦~~
(*^__^*) 嘻嘻……`
luzechao 发表于 2008-3-18 20:10
话说这个变态壳啊,相当难脱.....
kissy 发表于 2008-3-18 21:42
这个偷的比较少 多了就有点麻烦了
一点点要比较 要运算 然后加点运气和猜 一般能搞定
一见如故 发表于 2008-3-19 08:47
凉水的大作 偶喜欢~~
ryfrjb 发表于 2008-3-21 00:21
夜凉如水,牛人,我顶!
qsl1007 发表于 2008-3-21 10:02
有点没看明白,感觉挺厉害,嘿嘿!!
蚊香 发表于 2008-3-21 20:58
[s:40] [s:41] 传说中的大虾
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-10 04:47

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表