vbs版的解密base64加密的腳本
更新時間:2008年02月22日 16:03:21 作者:
vbs版的解密base64加密的腳本
復(fù)制代碼 代碼如下:
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
vbs代碼打包
相關(guān)文章
讓IIS建立的站點默認(rèn)是.net 2.0的,而不是.net 1.1的代碼
讓IIS建立的站點默認(rèn)是.net 2.0的,而不是.net 1.1的,沒有使用WMI,所以在操作前先得停止IIS相關(guān)服務(wù)2008-07-07
獲取外網(wǎng)IP并發(fā)送到指定郵箱的vbs代碼[已測]
如名稱所見,獲取外網(wǎng)IP并發(fā)送到指定郵箱,這個腳本比較短小,但不如腳本之家提供的au3腳本功能強大,不過每次電腦開機記錄一下還是不錯的2012-05-05
使用 Iisext.vbs 列出 Web 服務(wù)擴展文件的方法
這篇文章主要介紹了如何使用 iisext.vbs 在本地或遠(yuǎn)程計算機上列出 Web 服務(wù)擴展文件,需要的朋友可以參考下2014-07-07
VBS教程:函數(shù)-WeekDayName 函數(shù)
VBS教程:函數(shù)-WeekDayName 函數(shù)...2006-11-11

