Hi Guys,
I got myself a little offset-test programme in Delphi which I have used in the past.
Today I started using it again, and I'm currently having the problem that player health returns a big 0.
I'm using memory offsets straight in the code.
I think the problem is either the descriptor offset (I used 0x4) or the player health offset (I used 0x12).
Anyone see the problem? (Btw, latest WoW version)
Known is that: PID/Baseaddress/CurMgrPre/CurMg/PlayerGuid/FirstObject/NextObject/ObjectGuid are correctly loaded from the process
My simple code:
Code:
lPID := StrToInt(edtPID.Text);
lBaseAddress := Integer(GetModuleBaseAddress(lPID,''));
lCurMgrPre := ReadInt32(lPID, lBaseAddress + $EBF608);
lCurMgr := ReadInt32(lPID, lCurMgrPre + $462C);
lPlayerGUID := ReadUInt64(lPID, lCurMgr + $E8);
lPlayerName := ReadString(lPID, lBaseAddress + $EBF648);
//FIRST OBJECT CHECK
lNextObject := ReadCardinal(lPid, lCurMgr + $CC); //$CC = First Object, $34 is Next Object
lObjectType := ReadShort(lPid, lNextObject + $C);
lObjectGUID := ReadUInt64(lPid, lNextObject + $28);
//READ FIRST OBJECT, CHECK IF OBJECT IS PLAYER AND IF OBJECT HAS SAME GUID AS YOUR CHAR
if (lObjectType = 4) and (lObjectGUID = lPlayerGUID) then //TRUE = PLAYER FOUND
begin
lDescriptor := ReadInt32(lPid, lNextObject + $4);
lObjectHealth := ReadInt32(lPid, lDescriptor + (($12 + $8)*4));
Memo.Lines.Add('HEALTH: ' + IntToSTr(lObjectHealth));
end;
//END FIRST OBJECT CHECK
//CHECK REST OF OBJECTS
while (lObjectType <= 7) AND (lObjectType > 0) do
begin
lNextObject := ReadCardinal(lPid, lNextObject + $34);
lObjectType := ReadShort(lPid, lNextObject + $C);
lObjectGUID := ReadUInt64(lPid, lNextObject + $28);
if (lObjectType = 4) and (lObjectGUID = lPlayerGUID) then //TRUE = PLAYER FOUND
begin
lDescriptor := ReadInt32(lPid, lNextObject + $4);
lObjectHealth := ReadInt32(lPid, lDescriptor + (($14 + $8)*4));
Memo.Lines.Add('HEALTH: ' + IntToSTr(lObjectHealth));
end;
end;
//END CHECK REST OF OBJECTS