boredtc How do I cheat?
Reputation: 0
Joined: 04 Dec 2010 Posts: 7
|
Posted: Sat Aug 06, 2011 9:04 am Post subject: Pointer reading in Delphi |
|
|
Hi all,
I´m working on a new Delphi project in pointer reading.
But my code always returns a zero value as Result.
Maybe i´m missing something...
I´ve tried it on several games.
Any help would be appriciated.
my code;
| Code: | var
Form1: TForm1;
BytesRead : Cardinal;
myVar : Cardinal;
EndVar : Cardinal; //it could be anything byte, cardinal etc..
myHandle : Integer;
PID : integer;
Result : Integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
myHandle := FindWindow(nil, 'GameName');
if myHandle = 0 then
begin
MessageDlg ('The game is not loaded in memory, try again...', mtwarning,[mbOK],0);
end;
PID := GetWindowThreadProcessId(myHandle, @PID);
myHandle := OpenProcess (PROCESS_ALL_ACCESS, False, PID);
If PID <> 0 Then
ReadProcessMemory(myHandle, Ptr($3D7C4C4), @myVar, SizeOf(myVar), BytesRead);
ReadProcessMemory(myHandle, Ptr(myVar + $3B8), @myVar, SizeOf(myVar), BytesRead);
ReadProcessMemory(myHandle, Ptr(myVar + $120), @myVar, SizeOf(myVar), BytesRead);
ReadProcessMemory(myHandle, Ptr(myVar + $7C), @myVar, SizeOf(myVar), BytesRead);
ReadProcessMemory(myHandle, Ptr(myVar + $14), @myVar, SizeOf(myVar), BytesRead);
ReadProcessMemory(myHandle, Ptr(myVar + $268), @myVar, SizeOf(myVar), BytesRead);
ReadProcessMemory(myHandle, Ptr(myVar), @EndVar, SizeOf(EndVar), BytesRead);
Result := EndVar;
end;
end. |
|
|