unit MainForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
Timer1: TTimer;
Label1: TLabel;
Button1: TButton;
Label2: TLabel;
Label3: TLabel;
Status: TStatusBar;
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
PowerUser: Array [0..1] of DWORD = (
$0090DF6D, //Power User 1
$0090DFDD //Power User 2
);
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
var
WND: HWND;
ProcessId: DWORD;
BytesWritten: DWORD;
hProcess: THandle;
i: Integer;
Write: DWORD;
begin
WND := FindWindow('Softnyx', nil);
Write := 0;
if WND <> 0 then
begin
GetWindowThreadProcessId(WND, @ProcessId);
hProcess := OpenProcess(PROCESS_ALL_ACCESS, False, ProcessId);
try
if hProcess = INVALID_HANDLE_VALUE then begin
raise Exception.Create('Invalid Handle');
exit;
end;
for i := 0 to Length(PowerUser)-1 do
begin
if not WriteProcessMemory(hProcess, Pointer(PowerUser[i]), @Write, $8, BytesWritten) then begin
raise Exception.Create('Error writing address: '+ IntToHex(PowerUser[i],8));
Exit;
end;
end;
finally
CloseHandle(hProcess);
Timer1.Enabled := False;
Label1.Caption := 'Brincadeira vai começar....';
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Mensagem:string;
begin
Mensagem :='Tem certeza ?';
if Application.MessageBox(PCHAR(Mensagem),'Confirme',MB_Iconquestion + mb_YesNo)= mrYes then
begin
close;
end;
end;
end.
eu gostaria de colocar os buttons para power user ,o que estou fazendo é tirando os codigos q estão abaixo do "procedure TForm1.Timer1Timer(Sender: TObject);"
só deixando begin end; mais esta dando erro no implementação se alguém puder me ajuda agradeço =/
Pergunta
junix
unit MainForm; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ComCtrls; type TForm1 = class(TForm) Timer1: TTimer; Label1: TLabel; Button1: TButton; Label2: TLabel; Label3: TLabel; Status: TStatusBar; procedure Timer1Timer(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; PowerUser: Array [0..1] of DWORD = ( $0090DF6D, //Power User 1 $0090DFDD //Power User 2 ); implementation {$R *.dfm} procedure TForm1.Timer1Timer(Sender: TObject); var WND: HWND; ProcessId: DWORD; BytesWritten: DWORD; hProcess: THandle; i: Integer; Write: DWORD; begin WND := FindWindow('Softnyx', nil); Write := 0; if WND <> 0 then begin GetWindowThreadProcessId(WND, @ProcessId); hProcess := OpenProcess(PROCESS_ALL_ACCESS, False, ProcessId); try if hProcess = INVALID_HANDLE_VALUE then begin raise Exception.Create('Invalid Handle'); exit; end; for i := 0 to Length(PowerUser)-1 do begin if not WriteProcessMemory(hProcess, Pointer(PowerUser[i]), @Write, $8, BytesWritten) then begin raise Exception.Create('Error writing address: '+ IntToHex(PowerUser[i],8)); Exit; end; end; finally CloseHandle(hProcess); Timer1.Enabled := False; Label1.Caption := 'Brincadeira vai começar....'; end; end; end; procedure TForm1.Button1Click(Sender: TObject); var Mensagem:string; begin Mensagem :='Tem certeza ?'; if Application.MessageBox(PCHAR(Mensagem),'Confirme',MB_Iconquestion + mb_YesNo)= mrYes then begin close; end; end; end.eu gostaria de colocar os buttons para power user ,o que estou fazendo é tirando os codigos q estão abaixo do "procedure TForm1.Timer1Timer(Sender: TObject);"
só deixando begin end; mais esta dando erro no implementação se alguém puder me ajuda agradeço =/
Editado por JhonasLink para o comentário
Compartilhar em outros sites
4 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.