unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,tlhelp32;
type
TForm1 = class(TForm)
ListBox1: TListBox;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
ProcessName: string;
ProcessID: integer;
ListLoop: Boolean;
FsnapShotHandle: Thandle;
FProcessEntry32:TProcessEntry32;
begin
Fsnapshothandle := CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwsize := SizeOF(FProcessEntry32);
Listloop := Process32First(FSnapshotHandle, FProcessEntry32);
while Listloop do
begin
ProcessName:=FprocessEntry32.szExeFile;
ProcessID:=FProcessEntry32.th32ProcessID;
ListLoop := Process32Next(FSnapshotHandle, FprocessEntry32);
end;
if ProcessName='elementclient.exe' then
begin
listbox1.Items.Add(ProcessNAme+' PID: '+inttostr(processid));
end;
CloseHandle(FSnapshotHandle);
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,tlhelp32;
type
TForm1 = class(TForm)
ListBox1: TListBox;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
ProcessName: string;
ProcessID: integer;
ListLoop: Boolean;
FsnapShotHandle: Thandle;
FProcessEntry32:TProcessEntry32;
begin
Fsnapshothandle := CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwsize := SizeOF(FProcessEntry32);
Listloop := Process32First(FSnapshotHandle, FProcessEntry32);
while Listloop do
begin
ProcessName:=FprocessEntry32.szExeFile;
ProcessID:=FProcessEntry32.th32ProcessID;
ListLoop := Process32Next(FSnapshotHandle, FprocessEntry32);
end;
if ProcessName='elementclient.exe' then
begin
listbox1.Items.Add(ProcessNAme+' PID: '+inttostr(processid));
end;
CloseHandle(FSnapshotHandle);
end;
end.
作者:青色咖啡@极点博客 - 青色咖啡的博客
地址:http://www.t522.com/post/1/
极点博客版权所有©转载时必须以链接形式注明作者和原始出处及本声明!


注入别的进程,然后截取别