分析出值基址+偏移;
[[[[[95e800+1c]+24]+918]+14]+1c ] //角色物件基址
+3c //當前座標 x,h,y
+7c //當前座標 x,h,y
+25c //當前血值
+260 //當前魔力值
+274 //血值上限
+278 //
魔力值上限
+28c //防禦
//gamecaption='element client' //
遊戲視窗類名
='qelementclientwindow'
vargameh:hwnd; //
遊戲視窗控制代碼
gamepid:thandle; //
程序id
gamehprocess:thandle; //
程序控制代碼
gameh:=findwindow(nil,
遊戲標題);
getwindowthreadprocessid(gameh,gamepid);
gamehprocess:=openprocess;
readprocessmemory(hprocess,pointer(sleepbase),@newspeed,5,readbyte);
// code
unit gamefunction;
inte***ce
uses
windows, messages, sysutils, variants, classes, graphics, controls, forms,
dialogs, stdctrls;
function getrolebase:integer; //其它要呼叫的函式 要前置
function getcurblood:integer;
vargameh:hwnd; //遊戲視窗控制代碼
gamepid:thandle; //程序id
gamehprocess:thandle; //程序控制代碼
const
gamecaption='element client';
gamewndclassname='qelementclient window';
gamebase =$95e800;
implementation
function getrolebase:integer;
varptmp:integer;
readbyte:dword;
begin
result:=0;
gameh:=findwindow(nil,gamecaption);
if gameh=0 then exit;
getwindowthreadprocessid(gameh,gamepid);
gamehprocess:=openprocess(windows.process_all_access,false,gamepid);
// [[[[[95e800+1c]+24]+918]+14]+1c ] //角色物件基址
readprocessmemory(gamehprocess,pointer(gamebase+$1c),@ptmp,4,readbyte);
readprocessmemory(gamehprocess,pointer(ptmp+$24),@ptmp,4,readbyte);
readprocessmemory(gamehprocess,pointer(ptmp+$918),@ptmp,4,readbyte);
readprocessmemory(gamehprocess,pointer(ptmp+$14),@ptmp,4,readbyte);
readprocessmemory(gamehprocess,pointer(ptmp+$1c),@ptmp,4,readbyte);
result:=ptmp;
end;
function getcurblood:integer;
varbase,ptmp:integer;
readbyte:dword;
begin
result:=0;
base:=getrolebase;
gameh:=findwindow(nil,gamecaption);
if gameh=0 then exit;
getwindowthreadprocessid(gameh,gamepid);
gamehprocess:=openprocess(windows.process_all_access,false,gamepid);
readprocessmemory(gamehprocess,pointer(base+$25c),@ptmp,4,readbyte);
result:=ptmp;
end;
end.
Unity 角色血條
單機雙人遊戲中,一方角色受到攻擊,血條遞減,當其中一方的血條為0時,進入第二關,同時兩人恢復滿血。首先新增乙個bar,然後設定自己想要的樣式,fill area是血條原有的顏色,handle slide area是掉血以後的顏色,效果在圖二。接下來在你的控制角色的class裡新增剛開局的時候大家都是...
NGUI血條製作及血條跟隨角色目標
首先建2個sprite乙個做背景乙個做前景 給背景新增乙個指令碼如圖progress bar script。然後拖到對應的位置。然後就就ok了。接下來就開始設定目標跟隨。首先建立乙個cube作為被跟隨目標,然後給bg加乙個follow target指令碼 此指令碼在hudtext外掛程式裡,要安裝這...
unity 使用NGUI 顯示角色血條和名字
先說一下好處和原理 如果用unity自帶的gui處理,需要在ongui 中每個迴圈呼叫gui.begingroup gui.drawtexture textfilter.drawoutline 之類的 有很高的記憶體開銷。ngui 不只是僅僅用於拼接ui,這裡主要是去掉ngui上的uicamera,...