vbs base64 解密脚本代码_vbs

复制代码 代码如下:

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

base64 测试代码:

复制代码 代码如下:

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
msgbox fDecode("d3d3LmpiNTEubmV0")

需要测试加密的代码的朋友可以访问 http://www.jb51.net/tools/base64.htm

时间: 2024-10-28 13:05:38

vbs base64 解密脚本代码_vbs的相关文章

VBS中常用脚本代码_vbs

将域用户或租添加到本地组 Set objGroup = GetObject("WinNT://./Administrators") Set objUser = GetObject("WinNT://testnet/Engineers") objGroup.Add(objUser.ADsPath) 修改本地管理员密码 Set objcnlar = GetObject("WinNT://./administrator, user") objcnla.

Vbs COM之打开/保存文件脚本代码_vbs

您先把如下的代码复制,然后保存为FileSave.vbs,双击打开,您看到了什么呢? 复制代码 代码如下: Set objDialog = CreateObject("SAFRCFileDlg.FileSave") Set fso = CreateObject("Scripting.FileSystemObject") objDialog.FileName = "test" objDialog.FileType = ".txt"

两个批量挂马vbs脚本代码_vbs

scan.vbe cscript scan.vbe web目录 程序代码: '版权信息 br="************************************" & vbCrLf br=br & "* VBS 批量挂马脚本 *" & vbCrLf br=br & "* BY BanLG *" & vbCrLf br=br & "**************************

vbs脚本大全,配有实例 DOS命令,批处理 脚本 代码_vbs

 VBS   取得本机IP strComputer = "."  Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set IPConfigSet = objWMIService.ExecQuery("Select IPAddress from Win32_NetworkAdapterConfiguration Where

vbs实现的eMule电驴自动关机脚本代码_vbs

Set fso = CreateObject("Scripting.FileSystemObject") Set ws = WScript.CreateObject("WScript.Shell") Count = 0 Do Until Count< -1     chksize = fso.GetFolder("C:\Program Files\eMule\Temp").Size     If chksize = 0 Then      

写个设置命令的VBS脚本代码_vbs

复制代码 代码如下: '作者:刘先勇 (Eric Liu) '将以下代码复制并保存为"系统命令.VBS",并运行安装. '安装成功后,可通过在程序.文件或文件夹上点右键->发送到->系统命令来设置一个命令,然后在运行中就可以输入该命令打开文件了. '脚本运行一次后在右键菜单中增加从这里运行CMD的快捷方式,还增加查找目标文件快捷方式 'On Error Resume Next If (lcase(right(wscript.fullname,11))<>&quo

利用vbs写的延时关闭ie进程的脚本代码_vbs

复制代码 代码如下: Delay = 5000 strComputer = "." Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set objStartup = objWMIService.Get("Win32_ProcessStartup"

用vbs实现的exe2swf工具脚本代码_vbs

复制代码 代码如下: dim AsoR,FlashFileName  Set ArgObj = WScript.Arguments  dim PositionStart,OKed,Tag,EndSize  PositionStart = 920000'flash 4的播放器的大致字节数  EndSize = 8    'exe文件结尾字节数,其它版本可以设置为0  FlashFileName = ArgObj(0)'传递路径  set AsoR=CreateObject("Adodb.Strea

WINDOWS脚本实践:为SAP补丁制作的VBS脚本代码_vbs

脚本主要功能包括: 注册表读取与修改  文件内容修改如HOSTS.SERVICES文件  文件属性修改和文件复制  系统环境变量设置  等,仅供参考  复制代码 代码如下: 'SAP设置脚本  '编写:SCZ 2005.04.20  '最后修改日期: 2005.04.22  '必须存在目录: BW(补丁文件) 和 登入界面  '========================================================================  '全局变量.处理过程