var
Gameh:hwnd;
//游戏窗口句柄
Gamepid:thandle;//游戏进程ID
Gameprocess:Thandle; //进程句柄
const
Gamecaption='Element Client';
Gamewodcalssname='QElementClient Window';
GameBaes=$a8ff08;
implementation
functionyxjz:integer;
//游戏基址
var
ptmp:integer;
byte:Dword;
begin
result:=0;
gameh:=findwindow(nil,gamecaption);
if gameh=0 then exit;
GetwindowThreadProcessID(gameh,gamepid);
gameprocess:=openProcess(windows.PROCESS_ALL_ACCESS,false,gamepid);
readprocessMemory(gameprocess,pointer(gamebaes+$1c),@ptmp,4,Byte);
readprocessMemory(gameprocess,pointer(gamebaes+$24),@ptmp,4,Byte);
result:=ptmp;
end;
function yxxz:integer;
//人物血值
var
base:integer;
ptmp:integer;
byte:Dword;
begin
result:=0;
base := yxjz;
Gameh:=findwindow(nil,GameCaption);
if gameh=0 then exit;
GetwindowThreadProcessID(gameh,gamepid);
gameprocess:=openProcess(windows.PROCESS_ALL_ACCESS,false,gamepid);
readprocessMemory(gameprocess,pointer(base+$260),@ptmp,4,Byte);
result:=ptmp;
end;
请高手,帮我看看,哪里出了问题,是否是权限问题,如果是的话,要怎么样改写代码才可以解决.
|