Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °
| |
|
|
You are not logged in. #1 2007-07-28 11:31:06
Useless, simple VB programI recently wrote a relatively simple program that imitates your standard installer program. There are four screens to it: the first one, where you have to enter the "CD Code", which is verified in a way that makes it very difficult to deduct, from the code, what the code is. The next window just displays a "Serial Number". The next one asks you what file you want to "modify", either by typing in the path, or by click on the "browse" button. The last part just has two progress bars that "fill up" at a random speed; the upper one moves at 1/100 of the speed of the other. Code:Private Sub Command1_Click()
Dim check As Variant
Dim checks As String
Dim fh As Integer
Dim countercheck As String
Dim filetext As String
On Error GoTo eh
fh = FreeFile
Open "C:\CDtest1.txt" For Input As #fh
Input #fh, filetext
Close #fh
Dim passer As Variant
For passer = 1 To Int(Len(filetext) / 5)
countercheck = countercheck & Int(Mid(filetext, (passer * 5) - 4, 2) - Asc(Mid(Text1.Text, Int(passer Mod Int(Len(Text1.Text) - 1) + 1), 1)))
Next
For check = 1 To 26
If IsNumeric(Mid(Text1.Text, check, 1)) = False Then
checks = checks & Asc(Mid(Text1.Text, check, 1))
Else
checks = checks & Mid(Text1.Text, check, 1)
End If
Next
If checks = filetext Then
Frame1.Visible = False
Frame2.Visible = True
Else
MsgBox "Incorrect code"
Text1.Text = ""
Command1.Enabled = False
End If
Exit Sub
eh:
MsgBox "Problem: " & Err.Description
Close #fh
End SubThere is no longer a single key that will pass the test. Now, you need another program will both generate a key for you, and write an encrypted file containing the info that the above code needs in order to verify what you type in. Last edited by Laterally Speaking (2007-08-01 01:34:33) "Knowledge is directly proportional to the amount of equipment ruined." "This woman painted a picture of me; she was clearly a psychopath" #2 2007-07-29 18:33:07
Re: Useless, simple VB program
Doesn't the key have to have 25 characters not 26? Because most keys on CD's that software installed have 25 characters instead of 26. Last edited by Mathskido (2007-07-29 18:40:09) High score in SAT's at the end of Year 6, Virgo, D'oh!, www.freewebs.com/roadster96[img]http://images.ugoto.com/icons/archive/animals/cat.gif[/img] [img]C:\Documents and Settings\Alex\Desktop\Stuff\Pictures[/img] #3 2007-07-30 03:23:17
Re: Useless, simple VB programHaving codes like this directly in programs is dangerous. It is very easy to disassemble such a program and find such codes. It's much better to construct the codes from pieces, or even better, calculate the code using some form of operations. "In the real world, this would be a problem. But in mathematics, we can just define a place where this problem doesn't exist. So we'll go ahead and do that now..." #4 2007-07-30 04:50:02
Re: Useless, simple VB programI wrote my program that generates and encrypts keys, then writes the result to a file, such that the above code may read it for comparison. Last edited by Laterally Speaking (2007-08-04 03:47:50) "Knowledge is directly proportional to the amount of equipment ruined." "This woman painted a picture of me; she was clearly a psychopath" |