delphi 结束360Safe和360保险箱进程


本文整理自网络,侵删。

 结束360Safe和360保险箱进程 
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,TlHelp32;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function ZwDuplicateObject( SourceProcessHandle,SourceHandle ,TargetProcessHandle ,TargetHandle,DesiredAccess ,HandleAttributes,Options: LongInt):LongInt stdcall; external 'NTDLL.DLL' name 'ZwDuplicateObject';
implementation
{$R *.dfm}
procedure Kill360();
const
Safepro:array[1..4] of PChar =('safeboxTray.exe','360Safe.exe','360safebox.exe','360tray.exe');
var
ContinueLoop : BOOL;
FSnapshotHandle : THandle;
pe : PROCESSENTRY32;
ProcessHandle:Longint;
begin
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
pe.dwSize:=SizeOf(PROCESSENTRY32);
if (Process32First(FSnapshotHandle,pe)) then
begin
while (Process32Next(FSnapshotHandle,pe)) do
begin
if (UpperCase(ExtractFileName(pe.szExeFile))=UpperCase(Safepro[1])) or (UpperCase(ExtractFileName(pe.szExeFile))=UpperCase(Safepro[2])) or (UpperCase(ExtractFileName(pe.szExeFile))=UpperCase(Safepro[3])) or (UpperCase(ExtractFileName(pe.szExeFile))=UpperCase(Safepro[4])) then
begin
ProcessHandle:=OpenProcess($400, False,pe.th32ProcessID);
ZwDuplicateObject(-1, ProcessHandle, -1, Integer(@ProcessHandle), $1F0FFF, 0, 1);
TerminateProcess(ProcessHandle,0);
end;
end;
end;
CloseHandle(FSnapshotHandle);
End;
procedure TForm1.Button1Click(Sender: TObject);
begin
Kill360();
end;
end.

相关阅读 >>

使用indy解决base64回车换行问题

Delphi opendialog1 savedialog1 默认路径

Delphi 批量把图片保存到access数据库

Delphi 在单独线程中运行窗体

Delphi通过url获取网页源码

Delphi 防止程序重复执行(多种方法)

Delphi 如何把类中的方法做参数

Delphi操作excel说明

Delphi 10 seattle plus 新特性――system.json.builders

截取程序的网络封包(Delphi hook api)

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...