zsx's Old Blog

黑历史逐步隐藏中_(:з」∠)_仅保留部分可能有些价值的文章,并不保证将来的可访问性。

ASP 解密Base64处理过的文件

'利用XML对BASE64进行解压
Function UnpackBase64(Base64Code,savePath)
    Dim tmpXMLData
    tmpXMLData="<?xml version=""1.0"" encoding=""utf-8""?><file><stream xmlns:dt=""urn:schemas-microsoft-com:datatypes"" dt:dt=""bin.base64"">"&Base64Code&"</stream></file>"
      
    Dim objXmlFile
    Dim objNodeList
    Dim objStream
    Dim i, j
    Set objXmlFile = CreateObject("Microsoft.XMLDOM")
        objXmlFile.async = False
        objXmlFile.ValidateOnParse = False
            objXmlFile.LoadXML (tmpXMLData)
            If objXmlFile.readyState <> 4 Then
                response.write "error"
            Else
                If objXmlFile.parseError.errorCode <> 0 Then
                    response.write "error"
                Else
                    Set objNodeList = objXmlFile.documentElement.selectNodes("//file/stream")
                            j = objNodeList.length - 1
                            For i = 0 To j
                                Set objStream = CreateObject("ADODB.Stream")
                                    With objStream
                                        .Type = 1
                                        .Open
                                        .Write objNodeList(i).nodeTypedvalue
                                        .SaveToFile savePath, 2
                                        .Close
                                    End With
                                Set objStream = Nothing
                            Next
                        Set objNodeList = Nothing
                    End If
                End If
            Set objXmlFile = Nothing
        UnpackBase64=True
End Function


控制面板
您好,欢迎到访网站!
  查看权限
Google Adsense
文章归档
站点信息
  • 文章总数:259
  • 页面总数:10
  • 分类总数:17
  • 标签总数:136
  • 评论总数:1644
  • 浏览总数:216659

Powered By Z-BlogPHP 1.5.1 Zero

闽ICP备15006942号   闽公网安备 35010302000147号