- 注册时间
- 2011-3-6
- 最后登录
- 1970-1-1
该用户从未签到
|
var
Form1: TForm1;
Gameh:hwnd; //游戏窗口句柄
Gamepid:Thandle; //进程ID
GamehProcess:Thandle; //进程句柄
const
Gameyouxibiaot ='绿色征途 — 神话一区';
Gameyouxileiming='bewodrtkdotwqnvm';
Gamejizhi =$aa6590;
implementation
{$R *.dfm}
function GetRoleBase:integer;
var
ptmp:integer;
readByte:dword;
begin
result:=0;
Gameh:=Findwindow(nil,Gameyouxibiaot);
if Gameh=0 then exit;
GetWindowThreadProcessID(Gameh,Gamepid);
Gamehprocess:=OpenProcess(windows.PROCESS_ALL_ACCESS,false,Gamepid);
ReadProcessMemory(GamehProcess,Pointer(Gamejizhi),@ptmp,4,readByte);
ReadProcessMemory(GamehProcess,Pointer(ptmp+$53c),@ptmp,4,readByte);
ReadProcessMemory(GamehProcess,Pointer(ptmp+$40),@ptmp,4,readByte);
result:=ptmp;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
self.edtcunBloob.Text:=intTostr(GetRoleBase);
窗口标题是用SPY++获得的,用句柄查看精灵修改窗口标题,可以读出游戏角色血值。
用游戏类名也可以读出游戏角色血值
我刚学Delphi,是仿照 郁金香教程 写的,
是不是游戏窗口标题太长了,所以读不到啊?
还有什么方法可以获取到游戏呢?
请各位高手帮帮忙。 |
|