FlashFXP v1.4.1 build 823 的脱壳与破解
软件名称:FlashFXP v1.4.1 build 823
下载:http://www.onlinedown.net/flashfxp
大小:828KB
工具:W32dasm+TRW2000
软件评价:功能强大的FXP /FTP软件,融合了一些其他优秀FTP软件的优点。
我认为它许多方面比cuteftp要好,所以才会有很多朋友喜欢它.
破解: moonlite\edea 联合制作
脱壳爆破过程:
flashfxp1.4.1 823的壳是telock.它的主要特点是anti-debug太多,只要搞定anti-debug,脱壳就容易了。像类似下面的(1)、(2)两段的代码有很多处。所以追踪时要格外小心,最好用F8、F7。
(1)
0167:00583A12 60 PUSHA
0167:00583A13 E806000000 CALL 00583A1E
0167:00583A18 8B642408 MOV ESP,[ESP+08]
《————异常处理入口,此处下断。F5一下。
0167:00583A1C EB0D JMP
SHORT 00583A2B
0167:00583A1E 2BFF SUB
EDI,EDI
0167:00583A20 64FF37 PUSH DWORD
[FS:EDI]
0167:00583A23 648927 MOV
[FS:EDI],ESP 《————从这里后不要往下F8了。
0167:00583A26 F1 INT1
0167:00583A27 FF07 INC
DWORD [EDI]
0167:00583A29 EBE8 JMP
SHORT 00583A13
0167:00583A2B 85E4 TEST
ESP,ESP
0167:00583A2D 7903 JNS
00583A32
(2)
0167:00583A3B F8 CLC
0167:00583A3C 0BC1 OR
EAX,ECX
0167:00583A3E 60 PUSHA
0167:00583A3F E806000000 CALL 00583A4A
0167:00583A44 8B642408 MOV ESP,[ESP+08]
《————异常处理入口
0167:00583A48 EB1A JMP
SHORT 00583A64
0167:00583A4A 6467FF360000 PUSH DWORD [WORD FS:00]
0167:00583A50 646789260000 MOV [WORD FS:00],ESP
0167:00583A56 9C PUSHF
《————从这里开始不要走了,想图方便的话,将eip改为583a48就行了。
0167:00583A57 810C2400010000 OR DWORD [ESP],0100
0167:00583A5E 9D POPF
0167:00583A5F F8 CLC
0167:00583A60 73DC JNC
00583A3E
0167:00583A62 CD20 INT
20
0167:00583A64 64678F060000 POP DWORD [WORD
FS:00]
0167:00583A6A 58 POP
EAX
0167:00583A6B 61 POPA
0167:00583A6C F9 STC
0167:00583A6D 7202 JC
00583A71
(3) 这里是整个壳中最精彩的(不知乱说没有,请多多指教),
0167:00582078 7FE9 JG
00582063
0167:0058207A E800000000 CALL 0058207F
0167:0058207F 5D POP
EBP
0167:00582080 8D4546 LEA
EAX,[EBP+46]
0167:00582083 50 PUSH
EAX
0167:00582084 33C0 XOR
EAX,EAX
0167:00582086 64FF30 PUSH DWORD
[FS:EAX]
0167:00582089 648920 MOV
[FS:EAX],ESP
0167:0058208C CC INT3
0167:0058208D 90 NOP
0167:0058208E 8BC0 MOV
EAX,EAX
0167:00582090 F9 STC
0167:00582091 90 NOP
0167:00582092 8D045D34120000 LEA EAX,[EBX*2+1234]
0167:00582099 F8 CLC
0167:0058209A 90 NOP
0167:0058209B C1EB05 SHR
EBX,05
0167:0058209E FC CLD
0167:0058209F 90 NOP
0167:005820A0 C1C007 ROL
EAX,07
0167:005820A3 90 NOP
0167:005820A4 90 NOP
0167:005820A5 33DB XOR
EBX,EBX
0167:005820A7 F7F3 DIV
EBX
0167:005820A9 64678F060000 POP DWORD [WORD
FS:00]
0167:005820AF 83C404 ADD
ESP,BYTE +04
0167:005820B2 66BE4746 MOV SI,4647
0167:005820B6 66BF4D4A MOV DI,4A4D
0167:005820BA 8A8599000000 MOV AL,[EBP+99]
0167:005820C0 E99C000000 JMP 00582161
0167:005820C5 8B442404 MOV EAX,[ESP+04]
0167:005820C9 8B4C240C MOV ECX,[ESP+0C]
0167:005820CD FF81B8000000 INC DWORD [ECX+B8]
0167:005820D3 8B00 MOV
EAX,[EAX]
0167:005820D5 3D940000C0 CMP EAX,C0000094
0167:005820DA 7524 JNZ
00582100
0167:005820DC FF81B8000000 INC DWORD [ECX+B8]
0167:005820E2 33C0 XOR
EAX,EAX
0167:005820E4 214104 AND
[ECX+04],EAX
0167:005820E7 214108 AND
[ECX+08],EAX
0167:005820EA 21410C AND
[ECX+0C],EAX
0167:005820ED 214110 AND
[ECX+10],EAX
0167:005820F0 816114F00FFFFF AND DWORD [ECX+14],FFFF0FF0
0167:005820F7 81611800DC0000 AND DWORD [ECX+18],DC00
0167:005820FE EB60 JMP
SHORT 00582160
0167:00582100 3D04000080 CMP EAX,80000004
0167:00582105 740C JZ
00582113
0167:00582107 3D03000080 CMP EAX,80000003
0167:0058210C 7412 JZ
00582120
0167:0058210E 6A01 PUSH
BYTE +01
0167:00582110 58 POP
EAX
0167:00582111 EB4D JMP
SHORT 00582160
0167:00582113 E801000000 CALL 00582119
0167:00582118 0058FE ADD
[EAX-02],BL
0167:0058211B 002B ADD
[EBX],CH
0167:0058211D C0EB40 SHR
BL,40
0167:00582120 8B81B4000000 MOV EAX,[ECX+B4]
0167:00582126 8D4024 LEA
EAX,[EAX+24]
0167:00582129 894104 MOV
[ECX+04],EAX
0167:0058212C 8B81B4000000 MOV EAX,[ECX+B4]
0167:00582132 8D401F LEA
EAX,[EAX+1F]
0167:00582135 894108 MOV
[ECX+08],EAX
0167:00582138 8B81B4000000 MOV EAX,[ECX+B4]
0167:0058213E 8D401A LEA
EAX,[EAX+1A]
0167:00582141 89410C MOV
[ECX+0C],EAX
0167:00582144 8B81B4000000 MOV EAX,[ECX+B4]
0167:0058214A 8D4011 LEA
EAX,[EAX+11]
0167:0058214D 894110 MOV
[ECX+10],EAX
0167:00582150 33C0 XOR
EAX,EAX
0167:00582152 816114F00FFFFF AND DWORD [ECX+14],FFFF0FF0
0167:00582159 C7411855010000 MOV DWORD [ECX+18],0155
0167:00582160 C3 RET
0167:00582161 2C04 SUB
AL,04
0167:00582163 888599000000 MOV [EBP+99],AL
0167:00582169 8B95CF1B0000 MOV EDX,[EBP+1BCF]
0167:0058216F 81E20000FFFF AND EDX,FFFF0000
0167:00582175 8BC4 MOV
EAX,ESP
0167:00582177 33E4 XOR
ESP,ESP
0167:00582179 8BE0 MOV
ESP,EAX
0167:0058217B 66813A4D5A CMP WORD [EDX],5A4D
0167:00582180 7408 JZ
0058218A
如果觉得麻烦,可跳过58208c int3,然后在5820c5处下断。断下后一路F8到达582160时(不要再走了),停下,下中断bpx 5820ba.按一下F5,停在了5820ba处。走到582161时,快给al赋值4,好了,这一关算过去了。下面还有很多anti-debug,主要形式是
int1 、div ebx、inc [esi] 、pushf 等等,够烦的,只要小心一些,都会过去的。
当你走到这样的代码:call 583145 时,停一下,为了偷懒,直接下中断:bpx 583683. F5断下后,一路又要小心了,还有anti-debug,还是那些东东。顺利走过那些陷阱后,到达下面就是终点了:
167:005837AF INT 20
0167:005837B1 POPA
0167:005837B2 JMP NEAR [ESP-30]
《————oep=[esp-30]==535334,
0167:005837B6 ADD BYTE [EAX],00
0167:005837B9 ADD [EAX],AL
0167:005837BB JMP SHORT 005837BE
0167:005837BD MOV EAX,6090C523
0167:005837C2 CALL 005837CD
0167:005837C7 MOV ESP,[ESP+08]
到达535334后,pedump,得到脱壳文件。用importREC 的 Auto trace一次,会发现有138个函数需修正,如果耐心好的话,那就一个一个的搞;不然,想想办法,有窍门的。具体如何修复重建请参考那些高人的教程。
4)先用W32dasm反汇编脱壳文件,在SDR中可以发现 " - Evaluation Copy"。双击它
会找到很多处。看一下这里:
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:00525E08(C)
|
:00525E1D 803DA0A0530000 cmp byte ptr [0053A0A0],
00 //比较
:00525E24 7411
je 00525E37------------------>不要跳
* Possible StringData Ref from Code Obj ->"FlashFXP"
|
:00525E26 BAA0615200 mov edx,
005261A0
:00525E2B A120C05300 mov eax,
dword ptr [0053C020]
:00525E30 E87F21F2FF call 00447FB4
:00525E35 EB0F
jmp 00525E46
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:00525E24(C)
|
* Possible StringData Ref from Code Obj ->"FlashFXP - Evaluation Copy"
|
:00525E37 BAB4615200 mov edx,
005261B4
:00525E3C A120C05300 mov eax,
dword ptr [0053C020]
:00525E41 E86E21F2FF call 00447FB4
啊,很明显,[0053A0A0]这个内存地址中的值与注册关系满密切的,查找文本
"cmp byte [00533ec0],00"这样的地方好像有48处之多!!
5)好,开始吧!
运行flashfxp.exe,注册的nag窗口出来了!填入build 819的key
退出后,用TRW载入,下断bpm 53A0A0 W,F5来到:
:0050C55F E82079EFFF call 00403E84
:0050C564 83F811
cmp eax, 00000011 <------------------此时 查eax=11
:0050C567 0F9405A0A05300 sete byte ptr [0053A0A0]<------------置1
:0050C56E 803DA0A0530000 cmp byte ptr [0053A0A0],
00<---------光标
:0050C575 0F849A020000 je 0050C815
:0050C57B A188C25300 mov eax,
dword ptr [0053C288]
:0050C580 3DCE7F210B cmp eax,
0B217FCE
:0050C585 0F8F53010000 jg 0050C6DE
......
不用说,后面有暗桩了,往下追追看。。会来到:
* Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
|:0050C58B(C), :0050C59C(C), :0050C5A9(C), :0050C5B6(C), :0050C5C1(C)
|:0050C5CC(C), :0050C5D7(C), :0050C5E7(C), :0050C5F2(C), :0050C604(C)
|:0050C60F(C), :0050C61A(C), :0050C62A(C), :0050C635(C), :0050C647(C)
|:0050C654(C), :0050C65F(C), :0050C66A(C), :0050C675(C), :0050C685(C)
|:0050C690(C), :0050C6A2(C), :0050C6AD(C), :0050C6B8(C), :0050C6C8(C)
|:0050C6D3(C), :0050C6E9(C), :0050C6F6(C), :0050C703(C), :0050C70E(C)
|:0050C719(C), :0050C724(C), :0050C734(C), :0050C73F(C), :0050C751(C)
|:0050C758(C), :0050C75F(C), :0050C76B(C), :0050C772(C), :0050C780(C)
|:0050C789(C), :0050C790(C), :0050C797(C), :0050C7A0(C), :0050C7A7(C)
|:0050C7B2(C), :0050C7B9(C), :0050C7C0(C), :0050C7C9(C)
|
:0050C7D2 C605A0A0530000 mov byte ptr [0053A0A0],
00<------置0后,当然是未注册了!####
:0050C7D9 33C0
xor eax, eax
:0050C7DB A334C05300 mov dword
ptr [0053C034], eax
:0050C7E0 B828C05300 mov eax,
0053C028
:0050C7E5 8B15FCA55300 mov edx, dword
ptr [0053A5FC]
....
这么jump到0050C7D2,这真是“热点”啊。还是改改吧,在0050C7D2 改为 jmp 0050C815后,往下走:
:0050C815 A188C25300 mov eax,
dword ptr [0053C288]
:0050C81A 33D2
xor edx, edx
:0050C81C 52
push edx
:0050C81D 50
push eax
:0050C81E 8D45F0
lea eax, dword ptr [ebp-10]
:0050C821 E8AAC6EFFF call 00408ED0
:0050C826 8B4DF0
mov ecx, dword ptr [ebp-10]
* Possible StringData Ref from Code Obj ->"Main"
|
:0050C829 BA40CE5000 mov edx,
0050CE40
:0050C82E A17CC05300 mov eax,
dword ptr [0053C07C]
:0050C833 E87CFDFAFF call 004BC5B4----------->进入
:0050C838 84C0
test al, al<--------------------标志测试
:0050C83A 7443
je 0050C87F
:0050C83C C605A0A0530000 mov byte ptr [0053A0A0],
00<----注意这里
。。。
call 004BC5B4--------->进入后来到
* Possible StringData Ref from Code Obj ->""
|
:004BC5EE BA2CC64B00 mov edx,
004BC62C
:004BC5F3 E89C79F4FF call 00403F94
:004BC5F8 0F95C0
setne al<------置标志 #####
:004BC5FB 8BD8
mov ebx, eax
:004BC5FD 33C0
xor eax, eax
:004BC5FF 5A
pop edx
:004BC600 59
pop ecx
:004BC601 59
pop ecx
:004BC602 648910
mov dword ptr fs:[eax], edx
:004BC605 681AC64B00 push 004BC61A
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:004BC618(U)
|
:004BC60A 8D45FC
lea eax, dword ptr [ebp-04]
:004BC60D E8F675F4FF call 00403C08
:004BC612 C3
ret
置标志的地方,打补丁mov al,0 后继续走来到:
:0050CA82 A354C25300 mov dword
ptr [0053C254], eax
:0050CA87 8B45FC
mov eax, dword ptr [ebp-04]
:0050CA8A E845810200 call 00534BD4----------->进入
:0050CA8F 84C0
test al, al<--------------------标志测试
:0050CA91 7443
je 0050CAD6
:0050CA93 C605A0A0530000 mov byte ptr [0053A0A0],
00<----注意这里
:0050CA9A 33C0
xor eax, eax
...
call 00534BD4--------->进入后来到
:00534C5D 8B55F4
mov edx, dword ptr [ebp-0C]
:00534C60 8B45F8
mov eax, dword ptr [ebp-08]
:00534C63 E8F0CEF2FF call 00461B58
:00534C68 84C0
test al, al<------标志测试 #####
:00534C6A 7504
jne 00534C70<-----不要在这跳啊!
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:00534C4A(C)
|
:00534C6C 33C0
xor eax, eax
:00534C6E EB02
jmp 00534C72
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:00534C6A(C)
|
:00534C70 B001
mov al, 01
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
......
在00534C68打补丁: xor al,al
之后, BD* 暂停所有断点,F5。。。哇,注册成功!
6)把key中的名字换成自己的又如何呢??(^_^毕竟我想注册给自己啊)
好, 删除原来的key文件,运行flashfxp.exe,注册的nag窗口出来了!填入build 819的key,
并改成自己的名字。填完后,OK,程序退出。用TRW重新载入flashfxp.exe,下bpm 53A0A0 W,
F5后来到:
:0050C550 E8A3CAEFFF call 00408FF8
:0050C555 A388C25300 mov dword
ptr [0053C288], eax
:0050C55A A128C05300 mov eax,
dword ptr [0053C028]
:0050C55F E82079EFFF call 00403E84
:0050C564 83F811
cmp eax, 00000011 <-----------------在此eax=0 ###
:0050C567 0F9405A0A05300 sete byte ptr [0053A0A0]<-----------注册标志
:0050C56E 803DA0A0530000 cmp byte ptr [0053A0A0],
00<---------光标
:0050C575 0F849A020000 je 0050C815
:0050C57B A188C25300 mov eax,
dword ptr [0053C288]
:0050C580 3DCE7F210B cmp eax,
0B217FCE
:0050C585 0F8F53010000 jg 0050C6DE
:0050C58B 0F8441020000 je 0050C7D2
:0050C591 3D125EF9C9 cmp eax,
C9F95E12
:0050C596 0F8FA4000000 jg 0050C640
:0050C59C 0F8430020000 je 0050C7D2
:0050C5A2 3DAB90A0A2 cmp eax,
A2A090AB
:0050C5A7 7F54
jg 0050C5FD
:0050C5A9 0F8423020000 je 0050C7D2
........后边判断很长呵......
反正得叫[0053A0A0]=1,聪明的你知道哪里打补丁了吧。我是在50C564处改:xor eax,eax
然后BD*, F5,哈哈,提示注册的nag窗口没有了,那个-Evaluation Copy的字样也没有了,点击Help->About,
竟然注册给你了!不要高兴的太早了,看看右下角的出错窗口有
---
DEBUG VERSION
An internal error has occurred.
Access violation at address 0051293D in module 'FLASHFXP823.EXE'. Read of address
FFFFFFFF
---
然后,你点击各个菜单项,再上网试试它的各项功能,注意它的出错窗口--还真有不少错误!一边试,一边把
出错的地址记录下来。(还真是debug,一点没有错。)打开w32dasm,查找出错的地址,找到它上面的跳转语句,
将其改为Jmp。直到Error/Transfer Window 没有错误为止。大概有十来条跳转该改啊。
另外,该程序运行出错的话,会log到它所在目录下的errorlog.txt,和debug.log中,根据它们调试就可以了,
就看你的耐心了。反复调试,直到满意为止。
7)结束了吗? No,还有一项不要忘记测试,就是过期问题。将时间向后调2年,再运行程序。注册窗口又来了!!
好,再下断点bpm 53A0A0 W:
会来到:
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:005035AD(C)
|
:005035C6 8B45E8
mov eax, dword ptr [ebp-18]
:005035C9 A394C05300 mov dword
ptr [0053C094], eax
:005035CE 837DE820 cmp
dword ptr [ebp-18], 00000020<--------使用天数比较
:005035D2 7C2E
jl 00503602<---------------------------没有过期就转走!
:005035D4 A128C05300 mov eax,
dword ptr [0053C028]
:005035D9 E8A608F0FF call 00403E84
:005035DE 83F811
cmp eax, 00000011
哈哈,知道怎么打补丁了吧!好,收工!!!
8)小结:搞完这个冬冬后,头昏脑胀的。盼望大客们拿出更聪明的办法,小弟也学学。
最后,恭祝大家新年快乐!
作者:moonlite[bcg][fcg] Edea
22:31 01-12-26
- 标 题:转贴一篇:FlashFXP v1.4.1 build 823 的脱壳与破解 (16千字)
- 作 者:拉灯睡觉
- 时 间:2001-12-30 0:44:10
- 链 接:http://bbs.pediy.com