thstrrthtrh Cheater
Reputation: 0
Joined: 08 Sep 2008 Posts: 49
|
Posted: Sun Nov 30, 2008 8:07 pm Post subject: Delphi Game Trainer Help |
|
|
I know there are other posts out there like this but none of them seem to work for me.
=-=
I am trying to make a standalone trainer and I am just testing if I can make one for pinball...
here is my code that I got from some site.
Code: | unit a;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ShellApi;
type
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
WindowName : integer;
ProcessId : integer;
ThreadId : integer;
buf : PChar;
HandleWindow : Integer;
write : cardinal;
Const WindowTitle = '3D Pinball for Windows - Space Cadet';
Address = $00A80C62;
PokeValue = $00003039;
NumberOfBytes = 4;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
//
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
WindowName := FindWindow(nil,WindowTitle);
If WindowName = 0 then
begin
MessageDlg('The game must be running in the background.Run it now, and then try again.', mtwarning,[mbOK],0);
end;
ThreadId := GetWindowThreadProcessId(WindowName,@ProcessId);
HandleWindow := OpenProcess(PROCESS_ALL_ACCESS,False,ProcessId);
GetMem(buf,1);
buf^ := Chr(PokeValue);
WriteProcessMemory(HandleWindow,ptr(Address),buf,NumberOfBytes,write);
FreeMem(buf);
closehandle(HandleWindow);
end;
end. |
but when I run it it does not change the value that I can tell.
I just need to know if there is a better way to do it.
|
|