|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
大家好,现在遇到一个问题.
DLL已经注入到目标进程,已经检查过进程内可执行模块,有我注入的DLL
但是无法呼出DLL窗口,连 MessageBox()都无法出来
library DllGame;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
SysUtils,windows,
Classes;
{$R *.res}
var
keyhhk: HHOOK ;
Function add (a,b:integer):integer; //加法函数
begin
result:=a+b;
end;
Function keyproc(icode,wp,lp:integer):DWORD;stdcall; //键盘HOOK回调函数
begin
if (icode=HC_ACTION) then
begin
if (wp=VK_HOME)and ((1 shl 31)and lp=0) then MessageBox(0,'显示WG','显示WG',0);
end;
keyProc:=CallNextHookEx(keyhhk,icode,wp,lp);
end;
Function installKeyProc():boolean;stdcall;
var
h:HWND;
GameTid:THandle;
begin
Result:=false;
h:=FindWindow(nil,'The Return of Legend');
if h=0 then begin Messagebox(0,'未找到游戏','error',0);exit; end;//如果游戏未打开则退出
GameTid:=GetWindowThreadProcessId(h);
keyhhk:=SetWindowsHookEx(WH_KEYBOARD,@Keyproc,GetModuleHandle('DllGame.dll'),GameTid);
if keyhhk>0 then Result:=true;
end;
exports //导出函数
add,
installKeyProc;
哪位前辈给个例程,注入方式不管,只需要DLL部分,能在拦截键盘信息,呼出窗体就好
|
|