unit wl_main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinData, BusinessSkinForm, ComCtrls, bsSkinTabs, ExtCtrls,
bsSkinCtrls, StdCtrls,getgamepro, Gauges;
procedure sitcall;
type
TForm1 = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
bskndt1: TbsSkinData;
bscmprsdstrdsknskin: TbsCompressedStoredSkin;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
bsSkinTabSheet2: TbsSkinTabSheet;
bsSkinBevel1: TbsSkinBevel;
bsSkinPanel1: TbsSkinPanel;
bskng1: TbsSkinGauge;
bskng2: TbsSkinGauge;
bskng3: TbsSkinGauge;
bskng4: TbsSkinGauge;
tmr1: TTimer;
btn1: TButton;
procedure btn1Click(Sender: TObject);
procedure tmr1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure sitcall;
begin
asm
mov eax,006a5e10h
call eax
end;
end;
procedure TForm1.btn1Click(Sender: TObject);
var
gh:HWND;
gid,gpro:THandle;
calladdr:Pointer;
tt:DWORD;
begin
gh:=FindWindow(nil,'Element Client');
if gh > 0 then
begin
GetWindowThreadProcessId(gh,@gid);
gpro:=OpenProcess(PROCESS_ALL_ACCESS,False,gid);
calladdr:=VirtualAllocEx(gpro,nil,windows.MAX_PATH,windows.MEM_COMMIT OR windows.MEM_RESERVE,windows.PAGE_EXECUTE_READWRITE);
//写入代码
WriteProcessMemory(gpro,calladdr,@sitcall,MAX_PATH,tt);
CreateRemoteThread(gpro,nil,0,calladdr,nil,0,tt);
end;
end;
procedure TForm1.tmr1Timer(Sender: TObject);
var
gameh:HWND;
gameprocesspid,gameprocess:THandle;
Hp,MaxHp,Mp,MaxMp:DWORD;
i:DWORD;
tt,i1:DWord;
begin
hp:=0;
Mp:=0;
maxhp:=0;
MaxMp:=0;
gameprocess:=gamepro;
ReadProcessMemory(gameprocess,Pointer($B9F64C ),@i1,4,tt);
ReadProcessMemory(gameprocess,Pointer(i1 + $28),@i,4,tt);
ReadProcessMemory(gameprocess,Pointer(i + $264),@hp,2,tt);
ReadProcessMemory(gameprocess,Pointer(i + $268),@mp,2,tt);
ReadProcessMemory(gameprocess,Pointer(i + $280),@maxhp,2,tt);
ReadProcessMemory(gameprocess,Pointer(i + $284),@MaxMp,2,tt);
//ShowMessage(IntToStr(tt));
Self.bskng3.MaxValue:=MaxHp; //体力
Self.bskng3.Value:=hp ; //体力
Self.bskng3.ProgressTransparentColor:=clRed;
self.bskng4.MaxValue:=MaxMp;
Self.bskng4.Value:=Mp;
/////////
end;
end.
之前乱写的!