我已经找到过了……
453818处的CALL如果不猜测的话有谁能知道应该是跳往这里呢?只能试验,看里面有user32.dll的动态加载,估计应该是这里……
00453839 . 55 PUSH EBP
0045383A . 68 E4384500 PUSH <Project1.loc_4538E4>
0045383F . 64:FF30 PUSH DWORD PTR FS:[EAX]
00453842 . 64:8920 MOV DWORD PTR FS:[EAX],ESP
00453845 . 8D45 EC LEA EAX,DWORD PTR SS:[EBP-14] ; [ebp-14]->pCode
00453848 . 8B93 140300>MOV EDX,DWORD PTR DS:[EBX+314]
0045384E . E8 9106FBFF CALL <Project1.System::__linkproc__ LStr>
00453853 . 8D45 F0 LEA EAX,DWORD PTR SS:[EBP-10] ; [ebp-10]->正确提示
00453856 . 8B93 100300>MOV EDX,DWORD PTR DS:[EBX+310]
0045385C . E8 8306FBFF CALL <Project1.System::__linkproc__ LStr>
00453861 . 8D45 E8 LEA EAX,DWORD PTR SS:[EBP-18] ; [ebp-18]->Left(code, 5)
00453864 . 50 PUSH EAX ; user32.77D10000
00453865 . B9 05000000 MOV ECX,5
0045386A . BA 01000000 MOV EDX,1
0045386F . 8B45 EC MOV EAX,DWORD PTR SS:[EBP-14]
00453872 . E8 F50AFBFF CALL <Project1.System::__linkproc__ LStr>; 从开始处复制5个字符
00453877 . FF75 E8 PUSH DWORD PTR SS:[EBP-18] ; push [ebp-18]->Left(code, 5)
0045387A . 68 38394500 PUSH Project1.00453938 ; gebox
0045387F . 8D45 E4 LEA EAX,DWORD PTR SS:[EBP-1C]
00453882 . 50 PUSH EAX ; user32.77D10000
00453883 . B9 01000000 MOV ECX,1
00453888 . BA 0B000000 MOV EDX,0B
0045388D . 8B45 EC MOV EAX,DWORD PTR SS:[EBP-14]
00453890 . E8 D70AFBFF CALL <Project1.System::__linkproc__ LStr>; 从第11个字符复制1个字符
00453895 . FF75 E4 PUSH DWORD PTR SS:[EBP-1C] ; push Mid(code, 11, 1)
00453898 . 8D45 F8 LEA EAX,DWORD PTR SS:[EBP-8] ; eax=[ebp-8]->3个字串连接结果
0045389B . BA 03000000 MOV EDX,3 ; 连接字串的个数为3
004538A0 . E8 2709FBFF CALL <Project1.System::__linkproc__ LStr>; code前5字符与geBox,11字符起取的1字符相连接
004538A5 . 8D45 FC LEA EAX,DWORD PTR SS:[EBP-4]
004538A8 . BA 48394500 MOV EDX,Project1.00453948 ; user32.dll
004538AD . E8 3206FBFF CALL <Project1.System::__linkproc__ LStr>
004538B2 . 60 PUSHAD
004538B3 . 39F6 CMP ESI,ESI
004538B5 . 8B45 FC MOV EAX,DWORD PTR SS:[EBP-4] ; eax->[ebp-4]->"user32.dll"
004538B8 . 50 PUSH EAX ; /FileName = "MZ?
004538B9 . E8 E226FBFF CALL <Project1.LoadLibraryA_0> ; \LoadLibraryA
004538BE . 89C2 MOV EDX,EAX ; user32.77D10000
004538C0 . 8B45 F8 MOV EAX,DWORD PTR SS:[EBP-8] ; (initial cpu selection)
004538C3 . 50 PUSH EAX ; /ProcNameOrOrdinal = "MZ?
004538C4 . 52 PUSH EDX ; |hModule = 77D10000 (user32)
004538C5 . E8 3626FBFF CALL <Project1.GetProcAddress_0> ; \GetProcAddress
004538CA . 8945 F4 MOV DWORD PTR SS:[EBP-C],EAX ; user32.77D10000
如果username提供的跳转处不正确,就崩溃掉了,虽然安装有SEH……
code部分其实没有进行计算,直接复制了前5个字符与第11个字符起的1个字符,分别设为s0, s2。
中间有一个常数串"geBox"设为s1,那么要正确显示提示框就得
s0+s1+s2 == "MessageBoxA"
在这一部分的验证中用到的SEH如果没有获得正确地址会正常跳入SEH中去。
1、用户名:0x221 == sum(user)
2、密码:Messa?????A*(?代表1个字符,*代表任意字符)