LEAF SOLUTIONS

Leaf API Hook solution Borland delphi component

  •  Download version 1.1 (demo included) : download
  •  Support :  

How to use Leaf API Hook solution

  • License : free for non-commercial softwares
  • When hooking an API, we need to write some kind of hook callback function and original API function variable
var
  MessageBoxANext  : function (hWnd: HWND; lpText,    lpCaption: PAnsiChar; uType: UINT): Integer; stdcall;

function MessageBoxACallback(hWnd: HWND; lpText, lpCaption: PAnsiChar; uType: UINT): Integer; stdcall;
begin
  Result := MessageBoxANext(hWnd, lpText, 'Message From Dll', uType);
end;
  • Put all of code in a dll for global API hook like this
procedure DllMain(dwReason: DWORD);
begin
 case dwReason of
   DLL_PROCESS_ATTACH: begin
                           HookAPI('user32.dll', 'MessageBoxA',
                             @MessageBoxACallback,       @MessageBoxANext);

                       end;
   DLL_PROCESS_DETACH: begin
                           UnHookAPI('user32.dll', 'MessageBoxA',
                             @MessageBoxANext);
                         end;
 end;
end;

begin
 DllProc := @DllMain;
 DllMain(DLL_PROCESS_ATTACH);
end.
  • We need inject this dll into another process by calling function ProcessInjectLibrary
function ProcessInjectLibrary(PID: DWORD; lpszLibName: PAnsiChar): Boolean;stdcall;

  • For more information please check my demo that is included

My avarta


About author

Nam, 20 tuổi 60 tháng.Ngoại hình già, xấu, đú bẩn, nhưng mỏng manh dễ vỡ, sống nội tâm .Yêu màu tím thủy chung, ghét màu hồng giả dối.Mong được làm quen với tất cả các bạn trên mọi miền tổ quốc, hehe

Facebook

http://www.facebook.com/cuchuoi

Email

thelastleaf.mp@gmail.com

Free blog counters