Board logo

标题: [原创] 【加密】VBS简易加密工具 [打印本页]

作者: batman    时间: 2011-6-19 02:46     标题: 【加密】VBS简易加密工具

本帖最后由 batman 于 2011-6-19 02:48 编辑

使用方法:将你的vbs拖到这个vbs上,就会在同目录下生成一个你的vbs名字_加密.vbs,双击可以正常运行,特点是加密效率很高,欢迎大家测试哈。。。
  1. Dim FSO, VbStr, Str, File, Name, Ext, Path
  2. If WScript.Arguments(0) = "" Then WScript.Quit
  3. File = WScript.Arguments(0)
  4. Set FSO = CreateObject("scripting.filesystemobject")
  5. Path = FSO.GetFile(File).ParentFolder & "\"
  6. Name = FSO.GetFile(File).Name
  7. Ext = FSO.GetExtensionName(File)
  8. Name = Replace(Name, "." & Ext, "")
  9. Str = "Dim FSO, SHELL, VbStr, Temp" & vbCrLf _
  10.   & "Set FSO = CreateObject(""scripting.filesystemobject"")" & vbCrLf _
  11.   & "Temp = FSO.GetSpecialFolder(2)" & vbCrLf _
  12.   & "VbStr = FSO.OpenTextFile(WScript.ScriptName).ReadLine" & vbCrLf _
  13.   & "VbStr = unescape(Mid(VbStr, 2, Len(VbStr)))" & vbCrLf _
  14.   & "FSO.OpenTextFile(Temp & """ & Name & "_temp.vbs"", 2 , True).Write VbStr" & vbCrLf _
  15.   & "CreateObject(""wscript.shell"").run Temp & """ & Name & "_temp.vbs"", True, True" & vbCrLf _
  16.   & "FSO.DeleteFile(Temp & """ & Name & "_temp.vbs"")" & vbCrLf _
  17.   & "Set FSO = Nothing"
  18. VbStr = FSO.OpenTextFile(File).ReadAll()
  19. VbStr = escape(VbStr)
  20. FSO.OpenTextFile(Path & Name & "_加密.vbs", 2, True).Write "'" & VbStr & vbCrLf & Str
  21. Set FSO = Nothing
  22. MsgBox "ok"
复制代码

作者: batman    时间: 2011-6-19 02:58

附上一个本人写的创建bathome桌面快捷方式vbs的加密版:
  1. 'Set%20ws%20%3D%20CreateObject%28%22WScript.Shell%22%29%0D%0ADesktopPath%20%3D%20ws.SpecialFolders%28%22Desktop%22%29%0D%0ASet%20url%20%3D%20ws.CreateShortcut%28DesktopPath%20%26%20%22%5Cbathome.url%22%29%0D%0Aurl.TargetPath%20%3D%20%22http%3A//www.bathome.net/%22%0D%0Aurl.Save%0D%0ASet%20url%20%3D%20Nothing%20%0D%0ASet%20ws%20%3D%20Nothing%20
  2. Dim FSO, SHELL, VbStr, Temp
  3. Set FSO = CreateObject("scripting.filesystemobject")
  4. Temp = FSO.GetSpecialFolder(2)
  5. VbStr = FSO.OpenTextFile(WScript.ScriptName).ReadLine
  6. VbStr = unescape(Mid(VbStr, 2, Len(VbStr)))
  7. FSO.OpenTextFile(Temp & "t_temp.vbs", 2 , True).Write VbStr
  8. CreateObject("wscript.shell").run Temp & "t_temp.vbs", True, True
  9. FSO.DeleteFile(Temp & "t_temp.vbs")
  10. Set FSO = Nothing
复制代码





欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2