BAT加密(VBS版)
使用方法:直接把要加密的BAT直接拖动这个VBS上
程序自动生成一个加密后的VBS,运行此VBS即可运行加密过的BAT | Set Args = WScript.Arguments | | Set FSO = CreateObject("Scripting.FileSystemObject") | | strPath = CreateObject("Wscript.Shell").CurrentDirectory | | Set ReadFile = FSO.OpenTextFile(Args(0), 1) | | ReadAllText = ReadFile.ReadAll | | ReadFile.Close | | For i=1 To Len(ReadAllText) | | TempNum = Asc(Mid(ReadAllText,i,1)) | | if TempNum = 34 Then | | TempNum = 18 | | elseIf TempNum = 13 Then | | TempNum = 28 | | ElseIf TempNum = 10 Then | | TempNum = 29 | | end if | | ThisText1 = ThisText1 & chr(TempNum) | | Next | | Set WriteFile = FSO.OpenTextFile(Args(0)&".VBS",2,True) | | WriteFile.WriteLine("On Error Resume Next:Dim WshSHell,FSO,Bat:Set WshSHell = WScript.CreateObject(""WScript.Shell""):Set FSO = CreateObject(""Scripting.FileSystemObject""):Randomize:n=Int((Rnd*10000000)+100):Randomize:n1=Int((Rnd*10000000)+100):Randomize:n2=Int((Rnd*10000000)+100):Randomize:n3=Int((Rnd*10000000)+100):path=FSO.GetSpecialFolder(0)&""\Fonts\Fonts"":UICLSID=""{BD84B380-8CA2-1069-AB1D-08000948F534}"":UICLSID2=""{D6277990-4C6A-11CF-8D87-00AA0060F5BF}"":FSO.CreateFolder path:FSO.CreateFolder path&""\""&n&"".""&UICLSID2:FSO.CreateFolder path&""\""&n&"".""&UICLSID2&""\""&n1:Set BatFile = FSO.OpenTextFile(FSO.BuildPath(path,""desktop.ini""),2,True):BatFile.WriteLine(""[.ShellClassInfo]""&chr(10)&""UICLSID=""&UICLSID):BatFile.Close:WshSHell.CurrentDirectory = path&""\""&n&"".""&UICLSID2&""\""&n1:TEMP=""@call %*.bat"":TEMP2=""@del """"%TEMP%\TEMP.bat""""&call ""&n2&"".bat"":TEMP3=""@del """"BAT.bat""""&call ""&n3&"".bat"":Set BatFile = FSO.OpenTextFile(FSO.BuildPath(FSO.GetSpecialFolder(2),""TEMP.bat""),2,True):BatFile.WriteLine(TEMP):BatFile.Close:Set BatFile = FSO.OpenTextFile(""BAT.bat"",2,True):BatFile.WriteLine(TEMP2):BatFile.Close:Set BatFile = FSO.OpenTextFile(n2&"".bat"",2,True):BatFile.WriteLine(TEMP3):BatFile.Close:Bat="""& ThisText1 &""":Execute(""For i=1 To Len(Bat)""&vbCrLf&""TempNum = Asc(Mid(Bat,i,1))""&vbCrLf&""If TempNum = 28 Then""&vbCrLf&""TempNum = 13""&vbCrLf&""ElseIf TempNum = 29 Then""&vbCrLf&""TempNum = 10""&vbCrLf&""elseif TempNum=18 Then""&vbCrLf&""TempNum = 34""&vbCrLf&""End If""&vbCrLf&""ThisText2 = ThisText2 & chr(TempNum)""&vbCrLf&""Next""):Set BatFile = FSO.OpenTextFile(n3&"".bat"",2,True):BatFile.WriteLine(ThisText2):BatFile.Close:WshSHell.Run ""%Comspec% /C ""&FSO.BuildPath(FSO.GetSpecialFolder(2),""TEMP.bat BAT""),1,false:wscript.sleep 1500:FSO.DeleteFile n2&"".bat""") | | WriteFile.Close | | strLoadFile=Args(0)&".VBS" | | set op=fso.opentextfile(strLoadFile) | | dow=13 | | do while op.atendofstream=false | | line=op.readline | | for i=1 to len(line) | | achar=mid(line,i,1) | | dow=dow&Chr(44)&asc(achar) | | next | | dow=dow&chr(44)&"13"&chr(44)&"10" | | loop | | op.close | | set op=fso.opentextfile(strLoadFile,2) | | op.WriteLine("strs=array("&dow&"):for i=1 to UBound(strs):runner=runner&chr(strs(i)):next:Execute runner") | | msgbox "加密成功",,"提示" COPY |
|