This is an example on how to do it :
Quote:
function gethp: Integer;
var
Written: cardinal;
eax: cardinal;
begin
ReadProcessMemory(PWIHandle, ptr(BaseAddr), @eax, Data, Written);
ReadProcessMemory(PWIHandle, ptr(eax + Charstruct), @eax, Data, Written);
ReadProcessMemory(PWIHandle, ptr(eax + AtmHPoffset), @Result, Data, Written);
end;
|
Note eax isn't the register, its just a variable name I tend to use for temporary addresses.
Also note that this is an ineffective way; Structs would be far better.
Cheers