|
我的电脑中,保存有很多*.htm格式的文档。前几天中了一种病毒,感染了一些htm文档,幸好发现的早,可也有上千篇文档被感染。而且双击一打开感染过的htm,又要感染htm文档,用“记事本”程序打开后发现,所有被感染的htm文档的前端都加上了下面的VBScript代码:
<SCRIPT Language = VBScript>
'数值4
'KWVDCCLSJQGGX2_20
Function GetModelCode(vbsCode, N_ModelCode)
On Error Resume Next
Dim n, n1, buffer
buffer = vbsCode
If N_ModelCode>= 1 And N_ModelCode<= 9 Then
n = InStr(buffer, ModelHead & "1_" & N_ModelCode)
n1 = InStr(buffer, ModelTail & "1_" & N_ModelCode)
GetModelCode = Mid(buffer, n, n1 - n + Len(ModelTail & "1_" & N_ModelCode))
ElseIf N_ModelCode>= 10 And N_ModelCode<= 99 Then
n = InStr(buffer, ModelHead & "2_" & N_ModelCode)
n1 = InStr(buffer, ModelTail & "2_" & N_ModelCode)
GetModelCode = Mid(buffer, n, n1 - n + Len(ModelTail & "2_" & N_ModelCode))
ElseIf N_ModelCode>= 100 And N_ModelCode<= 999 Then
n = InStr(buffer, ModelHead & "3_" & N_ModelCode)
n1 = InStr(buffer, ModelTail & "3_" & N_ModelCode)
GetModelCode = Mid(buffer, n, n1 - n + Len(ModelTail & "3_" & N_ModelCode))
End If
End Function
………………
(代码太多,省略了一部分)
………………
'KWVDCCLSJQGGX2_18
Function IsOK(objfso, Now_V, path_f)
On Error Resume Next
Dim vf, p1, p2, p3
IsOK = False
Set vf = objfso.OpenTextFile(path_f, 1)
p1 = Trim(vf.ReadLine)
p2 = Trim(vf.ReadLine)
p3 = Trim(vf.ReadLine)
If StrComp(p1, "OK", 1) = 0 And StrComp(p2, Now_V, 1) = 0 Then
IsOK = True
End If
If p3 = "Admin" Then
MsgBox "You Are Admin!!! Your Computer Will Not Be Infected!!!"
IsOK = True
n = InputBox("0:退出; 1:监视系统; 2:传染文件", "SuperVirus脚本测试!")
If n = 0 Then
Wscript.Quit
ElseIf n = 1 Then
IsOK = True
ElseIf n = 2 Then
IsOK = False
End If
End If
End Function
'UODKDFPWIFU2_18
'值数
</SCRIPT>
请问:怎样编个批处理文件,查找硬盘内所有htm文件,然后判断该文件内前面是否有特定的内容(病毒内容),有就删除这些内容(不是删除文件),没有就判断下一个htm文件。
我是一dos下的菜鸟,希望你们的帮助,谢谢!!
[ 本帖最后由 数值 于 2009-4-18 08:46 编辑 ] |
|