- [남군]빛고을한량
- 0
- 90
- 0
- 0
- 2020-07-23 13:30:10
- 관련링크
- 제목 : getProcessList
procedure getProcessList;
var
handler: THandle;
data: TProcessEntry32; //uses tlhelp32
begin
handler:= CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
data.dwSize:= SizeOf(data);
if Process32First(handler, data) then begin
while Process32Next(handler, data) do begin
if (data.szExeFile = 'python.exe')
or (data.szExeFile = 'chromedriver.exe')
or (data.szExeFile = 'chrome.exe') then
Memo1.Lines.Add(string(data.szExeFile) + ':' + UIntToStr(data.th32ProcessID));
end;
end;
function TForm1.killProcessByPid(pid: string): Boolean;
var
killer: THandle;
code: string;
begin
code:= '';
killer:= OpenProcess(PROCESS_TERMINATE, False, StrToInt(pid));
if TerminateProcess(killer, 0 ) then begin
memo1.lines.add( '[+] kill process success : '+pid);
end
else begin
memo1.lines.add('[-] kill process fail : '+pid);
end;
end;
- 첨부파일
- 댓글