you probably all know those program that ask you for a activation code after the trail has expirered. I made one that give you a product ID (random number, but stays the same unless you clean your regestry) On base of that prodict ID you must enter a password to register (the ID is like the encrypted password).
Be easy on me (I am still pretty new to autoit)
CODE;looks if you already registered
IF RegRead("HKCU\SOFTWARE\Test","Testkey") = "%ncDe4Be" Then
MsgBox(64,"","already registered")
Exit
EndIf
;if no regestry is made, a new one will be made.
IF RegRead("HKCU\SOFTWARE\Test","Testkey") = "" Then
;generates a random code: 16^7^2 posibilities
$key = Random(0,10^7,1)
$key2 = Random(0,10^7,1)
RegWrite("HKCU\SOFTWARE\Test", "TestKey", "REG_DWORD", $key)
RegWrite("HKCU\SOFTWARE\Test", "TestKey2", "REG_DWORD", $key2)
EndIf
;generates a activation code out of the regkey
$regkey = RegRead("HKCU\SOFTWARE\Test","Testkey")
$regkey2 = RegRead("HKCU\SOFTWARE\Test","Testkey2")
$code = ""
For $i = 1 to 14
$code = $code & StringMid("pSQFiH1ZYCyzImEur3bcJLkP9twXVeN257DGqxTUnvlMh4sB6fj8KaCgAdRWbvfstdghBFOSHFBSGF739gdnflBGFLOSB68
36g4D",(StringMid($Regkey,$i,1))&(StringMid($Regkey2,$i,1)),1)
Next
;asks you for the activation code
$input = InputBox("Enter Activation code","Product ID : " & $regkey & "-" & $regkey2, "")
;compares input with activation code
If $input = $code Then
MsgBox(64,"","Then Activation code is correct")
RegWrite("HKCU\SOFTWARE\Test", "TestKey", "REG_DWORD", "%ncDe4Be")
Else
MsgBox(64,"","sorry, Activation code incorrect")
EndIf
Just in case you cant crack the code:
CODE;if already registerd it removes the regestry (for testing purposes)
IF RegRead("HKCU\SOFTWARE\Test","Testkey") = "%ncDe4Be" Then
RegDelete("HKCU\SOFTWARE\Test","Testkey")
Exit
EndIf
;generates a activation code out of the regkey
;for now it read directly from the regestry, but probably you want people to type in the code
;$key = InputBox("","Enter first code")
;$key2 = InputBox("","Enter Second code")
$regkey = RegRead("HKCU\SOFTWARE\Test","Testkey")
$regkey2 = RegRead("HKCU\SOFTWARE\Test","Testkey2")
$code = ""
For $i = 1 to 14
$code = $code & StringMid("pSQFiH1ZYCyzImEur3bcJLkP9twXVeN257DGqxTUnvlMh4sB6fj8KaCgAdRWbvfstdghBFOSHFBSGF739gdnflBGFLOSB68
36g4D",(StringMid($Regkey,$i,1))&(StringMid($Regkey2,$i,1)),1)
Next
MsgBox(64,"","activation code : " & $code)