网上有vb6编的代码,你参考一下
'killvirus
Dim i&, sTmp$, num&
On Error Resume Next
'c:\windows应改为您的%windir%文件夹
Kill "c:\windows\logo1_.exe"
MkDir "c:\windows\logo1_.exe"
' 遍历所需清除文件
For i = 0 To UBound(asFiles)
sTmp$ = asFiles(i)
Dim sTMPFIle$
sTMPFIle$ = GetFileName(sTmp)
Dim sExt$
sExt$ = GetFileExt(sTmp)
sTMPFIle$ = Left(sTMPFIle$, Len(sTMPFIle$) - Len(sExt) - 1)
Dim f&
f = FreeFile
Open sTmp For Binary As f
Dim sTmpVirus(7) As Byte
Get #f, &H35, sTmpVirus
' 此病毒使用upack0.3x压缩,35h处有"KwBywing"标志。
If StrConv(sTmpVirus, vbUnicode) = "KwBywing" Then
Close f
num = num + 1
FileCopy sTmp, sTmp & ".bak"
f = FreeFile
Open sTmp & ".bak" For Binary As f
' 删除病毒文件
Kill sTmp
Dim g&
g = FreeFile
Open sTmp For Binary As g
Dim abFile() As Byte, abfile1() As Byte
Dim lFile&
' 原始文件长度为感染后长度-32124字节
lFile = LOF(f) - 32124
ReDim abFile(lFile - 1)
Get #f, 32125, abFile
Put #g, , abFile
Close g
End If
Close f
' 可以删除备份文件了Kill sTmp & ".bak"
Next
MsgBox num & "病毒清除完毕,下回注意!" |