rtn = RegCloseKey(hKey) 'close the key sBuffer = Trim(sBuffer) strPath = Left(sBuffer, Len(sBuffer) - 1) Else MsgBox "找到到SuperCapture的安装目录,不能自动注册!" End If Else MsgBox "你安装的SuperCapture可能版本不对,不能自动注册!" End If
FileNo = FreeFile(0) Open strPath + "\scconfig30.cfg" For Binary Access Write As FileNo Seek #FileNo, &H19D Put #FileNo, , RegNum Close FileNo MsgBox "注册完成,现在程序会打开SuperCatpure验证一下!请确定SuperCatpure现在没有运行!!" Shell strPath + "\SuperCapture.exe", vbNormalFocus End Sub
Private Sub Exit_Click() End End Sub
Private Sub Go_Click() Dim n, al As Integer Dim ebx As Long Dim Sn(1 To 16) As Long '生成的注册码 Dim StrSn As String '用于把注册码变成字符串
StrSn = "" ebx = 0
If Mid(UserNum.Text, 5, 1) <> "-" Or Mid(UserNum.Text, 10, 1) <> "-" Or Mid(UserNum.Text, 15, 1) <> "-" Then MsgBox "你的用户号不正确,请重新输入!!", vbCritical UserNum.Text = "" Exit Sub End If
If Len(UserNum.Text) = &H13 Then CreatEbp1 UserNum.Text '根据用户号生成表1
'表1的后8位依次加0至7,然后再分别平方,累加后存在ebx中 For n = 1 To 8 ebx = ebx + (Ebp1(n) + Ebp1(n + 8) + n - 1) * (Ebp1(n) + Ebp1(n + 8) + n - 1) Next n
CreatEbp2 '生成表2
'利用表1和表2,根据下列算式得出注册码 For n = 1 To 16 al = (((n * n + Ebp1(n)) * ebx) And &HFF) + Ebp2(n) al = al Mod &H1A Sn(n) = al + &H41