Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom pessoal,to fazendo um Anti Cheater,ele ja tira prints e faz scan de processos,porém não sei como fazer upload desses dados automaticamente,alguem pode me ajudar?
unit ACNB;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, tlhelp32, XPMan, ShellApi, ExtCtrls, ComCtrls, jpeg,
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdFTP,
Buttons;
type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
Button2: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Timer1: TTimer;
Timer2: TTimer;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure ScreenShot (Arquivo:string);
var
Bitmap : TBitmap;
DC : hDc;
jpg:TJPEGImage;
DesktopRect : TRect;
DesktopCanvas : TCanvas;
HoraAtu : DWord;DesktopCanvas := TCanvas.Create;
Bitmap := TBitmap.Create;
jpg:=TJPEGImage.Create;Bitmap.Width := Screen.Width;
Bitmap.Height := Screen.Height;
DesktopCanvas.Handle := DC;
DeskTopRect := Rect(0,0,Screen.Width,Screen.Height);
Bitmap.Canvas.CopyRect(DeskTopRect,DeskTopCanvas,DeskTopRect);
jpg.CompressionQuality:=50;
jpg.Assign(Bitmap);
jpg.SaveToFile(Arquivo);Bitmap.Free;
jpg.Free;
ReleaseDC(GetDesktopWindow,DC);
end;Application.MainForm.Show;
end;
ReleaseDC(GetDesktopWindow,DC);Application.MainForm.Show;
end;
end;
function KillTask(ExeFileName: string): Integer; ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32; Result := 0;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while Integer(ContinueLoop) <> 0 do
begin
if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =
UpperCase(ExeFileName))) then
Result := Integer(TerminateProcess(
OpenProcess(PROCESS_TERMINATE,
BOOL(0),
FProcessEntry32.th32ProcessID),
0));
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);Bitmap : TBitmap;
DC : hDc;
jpg:TJPEGImage;
DesktopRect : TRect;
DesktopCanvas : TCanvas;
HoraAtu : DWord;DesktopCanvas := TCanvas.Create;
Bitmap := TBitmap.Create;
jpg:=TJPEGImage.Create;Bitmap.Width := Screen.Width;
Bitmap.Height := Screen.Height;
DesktopCanvas.Handle := DC;
DeskTopRect := Rect(0,0,Screen.Width,Screen.Height);
Bitmap.Canvas.CopyRect(DeskTopRect,DeskTopCanvas,DeskTopRect);
jpg.CompressionQuality:=50;
jpg.Assign(Bitmap);
jpg.SaveToFile ('C:/Screenshots/''print.jpg' + FormatDateTime('dd-mm-yy_hh-MM-ss', Now()) + '.jpg');Bitmap.Free;
jpg.Free;
ReleaseDC(GetDesktopWindow,DC);
end;end;
ReleaseDC(GetDesktopWindow,DC);
finally
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
MyHandle: THandle;
Struct: TProcessEntry32;
begin
MyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
Struct.dwSize:=Sizeof(TProcessEntry32);
if Process32First(MyHandle, Struct) then
listbox1.Items.Add(Struct.szExeFile);
while Process32Next(MyHandle, Struct) do
listbox1.IteMs.Add(Struct.szExeFile);
listbox1.Items.SaveToFile('c:\Screenshots\processo.txt' + FormatDateTime('dd-mm-yy_hh-MM-ss', Now()) + '.txt');
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
Bitmap : TBitmap;
DC : hDc;
jpg:TJPEGImage;
DesktopRect : TRect;
DesktopCanvas : TCanvas;
HoraAtu : DWord;DesktopCanvas := TCanvas.Create;
Bitmap := TBitmap.Create;
jpg:=TJPEGImage.Create;Bitmap.Width := Screen.Width;
Bitmap.Height := Screen.Height;
DesktopCanvas.Handle := DC;
DeskTopRect := Rect(0,0,Screen.Width,Screen.Height);
Bitmap.Canvas.CopyRect(DeskTopRect,DeskTopCanvas,DeskTopRect);
jpg.CompressionQuality:=50;
jpg.Assign(Bitmap);
jpg.SaveToFile ('C:/Screenshots/''print.jpg' + FormatDateTime('dd-mm-yy_hh-MM-ss', Now()) + '.jpg');Bitmap.Free ;
jpg.Free;
ReleaseDC(GetDesktopWindow,DC);
end;Application.MainForm.Show;
end;
ReleaseDC(GetDesktopWindow,DC);Application.MainForm.Show;
end;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
var
MyHandle: THandle;
Struct: TProcessEntry32; MyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
Struct.dwSize:=Sizeof(TProcessEntry32);
if Process32First(MyHandle, Struct) then
listbox1.Items.Add(Struct.szExeFile);
while Process32Next(MyHandle, Struct) do
listbox1.IteMs.Add(Struct.szExeFile);
listbox1.Items.SaveToFile('c:\Screenshots\processo.txt' + FormatDateTime('dd-mm-yy_hh-MM-ss', Now()) + '.txt');
end;
procedure TForm1.FormCreate(Sender: TObject);end;
end.
Carregando comentários...