先看代码function ExceptionProc(pExcept:PExceptionRecord;
pFrame:Pointer;
pContxt:PContext;
pDispatcher:Pointer):Integer;stdcall;
begin
ShowMessage('1111'); Result:=0;
end;
procedure TForm1.Button1Click(Sender: TObject);
asm
//try push ebp
push offset ExceptionProc
push fs:[0]
mov fs:[0],esp xor edx,edx
mov [edx],1 pop dword ptr fs:[0]
add esp,4
pop ebp
end;
异常能捕获到了,但是一直弹出对话框呀.希望有朋友能帮我讲解下,貌似有人说把pContext指向下一个.但是不是很明白希望大牛指导.
附上Delphi自己的trye的代码
Unit1.pas.39: Try
00452704 33D2 xor edx,edx
00452706 55 push ebp
00452707 6821274500 push $00452721
0045270C 64FF32 push dword ptr fs:[edx]
0045270F 648922 mov fs:[edx],esp Unit1.pas.40: a.Show;
00452712 E811B3FFFF call TCustomForm.Show
00452717 33C0 xor eax,eax
00452719 5A pop edx
0045271A 59 pop ecx
0045271B 59 pop ecx
0045271C 648910 mov fs:[eax],edx
0045271F EB14 jmp +$14
00452721 E91E12FBFF jmp @HandleAnyException Unit1.pas.42: ShowMessage( '1111' );
00452726 B844274500 mov eax,$00452744
0045272B E85C8DFDFF call ShowMessage
00452730 E87715FBFF call @DoneExcept Unit1.pas.44: End;
希望有人共同探讨下,谢谢了.
pFrame:Pointer;
pContxt:PContext;
pDispatcher:Pointer):Integer;stdcall;
begin
ShowMessage('1111'); Result:=0;
end;
procedure TForm1.Button1Click(Sender: TObject);
asm
//try push ebp
push offset ExceptionProc
push fs:[0]
mov fs:[0],esp xor edx,edx
mov [edx],1 pop dword ptr fs:[0]
add esp,4
pop ebp
end;
异常能捕获到了,但是一直弹出对话框呀.希望有朋友能帮我讲解下,貌似有人说把pContext指向下一个.但是不是很明白希望大牛指导.
附上Delphi自己的trye的代码
Unit1.pas.39: Try
00452704 33D2 xor edx,edx
00452706 55 push ebp
00452707 6821274500 push $00452721
0045270C 64FF32 push dword ptr fs:[edx]
0045270F 648922 mov fs:[edx],esp Unit1.pas.40: a.Show;
00452712 E811B3FFFF call TCustomForm.Show
00452717 33C0 xor eax,eax
00452719 5A pop edx
0045271A 59 pop ecx
0045271B 59 pop ecx
0045271C 648910 mov fs:[eax],edx
0045271F EB14 jmp +$14
00452721 E91E12FBFF jmp @HandleAnyException Unit1.pas.42: ShowMessage( '1111' );
00452726 B844274500 mov eax,$00452744
0045272B E85C8DFDFF call ShowMessage
00452730 E87715FBFF call @DoneExcept Unit1.pas.44: End;
希望有人共同探讨下,谢谢了.
http://blog.csdn.net/hero_yin/archive/2008/01/28/2069916.aspx
谢谢兄台.
华科生活如何?