ACTIVELOCK 1884
Boa tarde amigos,
Gostaria que alguém analisassem o código abaixo e descubra porque não gera a CHAVE de liberação.
Option Explicit
Dim mi_HashAlgorithm As Integer
Private Sub Command1_Click()
Dim F1 As Variant
Dim strKey As String
Dim strSoftwareName As String
Dim strSoftwarePassword As String
Dim strSoftwareCode As String
Dim intLiberationKeyLength As Integer
strSoftwarePassword = Me.Text(0)
strSoftwareName = Me.Text(4)
intLiberationKeyLength = Me.Text(1)
strSoftwareCode = Me.Text(2)
strKey = hash(strSoftwareName & strSoftwarePassword & strSoftwareCode)
strKey = UCase(Left(strKey, intLiberationKeyLength))
Text(3).Text = strKey
Text(3).SetFocus
Text(3).SelStart = 0
Text(3).SelLength = Len(Text(3).Text)
If Check1.Value = 1 Then
F1 = FreeFile
Open App.Path & [Ô]\[Ô] & Text(2).Text & [Ô].key[Ô] For Output As #F1
Print #F1, Text(3).Text
Close #F1
End If
SaveSetting [Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]SoftwareName[Ô], strSoftwareName
SaveSetting [Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]SoftwarePassword[Ô], strSoftwarePassword
SaveSetting [Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]LiberationKeyLength[Ô], intLiberationKeyLength
SaveSetting [Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]HashAlgorithm[Ô], mi_HashAlgorithm
End Sub
Private Function htSHA1AA1Hash(ByVal strHashThis As String)
End Function
Private Function htSHA1AA2Hash(ByVal strHashThis As String)
End Function
Private Function htMD5AA1Hash(ByVal strHashThis As String)
End Function
Private Function htMD5AA2Hash(ByVal strHashThis As String)
End Function
Private Function htMD5AB1Hash(ByVal strHashThis As String)
End Function
Private Function htMD5AB2Hash(ByVal strHashThis As String)
End Function
Private Function ht(ByVal strHashThis As String)
End Function
Private Function hash(ByVal strHashThis As String)
Select Case mi_HashAlgorithm
Case 0: hash = htSHA1AA1Hash(strHashThis)
Case 1: hash = htSHA1AA2Hash(strHashThis)
Case 2: hash = htMD5AA1Hash(strHashThis)
Case 3: hash = htMD5AA2Hash(strHashThis)
Case 4: hash = htMD5AB1Hash(strHashThis)
Case 5: hash = htMD5AB2Hash(strHashThis)
Case Else: hash = htSHA1AA1Hash(strHashThis) [ô]Default
End Select
End Function
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Dim strSoftwareName As String
Dim strSoftwarePassword As String
Dim strSoftwareCode As String
Dim intLiberationKeyLength As Integer, intHashAlgorithm As Integer
lblPanel = [Ô]Ronaldo Rodrigues Alcântara - 55 (028) 9 9935-0095[Ô]
strSoftwareName = GetSetting([Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]SoftwareName[Ô], [Ô]AppName[Ô])
strSoftwarePassword = GetSetting([Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]SoftwarePassword[Ô], [Ô]password[Ô])
intLiberationKeyLength = GetSetting([Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]LiberationKeyLength[Ô], 16)
intHashAlgorithm = GetSetting([Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]HashAlgorithm[Ô], 0)
intLiberationKeyLength = 16
Me.Text(0).Text = strSoftwarePassword
Me.Text(1).Text = intLiberationKeyLength
optHashAlgorithm(intHashAlgorithm) = True
End Sub
Private Sub optHashAlgorithm_Click(Index As Integer)
mi_HashAlgorithm = optHashAlgorithm(Index).Index
End Sub
Private Sub optHashAlgorithm_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys [Ô]{TAB}[Ô]
KeyAscii = 0
End If
End Sub
Private Sub optHashAlgorithm_KeyUp(Index As Integer, KeyCode As Integer, Shift As Integer)
Command1_Click
End Sub
Private Sub optHashAlgorithm_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1_Click
End Sub
Private Sub Text_GotFocus(Index As Integer)
Dim I
For I = 0 To Text.Count - 1
Text(I).SelStart = 0
Text(I).SelLength = Len(Text(I).Text)
Next I
End Sub
Private Sub Text_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys [Ô]{TAB}[Ô]
KeyAscii = 0
End If
End Sub
Gostaria que alguém analisassem o código abaixo e descubra porque não gera a CHAVE de liberação.
Option Explicit
Dim mi_HashAlgorithm As Integer
Private Sub Command1_Click()
Dim F1 As Variant
Dim strKey As String
Dim strSoftwareName As String
Dim strSoftwarePassword As String
Dim strSoftwareCode As String
Dim intLiberationKeyLength As Integer
strSoftwarePassword = Me.Text(0)
strSoftwareName = Me.Text(4)
intLiberationKeyLength = Me.Text(1)
strSoftwareCode = Me.Text(2)
strKey = hash(strSoftwareName & strSoftwarePassword & strSoftwareCode)
strKey = UCase(Left(strKey, intLiberationKeyLength))
Text(3).Text = strKey
Text(3).SetFocus
Text(3).SelStart = 0
Text(3).SelLength = Len(Text(3).Text)
If Check1.Value = 1 Then
F1 = FreeFile
Open App.Path & [Ô]\[Ô] & Text(2).Text & [Ô].key[Ô] For Output As #F1
Print #F1, Text(3).Text
Close #F1
End If
SaveSetting [Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]SoftwareName[Ô], strSoftwareName
SaveSetting [Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]SoftwarePassword[Ô], strSoftwarePassword
SaveSetting [Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]LiberationKeyLength[Ô], intLiberationKeyLength
SaveSetting [Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]HashAlgorithm[Ô], mi_HashAlgorithm
End Sub
Private Function htSHA1AA1Hash(ByVal strHashThis As String)
End Function
Private Function htSHA1AA2Hash(ByVal strHashThis As String)
End Function
Private Function htMD5AA1Hash(ByVal strHashThis As String)
End Function
Private Function htMD5AA2Hash(ByVal strHashThis As String)
End Function
Private Function htMD5AB1Hash(ByVal strHashThis As String)
End Function
Private Function htMD5AB2Hash(ByVal strHashThis As String)
End Function
Private Function ht(ByVal strHashThis As String)
End Function
Private Function hash(ByVal strHashThis As String)
Select Case mi_HashAlgorithm
Case 0: hash = htSHA1AA1Hash(strHashThis)
Case 1: hash = htSHA1AA2Hash(strHashThis)
Case 2: hash = htMD5AA1Hash(strHashThis)
Case 3: hash = htMD5AA2Hash(strHashThis)
Case 4: hash = htMD5AB1Hash(strHashThis)
Case 5: hash = htMD5AB2Hash(strHashThis)
Case Else: hash = htSHA1AA1Hash(strHashThis) [ô]Default
End Select
End Function
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Dim strSoftwareName As String
Dim strSoftwarePassword As String
Dim strSoftwareCode As String
Dim intLiberationKeyLength As Integer, intHashAlgorithm As Integer
lblPanel = [Ô]Ronaldo Rodrigues Alcântara - 55 (028) 9 9935-0095[Ô]
strSoftwareName = GetSetting([Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]SoftwareName[Ô], [Ô]AppName[Ô])
strSoftwarePassword = GetSetting([Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]SoftwarePassword[Ô], [Ô]password[Ô])
intLiberationKeyLength = GetSetting([Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]LiberationKeyLength[Ô], 16)
intHashAlgorithm = GetSetting([Ô]KeyGenerator[Ô], [Ô]Default[Ô], [Ô]HashAlgorithm[Ô], 0)
intLiberationKeyLength = 16
Me.Text(0).Text = strSoftwarePassword
Me.Text(1).Text = intLiberationKeyLength
optHashAlgorithm(intHashAlgorithm) = True
End Sub
Private Sub optHashAlgorithm_Click(Index As Integer)
mi_HashAlgorithm = optHashAlgorithm(Index).Index
End Sub
Private Sub optHashAlgorithm_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys [Ô]{TAB}[Ô]
KeyAscii = 0
End If
End Sub
Private Sub optHashAlgorithm_KeyUp(Index As Integer, KeyCode As Integer, Shift As Integer)
Command1_Click
End Sub
Private Sub optHashAlgorithm_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1_Click
End Sub
Private Sub Text_GotFocus(Index As Integer)
Dim I
For I = 0 To Text.Count - 1
Text(I).SelStart = 0
Text(I).SelLength = Len(Text(I).Text)
Next I
End Sub
Private Sub Text_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys [Ô]{TAB}[Ô]
KeyAscii = 0
End If
End Sub
Entendi, Mas o codigo trata-se do codigo fonte do KEYGENERATOR. A Parte do APP eu já fiz e está funcionando.
Só falta este KEY GENERATOR pra funcionar.
Só falta este KEY GENERATOR pra funcionar.
Me lembro que quando eu usava isso, existia mais de um projeto gerador na pasta. Veja se não existe outro projeto aÃ, ele tem um design até elegante.
Faça seu login para responder