吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 5371|回复: 7
收起左侧

[其他转载] [转载]VB写的QQ专用base64解密模块

 关闭 [复制链接]
M0nster 发表于 2008-12-18 11:33
信息来源:邪恶八进制信息安全团队(www.eviloctal.com
文章作者:monster
网络首发作者BLG:http://hi.baidu.com/suphack
欢迎转载,但请著名原始出处
Option Explicit


Public Function Base64Decode(cString As String) As String   'QQ版Base64解码
   Dim dStr As String, tStr As String
   Dim i As Integer
   Dim l As Integer
   l = Len(cString) - 2           '减去两个等号的空间(不减也行)
   For i = 1 To l
     dStr = HexBase64_1(Mid(cString, i, 1))
     tStr = tStr & Hex2Bin(Left(dStr, 1)) & Hex2Bin(Right(dStr, 1))
   Next i
   l = Len(tStr)
   dStr = ""
   For i = 3 To l Step 8
     dStr = dStr & Mid(tStr, i, 6)
   Next i
   l = Len(dStr)
   For i = 1 To l Step 4
     Base64Decode = Base64Decode & Bin2Hex(Mid(dStr, i, 4))
   Next i
   If Len(Base64Decode) > 32 Then Base64Decode = Left(Base64Decode, 32)
End Function

Private Function Bin2Hex(BinStr1 As String) As String
  Select Case BinStr1
   '2进制转换16进制
    Case "0000": Bin2Hex = "0"
    Case "0001": Bin2Hex = "1"
    Case "0010": Bin2Hex = "2"
    Case "0011": Bin2Hex = "3"
    Case "0100": Bin2Hex = "4"
    Case "0101": Bin2Hex = "5"
    Case "0110": Bin2Hex = "6"
    Case "0111": Bin2Hex = "7"
    Case "1000": Bin2Hex = "8"
    Case "1001": Bin2Hex = "9"
    Case "1010": Bin2Hex = "a"
    Case "1011": Bin2Hex = "b"
    Case "1100": Bin2Hex = "c"
    Case "1101": Bin2Hex = "d"
    Case "1110": Bin2Hex = "e"
    Case "1111": Bin2Hex = "f"
  End Select
End Function

Private Function Hex2Bin(HexStr1 As String) As String
  Select Case UCase(HexStr1)
    '16进制转换二进制
    Case "0": Hex2Bin = "0000"
    Case "1": Hex2Bin = "0001"
    Case "2": Hex2Bin = "0010"
    Case "3": Hex2Bin = "0011"
    Case "4": Hex2Bin = "0100"
    Case "5": Hex2Bin = "0101"
    Case "6": Hex2Bin = "0110"
    Case "7": Hex2Bin = "0111"
    Case "8": Hex2Bin = "1000"
    Case "9": Hex2Bin = "1001"
    Case "A": Hex2Bin = "1010"
    Case "B": Hex2Bin = "1011"
    Case "C": Hex2Bin = "1100"
    Case "D": Hex2Bin = "1101"
    Case "E": Hex2Bin = "1110"
    Case "F": Hex2Bin = "1111"
  End Select
End Function

Private Function HexBase64_1(HexString As String) As String
    Select Case HexString
        Case "A": HexBase64_1 = "00"
        Case "B": HexBase64_1 = "01"
        Case "C": HexBase64_1 = "02"
        Case "D": HexBase64_1 = "03"
        Case "E": HexBase64_1 = "04"
        Case "F": HexBase64_1 = "05"
        Case "G": HexBase64_1 = "06"
        Case "H": HexBase64_1 = "07"
        Case "I": HexBase64_1 = "08"
        Case "J": HexBase64_1 = "09"
        Case "K": HexBase64_1 = "0A"
        Case "L": HexBase64_1 = "0B"
        Case "M": HexBase64_1 = "0C"
        Case "N": HexBase64_1 = "0D"
        Case "O": HexBase64_1 = "0E"
        Case "P": HexBase64_1 = "0F"
        Case "Q": HexBase64_1 = "10"
        Case "R": HexBase64_1 = "11"
        Case "S": HexBase64_1 = "12"
        Case "T": HexBase64_1 = "13"
        Case "U": HexBase64_1 = "14"
        Case "V": HexBase64_1 = "15"
        Case "W": HexBase64_1 = "16"
        Case "X": HexBase64_1 = "17"
        Case "Y": HexBase64_1 = "18"
        Case "Z": HexBase64_1 = "19"
        Case "a": HexBase64_1 = "1A"
        Case "b": HexBase64_1 = "1B"
        Case "c": HexBase64_1 = "1C"
        Case "d": HexBase64_1 = "1D"
        Case "e": HexBase64_1 = "1E"
        Case "f": HexBase64_1 = "1F"
        Case "g": HexBase64_1 = "20"
        Case "h": HexBase64_1 = "21"
        Case "i": HexBase64_1 = "22"
        Case "j": HexBase64_1 = "23"
        Case "k": HexBase64_1 = "24"
        Case "l": HexBase64_1 = "25"
        Case "m": HexBase64_1 = "26"
        Case "n": HexBase64_1 = "27"
        Case "o": HexBase64_1 = "28"
        Case "p": HexBase64_1 = "29"
        Case "q": HexBase64_1 = "2A"
        Case "r": HexBase64_1 = "2B"
        Case "s": HexBase64_1 = "2C"
        Case "t": HexBase64_1 = "2D"
        Case "u": HexBase64_1 = "2E"
        Case "v": HexBase64_1 = "2F"
        Case "w": HexBase64_1 = "30"
        Case "x": HexBase64_1 = "31"
        Case "y": HexBase64_1 = "32"
        Case "z": HexBase64_1 = "33"
        Case "0": HexBase64_1 = "34"
        Case "1": HexBase64_1 = "35"
        Case "2": HexBase64_1 = "36"
        Case "3": HexBase64_1 = "37"
        Case "4": HexBase64_1 = "38"
        Case "5": HexBase64_1 = "39"
        Case "6": HexBase64_1 = "3A"
        Case "7": HexBase64_1 = "3B"
        Case "8": HexBase64_1 = "3C"
        Case "9": HexBase64_1 = "3D"
        Case "+": HexBase64_1 = "3E"
        Case "/": HexBase64_1 = "3F"
    End Select
End Function

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

261001126 发表于 2008-12-18 20:37
貌似我写过一个小工具,也用到这个,不过他这个更简洁一些
GetQQ
popo2008 发表于 2008-12-18 20:51
Richer 发表于 2008-12-19 20:20
cnshark 发表于 2009-9-27 01:16
这个屌,哈哈,好东西
零下八度 发表于 2009-9-30 19:05
不知道效果怎么样
hack0215 发表于 2010-3-4 12:45
试试 效果去
千灵紫皇 发表于 2010-11-21 14:24
用了试试,好的话再顶
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-17 01:36

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表