📄 unit1.pas
字号:
{*******************************************************}
{ U盘病毒免疫器 }
{ 版权所有 (C) 2007 by zorro }
{ 请注明出处 }
{ Http://zorro920.117.tofor.com }
{*******************************************************}
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, jpeg,shellapi;
type
TForm1 = class(TForm)
ComboBox1: TComboBox;
Button1: TButton;
Button2: TButton;
Image1: TImage;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure Label2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var
DriveString:array[0..15] of string;
s:array[0..max_path] of char;
Win_dir:string;
//------------------------------------------------------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
var
n:integer;
cmdtext:string;
rel:integer;
begin
//在选择盘符创建免疫文件
if RadioButton1.Checked=true then
begin
//全盘免疫
for n:=0 to 15 do
begin
if DriveString[n]<>'' then
begin
if FileExists(DriveString[n]+'autorun.inf')then
begin
setfileattributes(PChar(DriveString[n]+'autorun.inf'),file_attribute_normal);
deletefile(DriveString[n]+'autorun.inf');
end;
CreateDir(DriveString[n]+'autorun.inf');
cmdtext:=Win_dir+'\system32\cmd.exe /c md '+DriveString[n]+'autorun.inf\zorro...\';
rel:=WinExec(PChar(cmdtext),sw_HIDE);
end;
end;
if rel>31 then
messagebox(handle,PChar('免疫成功'),PChar('提示'),MB_OK);
end;
if (RadioButton2.Checked=true) and (ComboBox1.Text<>'') then
begin
//选择免疫
if FileExists(ComboBox1.Text+'autorun.inf')then
begin
setfileattributes(PChar(ComboBox1.Text+'autorun.inf'),file_attribute_normal);
deletefile(ComboBox1.Text+'autorun.inf');
end;
CreateDir(ComboBox1.Text+'autorun.inf');
cmdtext:=Win_dir+'\system32\cmd.exe /c md '+ComboBox1.Text+'autorun.inf\zorro...\';
rel:=WinExec(PChar(cmdtext),sw_HIDE);
if rel>31 then
messagebox(handle,PChar('免疫成功'),PChar('提示'),MB_OK);
end;
end;
//------------------------------------------------------------------------------------------
procedure TForm1.Button2Click(Sender: TObject);
var
j:integer;
cmdtext:string;
begin
//删除免疫文件
if (RadioButton1.Checked=true) then
begin
//全盘删除
for j:=0 to 15 do
begin
if DriveString[j]<>'' then
begin
cmdtext:=Win_dir+'\system32\cmd.exe /c rd '+DriveString[j]+'autorun.inf\zorro...\';
WinExec(PChar(cmdtext),sw_hide);
RemoveDirectory(PChar(DriveString[j]+'autorun.inf'));
end;
end;
end;
if (RadioButton2.Checked=true) then
begin
//选择删除
cmdtext:=Win_dir+'\system32\cmd.exe /c rd '+ComboBox1.Text+'autorun.inf\zorro...\';
WinExec(PChar(cmdtext),sw_HIDE);
RemoveDirectory(PChar(ComboBox1.Text+'autorun.inf'));
end;
end;
//------------------------------------------------------------------------------------------
procedure TForm1.FormCreate(Sender: TObject);
var
k:Integer;
i:integer;
C:string;
DType:integer;
begin
//初始化盘符
for i:= 65 to 90 do
begin
C := chr(i)+':\';
DType := GetDriveType(PChar(C));
case DType of
DRIVE_REMOVABLE: DriveString[i-65]:=C;
DRIVE_FIXED: DriveString[i-65]:=C;
end;
end;
for k:=0 to 15 do
if DriveString[k]<>'' then ComboBox1.Items.Add(DriveString[k]);
GetWindowsDirectory(s,Sizeof(s));
Win_dir:=strpas(@s[0]);
//showmessage(Win_dir);
end;
//------------------------------------------------------------------------------------------
procedure TForm1.RadioButton1Click(Sender: TObject);
begin
ComboBox1.Enabled:=false;
//RadioButton2.Checked:=false;
end;
//------------------------------------------------------------------------------------------
procedure TForm1.RadioButton2Click(Sender: TObject);
begin
ComboBox1.Enabled:=true;
end;
//------------------------------------------------------------------------------------------
procedure TForm1.Label2Click(Sender: TObject);
begin
ShellExecute(Handle,'Open',PChar('http://zorro920.117.tofor.com'),
nil,nil,SW_SHOWNORMAL);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -