本帖最后由 pk8900 于 2017-12-31 08:45 编辑
【适合破解新手的160个crackme练手】第57个Eternal Bliss.exe,这个Eternal Bliss.exe系列的都是VB程序,也比较简单,论坛里没人发贴,我在这一帖子中全部写下来,其它的在下面的楼层。
【crackme简介】
下载地址:http://pan.baidu.com/share/link?shareid=541269&uk=4146939145
Microsoft Visual Basic 5.0 / 6.0编写,无壳,共有8个验证,有提示文字。
标注为?,估计难度为1星。
工具:X64dbg,VB Decompiler
【crackme截图】
【分析过程】
既然是VB程序,那就要请出VB Decompiler,通过VB Decompiler中代码分析,并在X64DBG中进行验证,可以得到程序的大体框架信息。
[Visual Basic] 纯文本查看 复制代码 Private Sub Command1_Click() '403604
loc_00403622: var_eax = %y 'Ignore this '__vbaChkstk
loc_0040364D: var_eax = arg_8.AddRef 'Ignore this
loc_00403664: ecx = False
loc_0040368C: If (arg_8 = 1) = 0 Then GoTo loc_004036D2
loc_00403696: var_eax = Me.1784
loc_0040369C: var_98 = Me.1784
loc_004036F5: If (arg_8 = 2) = 0 Then GoTo loc_0040373B
loc_004036FF: var_eax = Me.1788
loc_00403705: var_98 = Me.1788
loc_0040375E: If (arg_8 = 3) = 0 Then GoTo loc_004037A4
loc_00403768: var_eax = Me.1792
loc_0040376E: var_98 = Me.1792
loc_004037C7: If (arg_8 = 4) = 0 Then GoTo loc_0040380D
loc_004037D1: var_eax = Me.1796
loc_004037D7: var_98 = Me.1796
loc_00403830: If (arg_8 = 5) = 0 Then GoTo loc_00403876
loc_0040383A: var_eax = Me.1804
loc_00403840: var_98 = Me.1804
loc_00403899: If (arg_8 = 6) = 0 Then GoTo loc_004038DF
loc_004038A3: var_eax = Me.1808
loc_004038A9: var_98 = Me.1808
loc_00403902: If (arg_8 = 7) = 0 Then GoTo loc_00403948
loc_0040390C: var_eax = Me.1812
loc_00403912: var_98 = Me.1812
loc_0040396B: If (arg_8 = 8) = 0 Then GoTo loc_004039B1
loc_00403975: var_eax = Me.1800
loc_0040397B: var_98 = Me.1800
loc_004039D1: If (arg_8 = False) = 0 Then GoTo loc_00403A5B
loc_00403A07: var_34 = "Error!!"
loc_00403A20: var_24 = "Choose a compare method!!"
loc_00403A37: MsgBox(var_24, 16, var_34, var_44, var_54)
loc_00403A4E: call undef 'Ignore this '__vbaFreeVarList(00000004, var_24, var_34, var_44, var_54, arg_8, arg_8, arg_8, arg_8, arg_8, arg_8, arg_8, arg_8, 0, esi, ebx)
loc_00403A56: GoTo loc_00403B84
loc_00403A5B: 'Referenced from: 004039D1
loc_00403A7E: If (arg_8 = 1) = 0 Then GoTo loc_00403B05
loc_00403AB4: var_34 = "Good Work!"
loc_00403ACD: var_24 = "Well Done! Go to next one!"
loc_00403AE4: MsgBox(var_24, 64, var_34, var_44, var_54)
loc_00403AFB: call undef 'Ignore this '__vbaFreeVarList(00000004, var_24, var_34, var_44, var_54)
loc_00403B03: GoTo loc_00403B84
loc_00403B05: 'Referenced from: 00403A7E
loc_00403B35: var_34 = "Wrong!"
loc_00403B4E: var_24 = "Wrong! Try again!"
loc_00403B65: MsgBox(var_24, 0, var_34, var_44, var_54)
loc_00403B7C: call undef 'Ignore this '__vbaFreeVarList(00000004, var_24, var_34, var_44, var_54)
loc_00403B84: 'Referenced from: 00403A56
loc_00403B90: GoTo loc_00403BAD
loc_00403BA4: call undef 'Ignore this '__vbaFreeVarList(00000004, var_24, var_34, var_44, var_54, var_00403BAE)
loc_00403BAC: Exit Sub
loc_00403BAD: 'Referenced from: 00403B90
End Sub
在CHECK按钮事件代码中,可以看到,程序通过arg_8的值来确定选择了哪一种验证模式,然后验证是否正确。
通过查看各种验证方式对应的代码,方式1和2最简单,明码比较,静态分析就能发现,VB Decompiler中代码如下:
loc_004044E7: var_1C = "String"
loc_004044F4: var_eax = Unknown_VTable_Call[eax+00000318h]
loc_00404513: var_20 = arg_8.MousePointer
loc_0040451B: var_3C = var_20
loc_00404552: var_18 = var_20
loc_0040455A: var_eax = %fobj
loc_0040456C: If (var_1C <> var_18) <> 0 Then GoTo loc_0040458A
loc_00404585: ecx = CInt(1)
loc_0040458A: 'Referenced from: 0040456C
可明显看出var_1C = "String"后,又有(var_1C <> var_18)的比较,经验证方式一String的注册码就是“String”,方式二Variant的注册码为:"Empty",接下来是方式三:long,在VB Decompiler反编译的代码中并未发现固定值,但发现关键比较代码为:var_24 <> 0,这就要进行动态调试了。
[Visual Basic] 纯文本查看 复制代码 loc_00404747: var_eax = %y 'Ignore this '__vbaChkstk loc_0040476F: var_eax = arg_8.AddRef 'Ignore this
loc_00404774: On Error Resume Next
loc_00404788: var_eax = Unknown_VTable_Call[eax+00000318h]
loc_004047A7: var_28 = arg_8.MousePointer
loc_004047AF: var_44 = var_28
loc_004047DE: var_20 = CLng(var_28)
loc_004047EC: var_eax = %fobj
loc_004047F7: If var_24 <> 0 Then GoTo loc_00404815
loc_00404810: ecx = CInt(1)
loc_00404815: 'Referenced from: 004047F7
loc_00404815: GoTo loc_00404830
loc_0040482B: ecx = False
X64DBG中,00404747下断,并查看代码发现如下代码:
我们找到了关键的值:0x2C2FAE(十进制:2895790),2895790就是第三种方式long的注册码。
第四种方式,Currency,按理解应该为货币格式数据,可这里却不同,我们在程序中找到了关键值:0x8180754(十进制:135792468),按说输入数字:135792468就能注册,但这里不行,通过跟踪发现,程序在调用了:VBA_vbaCyStr后,却变成了:1357924680000,也就是将这个值后面补了4个0,经多次尝试发现输入13579.2468的浮点数后,VBA_vbaCyStr处理后内存中的数据为135792468,所以第四种方式的注册码为:13579.2468,(总结:VB中货币数据格式后四位为小数位,没有小数位的用0进行占位),后面的几种就差不多了,分别压入各数据类型的数据,然后和我们输入的值进行比较。第五种:Single:注册码为:9764317691904,第六组:Double:注册码为:147258369789456000,第七种:Integer注册码为:23535,第八种:BYTE:注册码为:239。
通过这个Crackme我们可以学习到VB程序各种数据类型在内存中的存放形式,估计下几个系列CRACKME会和这方面有关系吧。
Eternal Bliss系列共7个,分别在以下楼层。
160个CrackMe之057 (Eternal Bliss.exe) 顶楼
160个CrackMe之058 (Eternal Bliss.1.exe) 2楼
160个CrackMe之059 (Eternal Bliss.2.exe) 3楼
160个CrackMe之060 (Eternal Bliss.3.exe) 5楼
160个CrackMe之061 (Eternal Bliss.4.exe) 6楼
160个CrackMe之062 (Eternal Bliss.9.exe) 7楼
160个CrackMe之063 (Eternal Bliss.10.exe) 8楼
|