Delphi中异常捕获的简单应用

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    btn1: TButton;
    procedure getdeugbtn(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.getdeugbtn(Sender: TObject);
begin
  try
   asm
     xor eax,eax
     mov dword ptr[eax],0
   end
   except
   MessageBoxa(0,'错误到我这里来了','Sellcode',0);
   Exit;
   end;
end;

end.

 

posted on 2013-06-17 21:53  shellcode  阅读(432)  评论(0编辑  收藏  举报

导航