某VB程序的暴破+分析
00402220 > \55 push ebp ; 按下确定按钮后停在这里
00402221 . 8BEC mov ebp, esp
00402223 . 83EC 0C sub esp, 0C
00402226 . 68 E6104000 push <jmp.&MSVBVM60.__vbaExceptHandle>; SE 处理程序安装
0040222B . 64:A1 0000000>mov eax, dword ptr fs:[0]
00402231 . 50 push eax
00402232 . 64:8925 00000>mov dword ptr fs:[0], esp
00402239 . 81EC A8000000 sub esp, 0A8
0040223F . 53 push ebx
00402240 . 56 push esi
00402241 . 57 push edi
00402242 . 8965 F4 mov dword ptr [ebp-C], esp
00402245 . C745 F8 A8104>mov dword ptr [ebp-8], 004010A8
0040224C . 8B75 08 mov esi, dword ptr [ebp+8]
0040224F . 8BC6 mov eax, esi
00402251 . 83E0 01 and eax, 1
00402254 . 8945 FC mov dword ptr [ebp-4], eax
00402257 . 83E6 FE and esi, FFFFFFFE
0040225A . 56 push esi
0040225B . 8975 08 mov dword ptr [ebp+8], esi
0040225E . 8B0E mov ecx, dword ptr [esi]
00402260 . FF51 04 call dword ptr [ecx+4]
00402263 . 33DB xor ebx, ebx
00402265 . B9 0C000000 mov ecx, 0C ; 将OC传给ECX
0040226A . 895D E0 mov dword ptr [ebp-20], ebx
0040226D . 895D DC mov dword ptr [ebp-24], ebx
00402270 . 895D CC mov dword ptr [ebp-34], ebx
00402273 . 895D BC mov dword ptr [ebp-44], ebx
00402276 . 895D AC mov dword ptr [ebp-54], ebx
00402279 . 895D 9C mov dword ptr [ebp-64], ebx
0040227C . 895D 8C mov dword ptr [ebp-74], ebx
0040227F . 899D 7CFFFFFF mov dword ptr [ebp-84], ebx
00402285 . FF15 48104000 call dword ptr [<&MSVBVM60.__vbaUI1I2>; MSVBVM60.__vbaUI1I2
0040228B . 8B16 mov edx, dword ptr [esi]
0040228D . 56 push esi
0040228E . 8845 E8 mov byte ptr [ebp-18], al
00402291 . FF92 04030000 call dword ptr [edx+304]
00402297 . 50 push eax ; /Arg2
00402298 . 8D45 DC lea eax, dword ptr [ebp-24] ; |
0040229B . 50 push eax ; |Arg1
0040229C . FF15 20104000 call dword ptr [<&MSVBVM60.__vbaObjSe>; \__vbaObjSet
004022A2 . 8BF8 mov edi, eax
004022A4 . 8D55 E0 lea edx, dword ptr [ebp-20]
004022A7 . 52 push edx
004022A8 . 57 push edi
004022A9 . 8B0F mov ecx, dword ptr [edi]
004022AB . FF91 A0000000 call dword ptr [ecx+A0]
004022B1 . 3BC3 cmp eax, ebx
004022B3 . DBE2 fclex
004022B5 . 7D 12 jge short 004022C9
004022B7 . 68 A0000000 push 0A0 ; /Arg4 = 000000A0
004022BC . 68 E41B4000 push 00401BE4 ; |Arg3 = 00401BE4
004022C1 . 57 push edi ; |Arg2
004022C2 . 50 push eax ; |Arg1
004022C3 . FF15 18104000 call dword ptr [<&MSVBVM60.__vbaHresu>; \__vbaHresultCheckObj
004022C9 > 8B45 E0 mov eax, dword ptr [ebp-20] ; 将假码放在EAX中
004022CC . 6A 01 push 1 ; /Arg3 = 00000001
004022CE . 8945 D4 mov dword ptr [ebp-2C], eax ; |
004022D1 . 8D45 CC lea eax, dword ptr [ebp-34] ; |
004022D4 . 8D4D BC lea ecx, dword ptr [ebp-44] ; |
004022D7 . 50 push eax ; |Arg2
004022D8 . 51 push ecx ; |Arg1
004022D9 . 895D E0 mov dword ptr [ebp-20], ebx ; |
004022DC . C745 CC 08000>mov dword ptr [ebp-34], 8 ; |
004022E3 . FF15 8C104000 call dword ptr [<&MSVBVM60.#619>] ; \rtcRightCharVar
004022E9 . 8D55 BC lea edx, dword ptr [ebp-44]
004022EC . 8D45 8C lea eax, dword ptr [ebp-74]
004022EF . 52 push edx ; /Arg2
004022F0 . 50 push eax ; |Arg1
004022F1 . C745 94 09000>mov dword ptr [ebp-6C], 9 ; |
004022F8 . C745 8C 02800>mov dword ptr [ebp-74], 8002 ; |
004022FF . FF15 00104000 call dword ptr [<&MSVBVM60.__vbaVarTs>; \__vbaVarTstGt
00402305 . 8D4D DC lea ecx, dword ptr [ebp-24]
00402308 . 8BD8 mov ebx, eax ; 将EAX中的值传给EBX
0040230A . FF15 9C104000 call dword ptr [<&MSVBVM60.__vbaFreeO>; MSVBVM60.__vbaFreeObj
00402310 . 8B3D 0C104000 mov edi, dword ptr [<&MSVBVM60.__vba>; MSVBVM60.__vbaFreeVarList
00402316 . 8D4D BC lea ecx, dword ptr [ebp-44]
00402319 . 8D55 CC lea edx, dword ptr [ebp-34]
0040231C . 51 push ecx
0040231D . 52 push edx
0040231E . 6A 02 push 2
00402320 . FFD7 call edi ; <&MSVBVM60.__vbaFreeVarList>
00402322 . 83C4 0C add esp, 0C ; 将ESP的值+0C
00402325 . 66:85DB test bx, bx ; 检测EBX是否为空
00402328 . 74 45 je short 0040236F ; 不跳就完蛋
0040232A . 8B35 80104000 mov esi, dword ptr [<&MSVBVM60.__vba>; MSVBVM60.__vbaVarDup
00402330 . B9 04000280 mov ecx, 80020004
00402335 . 894D A4 mov dword ptr [ebp-5C], ecx
00402338 . B8 0A000000 mov eax, 0A
0040233D . 894D B4 mov dword ptr [ebp-4C], ecx
00402340 . BB 08000000 mov ebx, 8
00402345 . 8D95 7CFFFFFF lea edx, dword ptr [ebp-84]
0040234B . 8D4D BC lea ecx, dword ptr [ebp-44]
0040234E . 8945 9C mov dword ptr [ebp-64], eax
00402351 . 8945 AC mov dword ptr [ebp-54], eax
00402354 . C745 84 101C4>mov dword ptr [ebp-7C], 00401C10 ; 请输入0-9的数字
0040235B . 899D 7CFFFFFF mov dword ptr [ebp-84], ebx
00402361 . FFD6 call esi ; <&MSVBVM60.__vbaVarDup>
00402363 . C745 94 F81B4>mov dword ptr [ebp-6C], 00401BF8
0040236A . E9 FF000000 jmp 0040246E
0040236F > 8B16 mov edx, dword ptr [esi]
00402371 . 56 push esi
00402372 . FF92 04030000 call dword ptr [edx+304]
00402378 . 50 push eax ; /Arg2
00402379 . 8D45 DC lea eax, dword ptr [ebp-24] ; |
0040237C . 50 push eax ; |Arg1
0040237D . FF15 20104000 call dword ptr [<&MSVBVM60.__vbaObjSe>; \__vbaObjSet
00402383 . 8BF0 mov esi, eax
00402385 . 8D55 E0 lea edx, dword ptr [ebp-20]
00402388 . 52 push edx
00402389 . 56 push esi
0040238A . 8B0E mov ecx, dword ptr [esi]
0040238C . FF91 A0000000 call dword ptr [ecx+A0]
00402392 . 85C0 test eax, eax
00402394 . DBE2 fclex
00402396 . 7D 12 jge short 004023AA
00402398 . 68 A0000000 push 0A0 ; /Arg4 = 000000A0
0040239D . 68 E41B4000 push 00401BE4 ; |Arg3 = 00401BE4
004023A2 . 56 push esi ; |Arg2
004023A3 . 50 push eax ; |Arg1
004023A4 . FF15 18104000 call dword ptr [<&MSVBVM60.__vbaHresu>; \__vbaHresultCheckObj
004023AA > 8B45 E0 mov eax, dword ptr [ebp-20] ; 假码放入EAX
004023AD . 50 push eax ; /Arg1
004023AE . FF15 88104000 call dword ptr [<&MSVBVM60.__vbaUI1St>; \__vbaUI1Str
004023B4 . 8D4D E0 lea ecx, dword ptr [ebp-20]
004023B7 . 8AD8 mov bl, al ; 将EAX中的数传给EBX
004023B9 . FF15 A0104000 call dword ptr [<&MSVBVM60.__vbaFreeS>; MSVBVM60.__vbaFreeStr
004023BF . 8D4D DC lea ecx, dword ptr [ebp-24]
004023C2 . FF15 9C104000 call dword ptr [<&MSVBVM60.__vbaFreeO>; MSVBVM60.__vbaFreeObj
004023C8 . 8A45 E8 mov al, byte ptr [ebp-18] ; 将0C放入EAX
004023CB . B9 04000280 mov ecx, 80020004 ; 将80020004传给ECX
004023D0 . 3AD8 cmp bl, al ; 比较EAX和ECX 0C转换为十进制为12,也就是说真正的注册码为12
004023D2 . B8 0A000000 mov eax, 0A ; 将0A传给EAX
004023D7 . 894D A4 mov dword ptr [ebp-5C], ecx ; 将ECX的值写入堆栈
004023DA . 8945 9C mov dword ptr [ebp-64], eax ; 将EAX的值写入堆栈
004023DD . 894D B4 mov dword ptr [ebp-4C], ecx ; 将ECX的值写入堆栈
004023E0 . 8945 AC mov dword ptr [ebp-54], eax ; 将EAX的值写入堆栈
004023E3 . 75 5F jnz short 00402444 ; 要暴破的话就将这里NOP掉
004023E5 . 8B35 80104000 mov esi, dword ptr [<&MSVBVM60.__vba>; MSVBVM60.__vbaVarDup
004023EB . BB 08000000 mov ebx, 8
004023F0 . 8D95 7CFFFFFF lea edx, dword ptr [ebp-84]
004023F6 . 8D4D BC lea ecx, dword ptr [ebp-44]
004023F9 . C745 84 301C4>mov dword ptr [ebp-7C], 00401C30 ; 正确,你真行
00402400 . 899D 7CFFFFFF mov dword ptr [ebp-84], ebx
00402406 . FFD6 call esi ; <&MSVBVM60.__vbaVarDup>
00402408 . 8D55 8C lea edx, dword ptr [ebp-74]
0040240B . 8D4D CC lea ecx, dword ptr [ebp-34]
0040240E . C745 94 1C1C4>mov dword ptr [ebp-6C], 00401C1C
00402415 . 895D 8C mov dword ptr [ebp-74], ebx
00402418 . FFD6 call esi
0040241A . 8D4D 9C lea ecx, dword ptr [ebp-64]
0040241D . 8D55 AC lea edx, dword ptr [ebp-54]
00402420 . 51 push ecx
00402421 . 8D45 BC lea eax, dword ptr [ebp-44]
00402424 . 52 push edx
00402425 . 50 push eax
00402426 . 8D4D CC lea ecx, dword ptr [ebp-34]
00402429 . 6A 40 push 40 ; /Arg2 = 00000040
0040242B . 51 push ecx ; |Arg1
0040242C . FF15 24104000 call dword ptr [<&MSVBVM60.#595>] ; \rtcMsgBox
00402432 . 8D55 9C lea edx, dword ptr [ebp-64] ; (initial cpu selection)
00402435 . 8D45 AC lea eax, dword ptr [ebp-54]
00402438 . 52 push edx
00402439 . 8D4D BC lea ecx, dword ptr [ebp-44]
0040243C . 50 push eax
0040243D . 8D55 CC lea edx, dword ptr [ebp-34]
00402440 . 51 push ecx
00402441 . 52 push edx
00402442 . EB 5D jmp short 004024A1
00402444 > 8B35 80104000 mov esi, dword ptr [<&MSVBVM60.__vba>; MSVBVM60.__vbaVarDup
0040244A . BB 08000000 mov ebx, 8
0040244F . 8D95 7CFFFFFF lea edx, dword ptr [ebp-84]
00402455 . 8D4D BC lea ecx, dword ptr [ebp-44]
00402458 . C745 84 101C4>mov dword ptr [ebp-7C], 00401C10 ; 序列号不正确(下bp rtcMsgBox也可以断住消息框)
0040245F . 899D 7CFFFFFF mov dword ptr [ebp-84], ebx
00402465 . FFD6 call esi ; <&MSVBVM60.__vbaVarDup>
00402467 . C745 94 3C1C4>mov dword ptr [ebp-6C], 00401C3C
0040246E > 8D55 8C lea edx, dword ptr [ebp-74]
00402471 . 8D4D CC lea ecx, dword ptr [ebp-34]
00402474 . 895D 8C mov dword ptr [ebp-74], ebx
00402477 . FFD6 call esi
00402479 . 8D45 9C lea eax, dword ptr [ebp-64]
0040247C . 8D4D AC lea ecx, dword ptr [ebp-54]
0040247F . 50 push eax
00402480 . 8D55 BC lea edx, dword ptr [ebp-44]
00402483 . 51 push ecx
00402484 . 52 push edx
00402485 . 8D45 CC lea eax, dword ptr [ebp-34]
00402488 . 6A 40 push 40 ; /Arg2 = 00000040
0040248A . 50 push eax ; |Arg1
0040248B . FF15 24104000 call dword ptr [<&MSVBVM60.#595>] ; \rtcMsgBox
00402491 . 8D4D 9C lea ecx, dword ptr [ebp-64]
00402494 . 8D55 AC lea edx, dword ptr [ebp-54]
00402497 . 51 push ecx
00402498 . 8D45 BC lea eax, dword ptr [ebp-44]
0040249B . 52 push edx
0040249C . 8D4D CC lea ecx, dword ptr [ebp-34]
0040249F . 50 push eax
004024A0 . 51 push ecx
004024A1 > 6A 04 push 4
004024A3 . FFD7 call edi
004024A5 . 83C4 14 add esp, 14
004024A8 . C745 FC 00000>mov dword ptr [ebp-4], 0
004024AF . 68 E5244000 push 004024E5
004024B4 . EB 2E jmp short 004024E4
004024B6 . 8D4D E0 lea ecx, dword ptr [ebp-20]
004024B9 . FF15 A0104000 call dword ptr [<&MSVBVM60.__vbaFreeS>; MSVBVM60.__vbaFreeStr
004024BF . 8D4D DC lea ecx, dword ptr [ebp-24]
004024C2 . FF15 9C104000 call dword ptr [<&MSVBVM60.__vbaFreeO>; MSVBVM60.__vbaFreeObj
004024C8 . 8D55 9C lea edx, dword ptr [ebp-64]
004024CB . 8D45 AC lea eax, dword ptr [ebp-54]
004024CE . 52 push edx
004024CF . 8D4D BC lea ecx, dword ptr [ebp-44]
004024D2 . 50 push eax
004024D3 . 8D55 CC lea edx, dword ptr [ebp-34]
004024D6 . 51 push ecx
004024D7 . 52 push edx
004024D8 . 6A 04 push 4
004024DA . FF15 0C104000 call dword ptr [<&MSVBVM60.__vbaFreeV>; MSVBVM60.__vbaFreeVarList
004024E0 . 83C4 14 add esp, 14
004024E3 . C3 retn
重点讲解
004023D0 . 3AD8 cmp bl, al ; 比较EAX和ECX 0C转换为十进制为12,也就是说真正的注册码为12
al=0C (Form Feed) 这里就是真码的十六进制
bl=0A (Line Feed) 这里就是假码的十六进制
假设输入的假码是10,那么转换为十六进制后就是0A
我再用E语言写一个代码
.版本 2
.子程序 _按钮1_被单击
.局部变量 correct, 字节型
.局部变量 entered, 字节型
correct = 12
entered = 到字节 (编辑框1.内容)
.如果 (correct = entered)
信息框 ("正确,你真行", 0, )
.否则
信息框 ("序列号不正确", 0, )
.如果结束
返回 ()
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!