【破文标题】ocn的一个CRACKME分析
【破文作者】逍遥风OCN
【破解工具】PEID,OD
【破解平台】WIN2K
----------------------------------------------------------------------
1)PEID检查,Microsoft Visual Basic 5.0 / 6.0,无壳。
2)OD载入程序,在命令行下断。bp __vbaVarTstEq 任意输入注册信息后,程序中断(这时没有在程序领空,需要返回)
注意堆栈提示:
0012F548 6A2A50E6 MSVBVM60.6A2A50E6
0012F54C 00404F9F 返回到 Crackme_.00404F9F 来自 MSVBVM60.__vbaVarTstEq (注意这里)
0012F550 0012F5A8
0012F554 0012F600
0012F558 0012F674
CTRL+G来到00404F9F处,向上找到合适的地方下断(离00404F9F不远好几处都可以成功下断)
我在00404DE7 处下断。
3)OD重新载入程序,任意输入注册信息后程序中断。
00404DE7 57 PUSH EDI (来到这里)
00404DE8 895D DC MOV DWORD PTR SS:[EBP-24],EBX
00404DEB 895D CC MOV DWORD PTR SS:[EBP-34],EBX
00404DEE 895D BC MOV DWORD PTR SS:[EBP-44],EBX
00404DF1 895D B8 MOV DWORD PTR SS:[EBP-48],EBX
00404DF4 895D A8 MOV DWORD PTR SS:[EBP-58],EBX
00404DF7 895D 98 MOV DWORD PTR SS:[EBP-68],EBX
00404DFA 895D 94 MOV DWORD PTR SS:[EBP-6C],EBX
00404DFD 895D 90 MOV DWORD PTR SS:[EBP-70],EBX
00404E00 895D 80 MOV DWORD PTR SS:[EBP-80],EBX
00404E03 899D 70FFFFFF MOV DWORD PTR SS:[EBP-90],EBX
00404E09 899D 60FFFFFF MOV DWORD PTR SS:[EBP-A0],EBX
00404E0F 899D 50FFFFFF MOV DWORD PTR SS:[EBP-B0],EBX
00404E15 899D 40FFFFFF MOV DWORD PTR SS:[EBP-C0],EBX
00404E1B 899D 30FFFFFF MOV DWORD PTR SS:[EBP-D0],EBX
00404E21 FF92 08030000 CALL DWORD PTR DS:[EDX+308]
00404E27 50 PUSH EAX
00404E28 8D45 90 LEA EAX,DWORD PTR SS:[EBP-70]
00404E2B 50 PUSH EAX
00404E2C FF15 24104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaObjSe>; MSVBVM60.__vbaObjSet
00404E32 8BF0 MOV ESI,EAX
00404E34 8D55 94 LEA EDX,DWORD PTR SS:[EBP-6C]
00404E37 52 PUSH EDX
00404E38 56 PUSH ESI
00404E39 8B0E MOV ECX,DWORD PTR DS:[ESI]
00404E3B FF91 A0000000 CALL DWORD PTR DS:[ECX+A0]
00404E41 3BC3 CMP EAX,EBX
00404E43 DBE2 FCLEX
00404E45 7D 12 JGE SHORT Crackme_.00404E59
00404E47 68 A0000000 PUSH 0A0
00404E4C 68 F8444000 PUSH Crackme_.004044F8
00404E51 56 PUSH ESI
00404E52 50 PUSH EAX
00404E53 FF15 1C104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaHresu>; MSVBVM60.__vbaHresultCheckObj
00404E59 8B45 94 MOV EAX,DWORD PTR SS:[EBP-6C] ; 取注册名
00404E5C 50 PUSH EAX
00404E5D FF15 AC104000 CALL DWORD PTR DS:[<&MSVBVM60.#581>] ; MSVBVM60.rtcR8ValFromBstr
00404E63 8B35 08104000 MOV ESI,DWORD PTR DS:[<&MSVBVM60.__vbaVa>; MSVBVM60.__vbaVarMove (变量赋值)
00404E69 8D95 40FFFFFF LEA EDX,DWORD PTR SS:[EBP-C0]
00404E6F DD9D 48FFFFFF FSTP QWORD PTR SS:[EBP-B8]
00404E75 8D4D DC LEA ECX,DWORD PTR SS:[EBP-24]
00404E78 C785 40FFFFFF 0>MOV DWORD PTR SS:[EBP-C0],5
00404E82 FFD6 CALL ESI
00404E84 8D4D 94 LEA ECX,DWORD PTR SS:[EBP-6C]
00404E87 FF15 A4104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaFreeS>; MSVBVM60.__vbaFreeStr
00404E8D 8D4D 90 LEA ECX,DWORD PTR SS:[EBP-70]
00404E90 FF15 A8104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaFreeO>; MSVBVM60.__vbaFreeObj
00404E96 8D4D DC LEA ECX,DWORD PTR SS:[EBP-24]
00404E99 8D55 DC LEA EDX,DWORD PTR SS:[EBP-24]
00404E9C 51 PUSH ECX
00404E9D 8D45 80 LEA EAX,DWORD PTR SS:[EBP-80]
00404EA0 52 PUSH EDX
00404EA1 50 PUSH EAX
00404EA2 FF15 88104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaVarAd>; MSVBVM60.__vbaVarAdd(变量相加)
00404EA8 8BD0 MOV EDX,EAX 相加的结果在EAX中返回
00404EAA 8D4D CC LEA ECX,DWORD PTR SS:[EBP-34]
00404EAD FFD6 CALL ESI
00404EAF 8D4D CC LEA ECX,DWORD PTR SS:[EBP-34]
00404EB2 8D95 40FFFFFF LEA EDX,DWORD PTR SS:[EBP-C0]
00404EB8 51 PUSH ECX
00404EB9 8D45 80 LEA EAX,DWORD PTR SS:[EBP-80]
00404EBC 52 PUSH EDX
00404EBD 50 PUSH EAX
00404EBE C785 48FFFFFF 9>MOV DWORD PTR SS:[EBP-B8],15E0E9C ; 取定值15E0E9C,放进EBP-B8
00404EC8 C785 40FFFFFF 0>MOV DWORD PTR SS:[EBP-C0],3
00404ED2 FF15 88104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaVarAd>; MSVBVM60.__vbaVarAdd(变量相加)
00404ED8 8BD0 MOV EDX,EAX 相加的结果在EAX中返回
00404EDA 8D4D BC LEA ECX,DWORD PTR SS:[EBP-44]
00404EDD FFD6 CALL ESI
00404EDF 8D4D BC LEA ECX,DWORD PTR SS:[EBP-44]
00404EE2 8D95 40FFFFFF LEA EDX,DWORD PTR SS:[EBP-C0]
00404EE8 51 PUSH ECX
00404EE9 8D45 80 LEA EAX,DWORD PTR SS:[EBP-80]
00404EEC 52 PUSH EDX
00404EED 50 PUSH EAX
00404EEE C785 48FFFFFF 0>MOV DWORD PTR SS:[EBP-B8],4 ; 取定值4,放进EBP-B8
00404EF8 C785 40FFFFFF 0>MOV DWORD PTR SS:[EBP-C0],2
00404F02 FF15 58104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaVarMu>; MSVBVM60.__vbaVarMul(变量相乘)
00404F08 8BD0 MOV EDX,EAX 结果在EAX中返回
00404F0A 8D4D A8 LEA ECX,DWORD PTR SS:[EBP-58]
00404F0D FFD6 CALL ESI
00404F0F 8D4D BC LEA ECX,DWORD PTR SS:[EBP-44]
00404F12 8D55 A8 LEA EDX,DWORD PTR SS:[EBP-58]
00404F15 51 PUSH ECX
00404F16 8D45 80 LEA EAX,DWORD PTR SS:[EBP-80]
00404F19 52 PUSH EDX
00404F1A 50 PUSH EAX
00404F1B FF15 88104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaVarAd>; MSVBVM60.__vbaVarAdd(变量相加)
00404F21 8BD0 MOV EDX,EAX 结果在EAX中返回
00404F23 8D4D 98 LEA ECX,DWORD PTR SS:[EBP-68]
00404F26 FFD6 CALL ESI
00404F28 8B0F MOV ECX,DWORD PTR DS:[EDI]
00404F2A 57 PUSH EDI
00404F2B FF91 0C030000 CALL DWORD PTR DS:[ECX+30C]
00404F31 8D55 90 LEA EDX,DWORD PTR SS:[EBP-70]
00404F34 50 PUSH EAX
00404F35 52 PUSH EDX
00404F36 FF15 24104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaObjSe>; MSVBVM60.__vbaObjSet
00404F3C 8BF0 MOV ESI,EAX
00404F3E 8D4D 94 LEA ECX,DWORD PTR SS:[EBP-6C]
00404F41 51 PUSH ECX
00404F42 56 PUSH ESI
00404F43 8B06 MOV EAX,DWORD PTR DS:[ESI]
00404F45 FF90 A0000000 CALL DWORD PTR DS:[EAX+A0]
00404F4B 3BC3 CMP EAX,EBX
00404F4D DBE2 FCLEX
00404F4F 7D 12 JGE SHORT Crackme_.00404F63
00404F51 68 A0000000 PUSH 0A0
00404F56 68 F8444000 PUSH Crackme_.004044F8
00404F5B 56 PUSH ESI
00404F5C 50 PUSH EAX
00404F5D FF15 1C104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaHresu>; MSVBVM60.__vbaHresultCheckObj
00404F63 8B55 94 MOV EDX,DWORD PTR SS:[EBP-6C]
00404F66 8D4D B8 LEA ECX,DWORD PTR SS:[EBP-48]
00404F69 895D 94 MOV DWORD PTR SS:[EBP-6C],EBX
00404F6C FF15 94104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaStrMo>; MSVBVM60.__vbaStrMove(变量赋值)
00404F72 8D4D 90 LEA ECX,DWORD PTR SS:[EBP-70]
00404F75 FF15 A8104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaFreeO>; MSVBVM60.__vbaFreeObj
00404F7B 8B55 B8 MOV EDX,DWORD PTR SS:[EBP-48]
00404F7E 8D45 98 LEA EAX,DWORD PTR SS:[EBP-68]
00404F81 8D8D 40FFFFFF LEA ECX,DWORD PTR SS:[EBP-C0]
00404F87 50 PUSH EAX
00404F88 51 PUSH ECX
00404F89 8995 48FFFFFF MOV DWORD PTR SS:[EBP-B8],EDX
00404F8F C785 40FFFFFF 0>MOV DWORD PTR SS:[EBP-C0],8008
00404F99 FF15 44104000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaVarTs>; MSVBVM60.__vbaVarTstEq(变量相比较)
VB程序分析起来实在费劲,为考虑版面每个运算细节没能全部列出来。只能体现出一个大概计算过程。
----------------------------------------------------------------------
算法总结:
1)注册名乘以定值2,再加定值22941340(15E0E9C的十进制)。设结果为A
2)A*4+A的值就为注册码
例:
注册名:123
123*2+22941340=22941586
22941586*4+123*2=91766344+22941586=114707930
所以:注册名123
注册码114707930
----------------------------------------------------------------------
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!