此工具为存储过程解密工具6.0的注册机
下载地址http://www.xunxin.cn/,为在线免费注册方式.
附注册机代码
Private Sub cmd获取注册码_Click()
If Me.txtUserMID.Text <> "" Then
If Len(Trim(Me.txtUserMID.Text)) <> "29" Then
MsgBox "机器码长度不为29位"
Else
Me.txtPassWd.Text = getSerialNo
End If
Else
MsgBox "请输入机器码"
End If
End Sub
Private Function getSerialNo() As String
On Err GoTo PrintErr
Dim n As Long
n = &H7BE
Dim MNo As String
MNo = Me.txtUserMID.Text
Dim tmp As String
tmp = ""
Dim I As Integer
For I = 1 To Len(Me.txtUserMID.Text)
Dim strChar As String
strChar = Right(Left(MNo, I), 1)
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Long
d = n
a = "&h" & Hex(BinaryToDecimal(Left(DecimalToBinary(d, 16), Len(DecimalToBinary(d, 16)) - 8)))
b = "&h" & Hex(Asc(strChar))
c = a Xor b
tmp = tmp & Chr(c)
n = n + CInt(b) + 100
Next
getSerialNo = tmp
Exit Function
PrintErr:
MsgBox Err.Description
Exit Function
End Function
''''以下VB函数可以完成十进制转换二进制的工作。另外,这个函数还加入了对二进制长度的判断,如果转换出来的二进制长度低于最小值,函数会自动在二进制字符串前补0。
Public Function DecimalToBinary(DecimalValue As Long, MinimumDigits As Integer) As String
' Returns a string containing the binary
' representation of a positive integer.
Dim result As String
Dim ExtraDigitsNeeded As Integer
' Make sure value is not negative.
DecimalValue = Abs(DecimalValue)
' Construct the binary value.
Do
result = CStr(DecimalValue Mod 2) & result
DecimalValue = DecimalValue \ 2
Loop While DecimalValue > 0
' Add leading zeros if needed.
ExtraDigitsNeeded = MinimumDigits - Len(result)
If ExtraDigitsNeeded > 0 Then
result = String(ExtraDigitsNeeded, "0") & result
End If
DecimalToBinary = result
End Function
'以下代码完成二进制到十进制的转换:
Public Function BinaryToDecimal(BinaryValue As String) As Long
' Returns the decimal equivalent of a binary number.
Dim idx As Integer
Dim tmp As String
Dim result As Long
Dim digits As Integer
digits = Len(BinaryValue)
For idx = digits To 1 Step -1
tmp = Mid(BinaryValue, idx, 1)
If tmp = "1" Then result = result + 2 ^ (digits - idx)
Next