unit unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
var
WindowName : integer;
ProcessId : integer;
ThreadId : integer;
buf : PChar;
HandleWindow : Integer;
write : cardinal;
Const WindowTitle = '
spiel';
//hier einfach den namen von unserm fenster eingeben! einfach spiel starten,
//dann alt+tab drücken und in der taskleiste einfach nachschaun welche caption
//unser programm hat und diese einfach einfügen.
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
const v1 = $E921040000;
begin
WindowName := FindWindow(
nil,WindowTitle);
If WindowName = 0
then MessageDlg('
...erst spiel starten...dann trainer starten =)', mtwarning,[mbOK],0);
ThreadId := GetWindowThreadProcessId(WindowName,@ProcessId);
HandleWindow := OpenProcess(PROCESS_ALL_ACCESS,False,ProcessId);
GetMem(buf,sizeof(Chr(v1)));
buf^ := Chr(v1);
WriteProcessMemory(HandleWindow,ptr($24000000 + $1D0851),buf,sizeof(buf),
write);
FreeMem(buf);
closehandle(HandleWindow);
end;
end.