复制代码 代码如下:
dxy:
你好!
我学vbs也有一小段时间了,最近看到一本书上讲vbs脚本的加密,就自己试了试,可是有一点问题,低级的语法错误我都自己修正了,可脚本运行后不起作用.所以想请教你一下.脚本的原理是这样的:它把代码转换成16进制,然后再写个解密代码,通过这个解密来执行加密的代码,将字符串成16进制的代码如下:
Function str2hex (Byval strHex)
For i=1 to Len(strHex)
sHex = sHex & Hex(Asc(mid(strHex,i,1)))
next
str2Hex = sHex
end Function
解密的代码如下:
Function hextostr(data)
Hextostr = "Execute"""""
C= "&Chr(&H"
N= ")"
Do while Len(data)>1
if IsNumeric (Left(data,1)) then
Hextostr=Hextostr&c&Left(data,2)&N
data=mid(data,3)
else
Hextostr=HextoStr&C&Left(data,4)&N
data=mid(data,5)
end if
loop
end Function
解密代码好象有点问题,请帮忙指正,我实在找不出
整个成品就是:
on error resume next
set arg=wscript.arguement '声明外部参数
if arg.count=0 Then wscript.quit '若无参数则退出脚本
set fso=creatobject("Scripting.Filesystem Object") '声明fso组件
when fso.opentextfile(arg(0),1,flase)
data = readall:.close'读取文本内容
if err.number<>0 then wscript.quit '如果发生错误,则退出
with fso.opentextfile(arg(0)&"*.vbs",2,true) '将转换好的写到一个新的vbs中
if err.number<>0 then wscript.quit '如果发生错误,则退出
.writeline "Execute(Hextostr("""&str2hex(data)&"""))" '执行解密并执行解密后的代码
.writeline "Function hextostr(data)"
.writeline "Hextostr=""Execute"""""""""""
.writeline "C=""&CHR(&H"""
.writeline "N= )"
.writeline "Do while Len(data)>1"
.writeline "if IsNumeric (Left(data,1)) then"
.writeline "Hextostr=Hextostr&c&Left(data,2)&N"
.writeline "data = (data,3)"
.writeline "else"
.writeline "Hextostr=Hex to str&c&Left(data,4)&N"
.writeline "data=mid(data,5)"
.writeline "end if"
.writeline "loop"
.writeline "end function"
'把解密函数写进去
.close '关闭文本
set fso=Nothing'注销fso组件
end with
msgbox "OK"
'以下是加密函数
Function str2hex (Byval strHex)
For i=1 to Len(strHex)
sHex = sHex & Hex(Asc(mid(strHex,i,1)))
next
str2Hex = sHex
end function
'全部代码就到这了,好长~
书上说,把要加密的vbs脚本拖到这个脚本上就行了,不过我没有成功,不知道那里有问题,请帮帮我,谢谢~
上面的代码注意的几个情况:
1、set arg=wscript.arguements
后门有个s
2、set fso=creatobject("Scripting.Filesystem Object") '声明fso组件
应该是filesystemboject
3、.writeline "N= )"
对于需要输出N=")"用vbs输入"(双引号)的方法就是用两个""
.writeline "N="")"""
4、.writeline "data = (data,3)"这里少个mid
基本上就这些了
do.vbs保存为do.vbs ,将要加密的js文件拖到这个文件上就可以
复制代码 代码如下:
'on error resume next
set arg=wscript.arguments '声明外部参数
if arg.count=0 Then wscript.quit '若无参数则退出脚本
set fso=createobject("Scripting.FilesystemObject") '声明fso组件
filename=wscript.arguments(0)
set readline=fso.opentextfile(filename,1,flase)
data=readline.readall:
readline.close '读取文本内容
if err.number<>0 then wscript.quit '如果发生错误,则退出
with fso.opentextfile(filename&"_out.vbs",2,true) '将转换好的写到一个新的vbs中
if err.number<>0 then wscript.quit '如果发生错误,则退出
.writeline "Execute(Hextostr("""&str2hex(data)&"""))" '执行解密并执行解密后的代码
.writeline "Function hextostr(data)"
.writeline "Hextostr=""Execute"""""""""""
.writeline "C=""&CHR(&H"""
.writeline "N= "")"""
.writeline "Do while Len(data)>1"
.writeline "if IsNumeric (Left(data,1)) then"
.writeline "Hextostr=Hextostr&c&Left(data,2)&N"
.writeline "data = mid(data,3)"
.writeline "else"
.writeline "Hextostr=Hextostr&c&Left(data,4)&N"
.writeline "data=mid(data,5)"
.writeline "end if"
.writeline "loop"
.writeline "end function"
'把解密函数写进去
.close '关闭文本
end with
set fso=Nothing'注销fso组件
msgbox "OK"
'以下是加密函数
Function str2hex (Byval strHex)
For i=1 to Len(strHex)
sHex = sHex & Hex(Asc(mid(strHex,i,1)))
next
str2Hex = sHex
end function
vbs,脚本,加密
P70系列延期,华为新旗舰将在下月发布
3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。
而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?
根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。
更新日志
- 瑞鸣音乐《中国音乐地图之听见河南豫剧经典唱段》2020[WAV分轨]
- 【伊比萨沙发】VA-2024-IbizaSpring2024(LoungeCocktailsfromtheHeart)[FLAC]
- 群星《世界顶级汽车音响试音王》4K金碟16CD[WAV+CUE]
- 群星-音效环绕天碟《极致环绕人声天碟天品》7CD[WAV]
- 泰拉克SACD古典试音碟7SACD-ISO
- 群星《红歌宝典》20CD[WAV/分轨]
- 《101系列:好歌101首 细听年代精选》[WAV+CUE][3.6GB]
- 《101系列 6CD 国语经典101首歌曲 张学友 王菲代表作》[APE+CUE][2.8GB]
- 《101系列:国语经典101 VOL2 6CD 精选最经典101首》[WAV+CUE][2.3GB]
- 群星《十年网络红歌》15CD[WAV分轨]
- 宝丽金-环球10周年至50周年经典金曲15CD[低速原抓WAV+CUE]
- FIM唱片《十大男伶》[低速原抓WAV+CUE]
- 《101系列:情歌101 6CD》[WAV+CUE][3.1GB]
- 庄心妍《降调版合集》[320K/MP3][52.96MB]
- 庄心妍《降调版合集》[FLAC/分轨][118.78MB]