富贵资源网 Design By www.hznty.com

复制代码 代码如下:
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

富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com

《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线

暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。

艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。

《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。