下面是我用Ollydbg1.10中文版调试一个需要光盘的考试系统时,出现的问题,请大家看看这些怪事,很奇怪...
004027F4 H> $ 68 70294000 push HYExam.00402970 ;程序的运行起点
004027F9 E8 F0FFFFFF call <jmp.&MSVBVM60.#100> ;这是调用什么?好像是调用VB的初始化信息,对吗?
.
.
.
77F3526B 8B1C24 mov ebx,dword ptr ss:[esp] ;然后到了这里
77F3526E 51 push ecx
77F3526F 53 push ebx
77F35270 E8 BE380200 call ntdll.77F58B33 ;这个函数会弹出光盘,并提示一个模式对话框:请插入光盘(下面列有这个函数的代码)
77F35275 0AC0 or al,al ;如果不放光盘的话,永远也到不了这里.我在这设了断点,一直到不了
77F35277 74 0C je short ntdll.77F35285
77F35279 5B pop ebx
77F3527A 59 pop ecx
77F3527B 6A 00 push 0
77F3527D 51 push ecx ; fghfg
77F3527E E8 D0FFFFFF call ntdll.ZwContinue ;依我看,真正弹出光盘的代码在这里面
77F35283 EB 0B jmp short ntdll.77F35290
77F35285 5B pop ebx
77F35286 59 pop ecx
77F35287 6A 00 push 0
77F35289 51 push ecx
77F3528A 53 push ebx
77F3528B E8 EA000000 call ntdll.ZwRaiseException
77F35290 83C4 EC add esp,-14
77F35293 890424 mov dword ptr ss:[esp],eax
77F35296 C74424 04 01000000 mov dword ptr ss:[esp+4],1
77F3529E 895C24 08 mov dword ptr ss:[esp+8],ebx
77F352A2 C74424 10 00000000 mov dword ptr ss:[esp+10],0
77F352AA 54 push esp
77F352AB E8 08000000 call ntdll.RtlRaiseException
77F352B0 C2 0800 retn 8
ntdll.77F58B33 子函数的代码如下:
77F58B33 55 push ebp
77F58B34 8BEC mov ebp,esp
77F58B36 83EC 60 sub esp,60
77F58B39 56 push esi
77F58B3A FF75 0C push dword ptr ss:[ebp+C]
77F58B3D 8B75 08 mov esi,dword ptr ss:[ebp+8]
77F58B40 56 push esi
77F58B41 E8 ED000000 call ntdll.77F58C33
77F58B46 84C0 test al,al
77F58B48 ^ 0F85 23FFFFFF jnz ntdll.77F58A71
77F58B4E 53 push ebx
77F58B4F 57 push edi
77F58B50 8D45 F8 lea eax,dword ptr ss:[ebp-8]
77F58B53 50 push eax
77F58B54 8D45 FC lea eax,dword ptr ss:[ebp-4]
77F58B57 50 push eax
77F58B58 E8 9FFFFFFF call ntdll.77F58AFC
77F58B5D E8 BAFFFFFF call ntdll.77F58B1C
77F58B62 8365 08 00 and dword ptr ss:[ebp+8],0
77F58B66 8BD8 mov ebx,eax
77F58B68 83FB FF cmp ebx,-1
77F58B6B ^ 74 BA je short ntdll.77F58B27
77F58B6D 3B5D FC cmp ebx,dword ptr ss:[ebp-4]
77F58B70 ^ 72 B1 jb short ntdll.77F58B23
77F58B72 8D43 08 lea eax,dword ptr ds:[ebx+8]
77F58B75 3B45 F8 cmp eax,dword ptr ss:[ebp-8]
77F58B78 ^ 77 A9 ja short ntdll.77F58B23
77F58B7A F6C3 03 test bl,3
77F58B7D ^ 75 A4 jnz short ntdll.77F58B23
77F58B7F 8B43 04 mov eax,dword ptr ds:[ebx+4]
77F58B82 3B45 FC cmp eax,dword ptr ss:[ebp-4]
77F58B85 72 05 jb short ntdll.77F58B8C
77F58B87 3B45 F8 cmp eax,dword ptr ss:[ebp-8]
77F58B8A ^ 72 97 jb short ntdll.77F58B23
77F58B8C 50 push eax
77F58B8D E8 BDFDFFFF call ntdll.77F5894F
77F58B92 84C0 test al,al
77F58B94 ^ 74 8D je short ntdll.77F58B23
77F58B96 F605 2E31FB77 80 test byte ptr ds:[77FB312E],80
77F58B9D ^ 0F85 D5FEFFFF jnz ntdll.77F58A78
77F58BA3 FF73 04 push dword ptr ds:[ebx+4]
77F58BA6 8D45 F0 lea eax,dword ptr ss:[ebp-10]
77F58BA9 50 push eax
77F58BAA FF75 0C push dword ptr ss:[ebp+C]
77F58BAD 53 push ebx
77F58BAE 56 push esi
77F58BAF E8 E8000000 call ntdll.77F58C9C ;到这里弹出光盘,下面同样列有这个函数的代码,不过这里有个怪事,如果我按F8,则会弹出光盘,
77F58BB4 F605 2E31FB77 80 test byte ptr ds:[77FB312E],80 ;如果上面的函数用F7跟进去,则不弹出光盘,并在返回到这句时,上面那句代码变为:call ntdll.77F58F8C,上面明明是call ntdll.77F58C9C,为什么会变呢?
77F58BBB 8BF8 mov edi,eax
77F58BBD ^ 0F85 CBFEFFFF jnz ntdll.77F58A8E
77F58BC3 395D 08 cmp dword ptr ss:[ebp+8],ebx
77F58BC6 ^ 0F84 D0FEFFFF je ntdll.77F58A9C
77F58BCC 8BC7 mov eax,edi
77F58BCE 33C9 xor ecx,ecx
77F58BD0 2BC1 sub eax,ecx
77F58BD2 75 13 jnz short ntdll.77F58BE7
77F58BD4 F646 04 01 test byte ptr ds:[esi+4],1
77F58BD8 ^ 0F85 CBFEFFFF jnz ntdll.77F58AA9
77F58BDE B0 01 mov al,1
77F58BE0 5F pop edi
77F58BE1 5B pop ebx
77F58BE2 5E pop esi
77F58BE3 C9 leave
77F58BE4 C2 0800 retn 8
按F7跟进来的代码如下,ntdll.77F58C9C
77F58C9C BA D08AF577 mov edx,ntdll.77F58AD0
77F58CA1 53 push ebx
77F58CA2 56 push esi
77F58CA3 57 push edi
77F58CA4 33C0 xor eax,eax
77F58CA6 33DB xor ebx,ebx
77F58CA8 33F6 xor esi,esi
77F58CAA 33FF xor edi,edi
77F58CAC FF7424 20 push dword ptr ss:[esp+20]
77F58CB0 FF7424 20 push dword ptr ss:[esp+20]
77F58CB4 FF7424 20 push dword ptr ss:[esp+20]
77F58CB8 FF7424 20 push dword ptr ss:[esp+20]
77F58CBC FF7424 20 push dword ptr ss:[esp+20]
77F58CC0 E8 0B000000 call ntdll.77F58CD0
77F58CC5 5F pop edi
77F58CC6 5E pop esi
77F58CC7 5B pop ebx
77F58CC8 C2 1400 retn 14
大家能看出是什么原因吗?为什么在虚拟地址里的指令,会改变呢?
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)