How to write VBS encryption and decryption code
This article introduces "how to write VBS encryption and decryption" related knowledge, in the actual case operation process, many people will encounter such a dilemma, then let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!
I. encryption
The copy code is as follows:
Dim ObjectFSO
If (lcase (right (wscript.fullname,11)) = "wscript.exe") Then
WScript.Quit (0)
End If
If wscript.arguments.count0 Then
Contenu=Left (Contenu,DebutCode-1) & _
Decode (Mid (Contenu,DebutCode+12,FinCode-DebutCode-12-6)) & _
Mid (Contenu,FinCode+6)
End If
End If
End If
Loop Until FinCode=0
WScript.Echo Contenu
Else
WScript.Echo Nomfichier & "not found"
End If
Set fso=Nothing
Else
WScript.Echo "Please give a filename"
WScript.Echo "Usage:" & wscript.fullname & "& WScript.ScriptFullName &"
End If
Function Decode (Chaine)
Dim se,i,c,j,index,ChaineTemp
Dim tDecode (127C)
Const Combinaison= "123123233232132323112332132332113232311231321323112331123132"
Set se=WSCript.CreateObject ("Scripting.Encoder")
For iTunes 9 to 127
TDecode (I) = "JLA"
Next
For iTunes 9 to 127
ChaineTemp=Mid (se.EncodeScriptFile (".vbs", string (3Magi), 0, "), 13p3)
For jungle 1 to 3
C=Asc (Mid (ChaineTemp,j,1))
TDecode (c) = Left (tDecode (c), jmur1) & chr (I) & Mid (tDecode (c), jmur1)
Next
Next
'Next line we correct a bug, otherwise a ")" could be decoded to a ">"
TDecode (42) = Left (tDecode (42), 1) & ") & Right (tDecode (42), 1)
Set se=Nothing
Chaine=Replace (Replace (Chaine, "@ &", chr (10)), "@ #", chr (13)
Chaine=Replace (Replace (Chaine, "@ *", ">"), "@!"