VBS加密:
复制以下代码,用记事本另存为,“VBS加密” 保存。
set fso=createobject("scripting.filesystemobject")
scf=inputbox("请输入要加密的脚本文件名","VBS加密程序","*.vbs")
set op=fso.opentextfile(scf)
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(scf,2)
op.write "strs=array("&dow&")"&chr(13)&chr(10)&_
"for i=1 to UBound(strs)"&chr(13)&chr(10)&_
" runner=runner&chr(strs(i))"&chr(13)&chr(10)&_
"next"&chr(13)&chr(10)&_
"Execute runner"
VBS解密
复制以下代码,用记事本另存为,“VBSVBS解密” 保存。
on error resume next
set fso=createobject("scripting.filesystemobject")
set ws=createobject("wscript.shell")
Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.Filter = "vbs File|*.vbs|All Files|*.*"
objDialog.InitialDir = ""
objDialog.ShowOpen
strLoadFile = objDialog.FileName
if not strLoadFile = "" then
set file=fso.opentextfile(strLoadFile,1)
all=file.readall
file.close
s=instr(1,all,"next")
alls=mid(all,1, s+3 )
set file=fso.createtextfile(strLoadFile,8,true)
file.write alls
file.writeline empty
file.writeline"set fso=createobject("&""""&"scripting.filesystemobject"&""""&")"
file.writeline"set file=fso.createtextfile(wscript.scriptfullname,8,true)"
file.writeline"file.write runner"
file.writeline"file.close"
file.close
ws.run""""&strLoadFile&"""",0,true
msgbox"解密成功!",4096+64
end if