S
sy0116
Unregistered / Unconfirmed
GUEST, unregistred user!
还是老三级跳的问题,用下面代码把中间DLL注入到指定进程中去之后发现总是跳出对话框标题为f,内容为空,而如果在SetHook过程中加上一句MessageBox(0,DllPath,'f',0);则可以正确显示路径,请问这种情况下只能用内存映像文件来传递数据了吗?<br><br>procedure Load;<br>var<br> LibHd:THandle;<br>begin<br> Jumped:=True;<br> LibHd:=LoadLibrary(DllPath);<br> RealDLL:=GetProcAddress(LibHd,'SetHook');<br> if @RealDLL<>nil then<br> RealDLL<br> else<br> begin<br> MessageBox(0,DllPath,'f',0);<br> FreeLibrary(LibHd);<br> end;<br>end;<br><br>function JumpProc(ncode:Integer;wparam:WPARAM;lparam:LPARAM):LRESULT;stdcall;<br>var<br> pid:Cardinal;<br>begin<br> if Jumped=False then<br> begin<br> ThreadHd:=CreateThread(nil,0,@Load,nil,0,pid);<br> Jumped:=True;<br> end;<br> Result:=CallNextHookEx(JumpHook,ncode,wparam,lparam);<br>end;<br><br>procedure SetHook(ExpIDWORD;PathChar);stdcall;<br>begin<br> DllPath:=PChar(Path+'key.dll');<br> JumpHook:=SetWindowsHookEx(WH_GETMESSAGE,@JumpProc,HInstance,ExpID);<br> //MessageBox(0,DllPath,'f',0);在这里显示正确<br> Jumped:=False;<br>end;