当前位置: 首页 > 图文教程 > 脚本技术 > VBScript > vbs版的解密base64加密的脚本

VBScript
NYboy.vbs病毒源代码公布,我来模拟熊猫烧香
vbs脚本病毒生成器 下载
用vbs实现返回 IP 配置数据
mdir.vbs 建立隐藏虚拟目录的vbs
改进后的mkw3site.vbs(创建虚拟目录)
charCodeAt与AscW函数的区别说明
vbs中Empty和Null的区别
用vbs将名称转换为正确的大小写的代码
用vbs实现更改计算机的说明的代码
vbs中使用 ADO 读取所有数据均在一行上的文本文件的代码
用vbs检测Internet Explorer 中是否启用了 ActiveX
在vbs运行命令行工具后让命令窗口保持打开状态的脚本
用vbs读取远程计算机上的文本文件的代码
用vbs从本地 Administrators 组中删除组
用vbs删除前一天创建的备份文件
不错的一篇VBS-JSCRIPT GETOBJECT理解
VBS ArrayList Class vbs中的数组类
如何调试JScript/VBScript的方法
如何通过计划任务调用QuickTest测试脚本
用vbs实现按创建日期的顺序列出一个文件夹中的所有文件

VBScript 中的 vbs版的解密base64加密的脚本


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-11   浏览: 85 ::
收藏到网摘: n/a

复制代码 代码如下:

Function fDecode(sStringToDecode)
'This function will decode a Base64 encoded string and returns the decoded string.
'This becomes usefull when attempting to hide passwords from prying eyes.
Const CharList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Dim iDataLength, sOutputString, iGroupInitialCharacter
sStringToDecode = Replace(Replace(Replace(sStringToDecode, vbCrLf, ""), vbTab, ""), " ", "")
iDataLength = Len(sStringToDecode)
If iDataLength Mod 4 <> 0 Then
fDecode = "Bad string passed to fDecode() function."
Exit Function
End If
For iGroupInitialCharacter = 1 To iDataLength Step 4
Dim iDataByteCount, iCharacterCounter, sCharacter, iData, iGroup, sPreliminaryOutString
iDataByteCount = 3
iGroup = 0
For iCharacterCounter = 0 To 3
sCharacter = Mid(sStringToDecode, iGroupInitialCharacter + iCharacterCounter, 1)
If sCharacter = "=" Then
iDataByteCount = iDataByteCount - 1
iData = 0
Else
iData = InStr(1, CharList, sCharacter, 0) - 1
If iData = -1 Then
fDecode = "Bad string passed to fDecode() function."
Exit Function
End If
End If
iGroup = 64 * iGroup + iData
Next
iGroup = Hex(iGroup)
iGroup = String(6 - Len(iGroup), "0") & iGroup
sPreliminaryOutString = Chr(CByte("&H" & Mid(iGroup, 1, 2))) & Chr(CByte("&H" & Mid(iGroup, 3, 2))) & Chr(CByte("&H" & Mid(iGroup, 5, 2)))
sOutputString = sOutputString & Left(sPreliminaryOutString, iDataByteCount)
Next
fDecode = sOutputString
End Function