I have a short question, I hope you guys have an answer for me
I have this sourcecode (delphi) :
Code:
Function GetMaxHP : Integer; var WndHandle, Pid, Pidhandle : integer; Written: Cardinal; begin WndHandle := FindWindow(nil,Pchar(Wintitle)); GetWindowThreadProcessId(WndHandle,@Pid); Pidhandle := OpenProcess(PROCESS_ALL_ACCESS,False,Pid); ReadProcessMemory(Pidhandle, ptr(BaseAddr), @MaxHPPointer, Data, written); MaxHPPointer := MaxHPPointer +$032; ReadProcessMemory(Pidhandle, ptr(MaxHPPointer), @MaxHPPointer2, Data, written); MaxHPPointer2 := MaxHPPointer2 + [B]maxhpoffset[/B]; ReadProcessMemory(Pidhandle, ptr(MaxHPPointer2), @MaxHP, Data, written); closehandle(Pidhandle); Result := MaxHP; end;
Code:
Function GetMaxHP : Integer; var WndHandle, Pid, Pidhandle : integer; Written: Cardinal; begin WndHandle := FindWindow(nil,Pchar(Wintitle)); GetWindowThreadProcessId(WndHandle,@Pid); Pidhandle := OpenProcess(PROCESS_ALL_ACCESS,False,Pid); ReadProcessMemory(Pidhandle, ptr(BaseAddr), @MaxHPPointer, Data, written); MaxHPPointer := MaxHPPointer +$032; ReadProcessMemory(Pidhandle, ptr(MaxHPPointer), @MaxHPPointer2, Data, written); MaxHPPointer2 := MaxHPPointer2 + [B]$33C[/B]; ReadProcessMemory(Pidhandle, ptr(MaxHPPointer2), @MaxHP, Data, written); closehandle(Pidhandle); Result := MaxHP; end;
I tried
MaxHPPointer2 := MaxHPPointer2 + strtoint(maxhpoffset);
maxhpoffset was a string , containing $33C, but strtoint converted it to a decimal address without the ''$'' at the beginning of the offset, which I need to be able to add the offsets.
Any Ideas how I can load maxhpoffset out of a string?






