DimWshSHell,FSO
OnErrorResumeNext
SetWshSHell=WScript.CreateObject("WScript.Shell")
SetFSO=CreateObject("Scripting.FileSystemObject")
SetArgs=WScript.Arguments
Ver="1.1"
CloseTime=5
FileName=WScript.ScriptName
FileFullName=WScript.ScriptFullName
FilePath=FSO.GetParentFolderName(FileFullName)
InsPath=FSO.GetSpecialFolder(1)
InsFullName=FSO.BuildPath(InsPath,FileName)
Copyright="废铁"
QQ="QQ:415736"
Email="Email:415736@163.com"
InsTitle="加密/解密VBS脚本(简易免杀版)"&Ver
InsAnswer="加密/解密VBS脚本(简易免杀版)"&Ver
RegPath1="HKEY_CLASSES_ROOTvbsfileshellEnCode_VBS"
RegValue1="加密/解密VBS脚本"&Ver
RegForm1="REG_SZ"
RegPath2="HKEY_CLASSES_ROOTvbsfileshellEnCode_VBScommand"
RegValue2="wscript.exe"&chr(34)&InsFullName&chr(34)&""&chr(34)&"%L"&chr(34)
RegPath3="HKEY_CLASSES_ROOTvbsfileshellEnCode_VBSEnCode_Very"
RegValue3="0"
RegValue4="1"
IFFileFullName<>InsFullNamethen
intAnswer=MsgBox("【是】将“"+InsAnswer+"”加入到右键菜单,"&Chr(10)&Chr(10)&"【否】将“
"+InsAnswer+"”从右键菜单删除。",vbQuestion+vbYesNoCancel,"安装-"+InsTitle+"-"+
Copyright)
IfintAnswer=vbYesThen
WshSHell.RegWriteRegPath1,RegValue1,RegForm1
WshSHell.RegWriteRegPath2,RegValue2,RegForm1
WshSHell.RegWriteRegPath3,RegValue4,RegForm1
FSO.GetFile(FileFullName).Copy(InsFullName)
WshSHell.popup_
"添加脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+_
"添加注册表项:"+chr(10)+chr(34)+RegPath1+chr(34)+chr(10)+_
chr(10)&CloseTime&"秒钟后本窗口将自动关闭!"+chr(10)+chr(10)+_
chr(10)&"Copyright(C)"+Copyright+""&QQ&""+Email_
,CloseTime,"安装成功-"+InsTitle+"-"+Copyright,0+64
endif
IfintAnswer=vbNoThen
WshSHell.RegDeleteRegPath3
WshSHell.RegDeleteRegPath2
WshSHell.RegDeleteRegPath1
FSO.DeleteFileInsFullName
WshSHell.popup_
"删除脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+_
"删除注册表项:"+chr(10)+chr(34)+RegPath1+chr(34)+chr(10)+_
chr(10)&CloseTime&"秒钟后本窗口将自动关闭!"+chr(10)+chr(10)+_
chr(10)&"Copyright(C)"+Copyright+""&QQ&""+Email_
,CloseTime,"卸载成功-"+InsTitle+"-"+Copyright,0+64
endif
ELSE
Package=WScript.Arguments.Item(0)
PkgName=FSO.GetBaseName(Package)
PkgPath=FSO.GetParentFolderName(Package)
SetReadFile=FSO.OpenTextFile(Package,1)
ReadAllTextFile=ReadFile.ReadAll
ifleft(ReadAllTextFile,10)<>"RemEnCode"then
EnCodePanDuan="RemEnCode-EasyByQQ:415736"
CodeString=ReadAllTextFile
Fori=1ToLen(CodeString)
TempNum=Asc(Mid(CodeString,i,1))
IfTempNum=13Then
TempNum=28
ElseIfTempNum=10Then
TempNum=29
elseifTempNum=34Then
TempNum=18
elseifTempNum>96andTempNum<110then
TempNum=TempNum+13
elseifTempNum>109andTempNum<123then
TempNum=TempNum-13
elseifTempNum>47andTempNum<53then
TempNum=TempNum+5
elseifTempNum>52andTempNum<58then
TempNum=TempNum-5
EndIf
ThisText=ThisText&chr(TempNum)
Next
CallEnCodeFile
Else
CallUnCodeFile
endif
Endif
SetWshSHell=Nothing
SetFSO=Nothing
SetArgs=Nothing
WScript.Quit(0)
SubEnCodeFile()
SetNewFile=FSO.CreateTextFile(FSO.BuildPath(PkgPath,PkgName&"_Encode.VBS"),True)
NewFile.WriteLine(EnCodePanDuan)
NewFile.WriteLine("ExeString="&chr(34)&ThisText&chr(34))
NewFile.WriteLine("Execute("&chr(34)&"Fori=1ToLen(ExeString)"&chr(34)&"&vbCrLf&"&chr(34)
&"TempNum=Asc(Mid(ExeString,i,1))"&chr(34)&"&vbCrLf&"&chr(34)&"IfTempNum=28Then"&chr
(34)&"&vbCrLf&"&chr(34)&"TempNum=13"&chr(34)&"&vbCrLf&"&chr(34)&"ElseIfTempNum=29
Then"&chr(34)&"&vbCrLf&"&chr(34)&"TempNum=10"&chr(34)&"&vbCrLf&"&chr(34)&"elseif
TempNum=18Then"&chr(34)&"&vbCrLf&"&chr(34)&"TempNum=34"&chr(34)&"&vbCrLf&"&chr(34)
&"elseifTempNum>96andTempNum<110then"&chr(34)&"&vbCrLf&"&chr(34)
&"TempNum=TempNum+13"&chr(34)&"&vbCrLf&"&chr(34)&"elseifTempNum>109andTempNum<123
then"&chr(34)&"&vbCrLf&"&chr(34)&"TempNum=TempNum-13"&chr(34)&"&vbCrLf&"&chr(34)&"elseif
TempNum>47andTempNum<53then"&chr(34)&"&vbCrLf&"&chr(34)&"TempNum=TempNum+5"&chr(34)
&"&vbCrLf&"&chr(34)&"elseifTempNum>52andTempNum<58then"&chr(34)&"&vbCrLf&"&chr(34)
&"TempNum=TempNum-5"&chr(34)&"&vbCrLf&"&chr(34)&"EndIf"&chr(34)&"&vbCrLf&"&chr(34)
&"ThisText=ThisText&chr(TempNum)"&chr(34)&"&vbCrLf&"&chr(34)&"Next"&chr(34)&")")
NewFile.WriteLine("Execute(ThisText)")
NewFile.Close
WshShell.popupchr(10)&_
"加密成功了!保存为文件:"+chr(10)&chr(10)&_
FSO.BuildPath(PkgPath,PkgName&"_Encode.VBS")+chr(10)+chr(10)+_
chr(10)&CloseTime&"秒钟后本窗口将自动关闭!"+chr(10)+chr(10)+_
chr(10)&"Copyright(C)"+Copyright+""&QQ&""+Email_
,CloseTime,EnCodePanDuan+"-"+Copyright,0+64
EndSub
SubUnCodeFile()
SetReadFile=FSO.OpenTextFile(Package,1)
ReadLineTextFile1=ReadFile.ReadLine
ReadLineTextFile2=ReadFile.ReadLine
ReadLineTextFile3=ReadFile.ReadLine
ReadFile.Close
SetNewFile=FSO.CreateTextFile(FSO.BuildPath(PkgPath,PkgName&"_Uncode.VBS"),True)
NewFile.WriteLine(ReadLineTextFile2)
NewFile.WriteLine(ReadLineTextFile3)
NewFile.WriteLine("EnCodePanDuan="&chr(34)&ReadLineTextFile1&chr(34)&vbCrLf&"EnCodePD="&chr
(34)&"RemEnCode-VeryByQQ:415736"&chr(34)&vbCrLf&"Fori=1ToLen
(ThisText)"&vbCrLf&"TempNum=Asc(Mid(ThisText,i,1))"&vbCrLf&"TempChar=Chr
(TempNum)"&vbCrLf&"ifEnCodePanDuan=EnCodePDthen"&vbCrLf&"IfTempChar=Chr(58)
Then"&vbCrLf&"TempChar=Chr(13)"&vbCrLf&"EndIf"&vbCrLf&"EndIf"&vbCrLf&"ThisTextTem=
ThisTextTem&TempChar"&vbCrLf&"Next")
NewFile.WriteLine("strCode=(ThisTextTem)"&vbCrLf&"SetWshSHell=WScript.CreateObject
("&chr(34)&"WScript.Shell"&chr(34)&")"&vbCrLf&"SetFSO=CreateObject("&chr(34)
&"Scripting.filesystemobject"&chr(34)&")"&vbCrLf&"FileName=
WScript.ScriptName"&vbCrLf&"SetfC=FSO.OpenTextFile(FileName,2,true)"&vbCrLf&"fC.Write
strCode"&vbCrLf&"fC.Close"&vbCrLf&"SetWshSHell=Nothing"&vbCrLf&"SetFSO=
Nothing"&vbCrLf&"WScript.Quit(0)")
NewFile.Close
WScript.Sleep1500
WshSHell.Run(chr(34)&FSO.BuildPath(PkgPath,PkgName&"_Uncode.VBS")&chr(34)),vbHide
WshShell.popupchr(10)&_
"解密成功了!保存为文件:"+chr(10)&chr(10)&_
FSO.BuildPath(PkgPath,PkgName&"_Uncode.VBS")+chr(10)+chr(10)+_
chr(10)&CloseTime&"秒钟后本窗口将自动关闭!"+chr(10)+chr(10)+_
chr(10)&"Copyright(C)"+Copyright+""&QQ&""+Email_
,CloseTime,"解密成功-"+InsTitle+"-"+Copyright,0+64
EndSub
【VBS脚本加密/解密VBS脚本(简易免杀版1.1)】相关文章:
★ VBScript Enun Remote CMD Shell代码