VBS script encryption/decryption VBS script (easy to kill version 1.1) _vbs

Source: Internet
Author: User
Tags chr decrypt readfile readline
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=" &AMP;CHR) &AMP;THISTEXT&AMP;CHR (34))
Newfile.writeline ("Execute" &AMP;CHR & "for I=1 to Len (exestring)" &AMP;CHR (+) & "&vbCrLf&" & Chr (34)
& "Tempnum = ASC (Mid exestring,i,1)" &AMP;CHR (+) & "&vbCrLf&" &AMP;CHR (%) & "If Tempnum = Then" &chr
(& "&vbCrLf&" &AMP;CHR) & "Tempnum =" &AMP;CHR (+) & "&vbCrLf&" &AMP;CHR (+) & " ElseIf tempnum = 29
Then "&AMP;CHR &" &vbCrLf& "&AMP;CHR (+) &" Tempnum = ten "&AMP;CHR (+) &" &vbCrLf& "& CHR & "ElseIf
Tempnum=18 Then "&AMP;CHR" & "&vbCrLf&" &AMP;CHR (a) & "Tempnum = &AMP;CHR" (+) & "&vbcrlf & "&AMP;CHR (34)
& "ElseIf tempnum>96 and tempnum<110 then" &AMP;CHR (+) & "&vbCrLf&" &AMP;CHR (34)
& "Tempnum=tempnum+13" &AMP;CHR (+) & "&vbCrLf&" &AMP;CHR (+) & "ElseIf tempnum>109 and Tempnum <123
Then "&AMP;CHR" & "&vbCrLf&" &AMP;CHR (a) & "Tempnum=tempnum-13" &AMP;CHR (+) & "&vbcrlf & "&AMP;CHR &" ElseIf
tempnum>47 and tempnum<53 then "&AMP;CHR (a) &" &vbCrLf& "&AMP;CHR (+) &" Tempnum=tempnum+5 "& Chr (34)
& "&vbCrLf&" &AMP;CHR (+) & "ElseIf tempnum>52 and tempnum<58 then" &AMP;CHR (+) & "&vbcrlf & "&AMP;CHR (34)
& "Tempnum=tempnum-5" &AMP;CHR (+) & "&vbCrLf&" &AMP;CHR (+) & "End If" &AMP;CHR (+) & "&" vbcrlf& "&AMP;CHR (34)
& "Thistext = Thistext & Chr (tempnum)" &AMP;CHR (+) & "&vbCrLf&" &AMP;CHR (+) & "Next" &AMP;CHR (34 ) & ")")
Newfile.writeline ("Execute (Thistext)")
Newfile.close
Wshshell.popup chr (&_)
"The encryption was successful!" Save As File: "+ chr (&AMP;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=" &AMP;CHR) &AMP;READLINETEXTFILE1&AMP;CHR (a) &vbCrLf& "encodepd=" &chr
(& "Rem encode-very by qq:415736" &AMP;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
("&AMP;CHR &" Wscript.Shell "&AMP;CHR () &") "&vbCrLf&" Set FSO = CreateObject ("&AMP;CHR" (34)
& "Scripting.FileSystemObject" &AMP;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 (&AMP;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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.