Delphi中API函数动态调用

procedure TForm1.btn1Click(Sender: TObject);
type
   myMessagebox = function(hWnd:LongWord;
   lpText, lpCaption: string ;
   uType: LongWord): Integer; stdcall;
var j_h:LongWord;
    j_x:Pointer;
    j_mb:myMessagebox;
begin
   j_h := LoadLibrary('user32.dll');
  if j_h <> 0 then
  begin
     @j_mb:=GetProcAddress(j_h, 'MessageBoxA');
     j_mb(0,'动态调用','动态调用',0);
     FreeLibrary(j_h);
  end;

end;

 

posted on 2013-06-30 12:12  shellcode  阅读(400)  评论(0)    收藏  举报

导航