unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
Var WindowName : integer;
ProcessId : integer;
ThreadId : integer;
buf : PChar;
HandleWindow : Integer;
write : cardinal;
Edit1Text : Integer;
Const WindowTitle = '
3D-Pinball für Windows - Space Cadet';
Address = $C0AEBA;
Address2 = $A93C9C;
//Edit1Text = $32;
NumberOfBytes = 1;
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(('
Edit1Text decimal = ''
$' +IntToHex(Edit1Text, 1));
//Hier ist die Stelle wo ich den Wert aus der Edit Box als Hex einfügen möchte
WriteProcessMemory(HandleWindow,ptr(Address),buf,NumberOfBytes,
write);
FreeMem(buf);
closehandle(HandleWindow);
end;
end.