How to use vbs to implement XorEncode
Editor to share with you how to use vbs to achieve XorEncode, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The code is as follows:
If Not WScript.Arguments.Count=1 Then WScript.Echo "Please drag the vbs file to be converted to me!" WScript.Quit Set fso=CreateObject ("Scripting.FileSystemObject") Set self=fso.OpenTextFile (WScript.ScriptFullName) Set vbs=fso.CreateTextFile (Left (WScript.Arguments (0), Len (WScript.Arguments (0)-4) + "_ XorEncode.vbs") Do Until self.AtEndOfStream aline=self.ReadLine If aline= "Function Decode (s) N) "Then w=true If w Then vbs.WriteLine aline Loop Set src=fso.OpenTextFile (WScript.Arguments (0)) Randomize:n=Int (255*Rnd+1) vbs.WriteLine" Execute ("&" Decode ("& Encode (src.Read (fso.GetFile (WScript.Arguments (0)) .size), n) &"," & n & ")" src.Close:vbs.Close:self.Close Set src=Nothing:Set vbs=Nothing:Set self=Nothing:Set fso=Nothing WScript.Echo "Successful!" Function Encode (Next End Function Function Decode n) For iMagne1 To Len (s) Encode=Encode& "& (Asc (Mid (s)) Xor n) Next End Function Function Decode (s) ns=Split (Mid (s)-1) For iMagne 0 To UBound (ns) Decode=Decode&Chr (CInt (ns (I) Xor n) Next End Function is all the content of this article" how to use vbs to achieve XorEncode ", thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!