VBS script encryption/decryption VBS script (easy to kill version 1.1) _vbs
Last Update:2017-01-19
Source: Internet
Author: User
Dim Wshshell,fso
On Error Resume Next
Set WshShell = WScript.CreateObject ("Wscript.Shell")
Set FSO = CreateObject ("Scripting.FileSystemObject")
Set Args = 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= "Scrap Iron"
Qq= "qq:415736"
Email= "Email:415736@163.com"
Institle= "Encrypt/decrypt VBS script (easy to kill version)" &ver
Insanswer= "Encrypt/decrypt VBS script (easy to kill version)" &ver
regpath1= "Hkey_classes_root\vbsfile\shell\encode_vbs\"
Regvalue1= "Encrypt/Decrypt VBS script" &ver
Regform1= "REG_SZ"
Regpath2= "Hkey_classes_root\vbsfile\shell\encode_vbs\command\"
Regvalue2= "Wscript.exe" & Chr (34) & Insfullname & Chr (+) & "" & Chr (+) & "%l" & CHR
regpath3= "Hkey_classes_root\vbsfile\shell\encode_vbs\encode_very"
regvalue3= "0"
regvalue4= "1"
IF filefullname <> Insfullname Then
Intanswer = MsgBox ("" is "" + Insanswer + "" added to the right-click menu, "&chr &chr (a) &" "No"
"+ Insanswer +" is removed from the right-click menu. ", vbquestion + vbYesNoCancel," installation-"+ Institle +"-"+
Copyright)
If intanswer = vbyes Then
WshShell.RegWrite Regpath1,regvalue1,regform1
WshShell.RegWrite Regpath2,regvalue2,regform1
WshShell.RegWrite Regpath3,regvalue4,regform1
Fso. GetFile (Filefullname). Copy (Insfullname)
Wshshell.popup _
"Add script file:" +CHR (+INSFULLNAME+CHR) +CHR (10) + _
"Add registry key:" +CHR (+CHR) + RegPath1 +CHR (10) + _
CHR & Closetime & "Seconds later this window will automatically close!" +CHR +CHR (10) + _
CHR & "Copyright (C)" + Copyright + "" & QQ & "" + Email _
, Closetime, "installation success-" + Institle + "-" + Copyright, 0 + 64
End If
If intanswer = vbno Then
Wshshell.regdelete RegPath3
Wshshell.regdelete RegPath2
Wshshell.regdelete RegPath1
Fso. DeleteFile Insfullname
Wshshell.popup _
"Delete script file:" +CHR (+INSFULLNAME+CHR) +CHR (10) + _
"Delete registry key:" +CHR (+CHR) + RegPath1 +CHR (+CHR) (10) + _
CHR & Closetime & "Seconds later this window will automatically close!" +CHR +CHR (10) + _
CHR & "Copyright (C)" + Copyright + "" & QQ & "" + Email _
, Closetime, "Uninstall Success-" + Institle + "-" + Copyright, 0 + 64
End If
ELSE
Package = WScript.Arguments.Item (0)
Pkgname=fso. Getbasename (Package)
Pkgpath=fso. Getparentfoldername (Package)
Set ReadFile = FSO. OpenTextFile (Package, 1)
Readalltextfile=readfile.readall
If left (readalltextfile,10) <> "Rem EnCode" Then
Encodepanduan= "Rem Encode-easy by qq:415736"
Codestring=readalltextfile
For I=1 to Len (codestring)
Tempnum = ASC (Mid (codestring,i,1))
If Tempnum = Then
Tempnum = 28
ElseIf Tempnum = Then
Tempnum = 29
ElseIf tempnum=34 Then
Tempnum = 18
ElseIf tempnum>96 and tempnum<110 Then
Tempnum=tempnum+13
ElseIf tempnum>109 and Tempnum<123 Then
Tempnum=tempnum-13
ElseIf tempnum>47 and tempnum<53 Then
Tempnum=tempnum+5
ElseIf tempnum>52 and tempnum<58 Then
Tempnum=tempnum-5
End If
Thistext = thistext & Chr (tempnum)
Next
Call Encodefile
Else
Call Uncodefile
End If
End If
Set WshShell = Nothing
Set FSO = Nothing
Set Args = Nothing
Wscript.Quit (0)
Sub Encodefile ()
Set NewFile = FSO. CreateTextFile (FSO. BuildPath (Pkgpath,pkgname& "_encode.vbs"), True)
Newfile.writeline (Encodepanduan)
Newfile.writeline ("exestring=" &CHR) &THISTEXT&CHR (34))
Newfile.writeline ("Execute" &CHR & "for I=1 to Len (exestring)" &CHR (+) & "&vbCrLf&" & Chr (34)
& "Tempnum = ASC (Mid exestring,i,1)" &CHR (+) & "&vbCrLf&" &CHR (%) & "If Tempnum = Then" &chr
(& "&vbCrLf&" &CHR) & "Tempnum =" &CHR (+) & "&vbCrLf&" &CHR (+) & " ElseIf tempnum = 29
Then "&CHR &" &vbCrLf& "&CHR (+) &" Tempnum = ten "&CHR (+) &" &vbCrLf& "& CHR & "ElseIf
Tempnum=18 Then "&CHR" & "&vbCrLf&" &CHR (a) & "Tempnum = &CHR" (+) & "&vbcrlf & "&CHR (34)
& "ElseIf tempnum>96 and tempnum<110 then" &CHR (+) & "&vbCrLf&" &CHR (34)
& "Tempnum=tempnum+13" &CHR (+) & "&vbCrLf&" &CHR (+) & "ElseIf tempnum>109 and Tempnum <123
Then "&CHR" & "&vbCrLf&" &CHR (a) & "Tempnum=tempnum-13" &CHR (+) & "&vbcrlf & "&CHR &" ElseIf
tempnum>47 and tempnum<53 then "&CHR (a) &" &vbCrLf& "&CHR (+) &" Tempnum=tempnum+5 "& Chr (34)
& "&vbCrLf&" &CHR (+) & "ElseIf tempnum>52 and tempnum<58 then" &CHR (+) & "&vbcrlf & "&CHR (34)
& "Tempnum=tempnum-5" &CHR (+) & "&vbCrLf&" &CHR (+) & "End If" &CHR (+) & "&" vbcrlf& "&CHR (34)
& "Thistext = Thistext & Chr (tempnum)" &CHR (+) & "&vbCrLf&" &CHR (+) & "Next" &CHR (34 ) & ")")
Newfile.writeline ("Execute (Thistext)")
Newfile.close
Wshshell.popup chr (&_)
"The encryption was successful!" Save As File: "+ chr (&CHR) & _
Fso. BuildPath (Pkgpath,pkgname& "_encode.vbs") +CHR (10) + _
CHR & Closetime & "Seconds later this window will automatically close!" +CHR +CHR (10) + _
CHR & "Copyright (C)" + Copyright + "" & QQ & "" + Email _
, Closetime, Encodepanduan + "-" + Copyright, 0 + 64
End Sub
Sub Uncodefile ()
Set ReadFile = FSO. OpenTextFile (Package, 1)
Readlinetextfile1=readfile.readline
Readlinetextfile2=readfile.readline
Readlinetextfile3=readfile.readline
Readfile.close
Set NewFile = FSO. CreateTextFile (FSO. BuildPath (Pkgpath,pkgname& "_uncode.vbs"), True)
Newfile.writeline (ReadLineTextFile2)
Newfile.writeline (READLINETEXTFILE3)
Newfile.writeline ("encodepanduan=" &CHR) &READLINETEXTFILE1&CHR (a) &vbCrLf& "encodepd=" &chr
(& "Rem encode-very by qq:415736" &CHR (%) &vbCrLf& "for I=1 to Len
(thistext) "&vbCrLf&" Tempnum = ASC (Mid (thistext,i,1)) "&vbCrLf&" Tempchar = Chr
(tempnum) "&vbCrLf&" if ENCODEPANDUAN=ENCODEPD then "&vbCrLf&" If Tempchar = Chr (58)
Then ' &vbCrLf& ' Tempchar = Chr ' &vbCrLf& ' End If ' &vbCrLf& ' End If ' &vbCrLf& ' Thistexttem =
Thistexttem & Tempchar "&vbCrLf& Next")
Newfile.writeline ("Strcode = (thistexttem)" &vbCrLf& "Set WshShell = WScript.CreateObject
("&CHR &" Wscript.Shell "&CHR () &") "&vbCrLf&" Set FSO = CreateObject ("&CHR" (34)
& "Scripting.FileSystemObject" &CHR (+) & ")" &vbCrLf& "FileName =
WScript.ScriptName "&vbCrLf&" Set FC = FSO. OpenTextFile (FileName, 2, True) "&vbCrLf&" Fc.write
Strcode "&vbCrLf&" Fc.close "&vbCrLf&" Set WshShell = Nothing "&vbCrLf&" Set FSO =
Nothing "&vbCrLf&" Wscript.Quit (0) ")
Newfile.close
Wscript.Sleep 1500
Wshshell.run (CHR) &fso. BuildPath (Pkgpath,pkgname& "_uncode.vbs") &chr), vbhide
Wshshell.popup chr (&_)
"The decryption was successful!" Save As File: "+ chr (&CHR) & _
Fso. BuildPath (Pkgpath,pkgname& "_uncode.vbs") +CHR (10) + _
CHR & Closetime & "Seconds later this window will automatically close!" +CHR +CHR (10) + _
CHR & "Copyright (C)" + Copyright + "" & QQ & "" + Email _
, Closetime, "decryption success-" + Institle + "-" + Copyright, 0 + 64
End Sub