How do they do it?
How can there be multiple good serial numbers for a piece of software (ie: Windows) that will register the product?
Is it some form of math?

Yep, and there are various ways to achieve that, a very simple example would beRook Zimbabwe wrote:Is it some form of math?
Like 7 on old ms productsmilan1612 wrote:a very simple example would be that every single serial number has a specific cross sum.
Code: Select all
;Return a random number in a specified range
Procedure RandomFromRange(Maximum.l, Minimum.l)
ProcedureReturn Maximum - Random(Maximum - Minimum)
EndProcedure
CreateFile(1, "Serial Numbers.txt")
For x = 1 To 1000
For y = 1 To 4
Serial.s + Chr(RandomFromRange(90, 65))
Next y
Serial + "-"
For y = 1 To 4
Serial.s + Chr(RandomFromRange(90, 65))
Next y
Serial + "-"
For y = 1 To 4
Serial.s + Chr(RandomFromRange(90, 65))
Next y
Serial + "-"
For y = 1 To 4
Serial.s + Chr(RandomFromRange(90, 65))
Next y
WriteStringN(1, Serial)
Serial = ""
Next x
CloseFile(1)
Code: Select all
x.l = 0
ReadFile(1, "Serial Numbers.txt")
CreateFile(2, "Serial MD5s.pbi")
WriteStringN(2, "Dim ValidCodes.s(999)")
Repeat
String.s = ReadString(1)
WriteStringN(2, "ValidCodes("+Str(x)+") = " + Chr(34) + MD5Fingerprint(@String, Len(String)) + Chr(34))
x+1
Until Loc(1) = Lof(1)
CloseFile(2)
CloseFile(1)
Code: Select all
EnableExplicit
Procedure.s CreateSN(CrossSum.l)
Protected Dim Fields.s(4), i.l, j.l, Temp.s, Digit.l, Cross.l
While Cross <> CrossSum
Cross = 0
For i = 0 To 4
For j = 0 To 4
Digit = Random(9)
Temp + Str(Digit)
Cross + Digit
Next
Fields(i) = Temp
Temp = ""
Next
Wend
ProcedureReturn Fields(0)+"-"+Fields(1)+"-"+Fields(2)+"-"+Fields(3)+"-"+Fields(4)
EndProcedure
Procedure CheckSN(SN.s, CrossSum.l)
Protected *C.Character = @SN, Cross.l
While *C\c
Select *C\c
Case '-' ;do nothing
Case '0' To '9'
Cross + Val(Chr(*C\c))
Default
ProcedureReturn 0
EndSelect
*C + SizeOf(Character)
Wend
If Cross = CrossSum
ProcedureReturn 1
EndIf
EndProcedure
;You can freely choose your desired "magic" cross sum - but it should be between ~100 to ~200!
Define t, sn.s
For t = 1 To 50
sn = CreateSN(140)
Debug sn
Debug CheckSN(sn, 140)
Debug ""
Next
Yup, the old MS CD-Keys that looked like this: 123-1234567 only needed the last seven digits to add up to a multiple of seven (7, 14, 21, 28, etc.) for it to work. FWIW: The first three numbers were used to determine the region it was supposed to be sold in.ts-soft wrote:Like 7 on old ms products
A better approach here would be to find the serial number that's being passed around and replace it's hash in the array with a new one.Kale wrote:If you ever feel like any serials are doing the rounds on any various warez site just run your serial generating program again and recompile your app and it now has 1000 new serials and the old ones won't work with your newly compiled exe.
A crack is actually better. They are usually distributed as a patch (especially if the original file is large) which can easily be defeated by rearranging some of the functions in your source code and re releasing.PB wrote:I suppose a keygen is better as it can be made useless with updates to your app, as you mentioned. But that still won't stop someone distributing X version of your app with Y keygen.
Yes, thats why i said 'This form can still be cracked by a competent cracker', they just NOP out the check. All protection will and can be cracked, i just make sure no casual copying takes place and that's ok for me.PB wrote:> If there's a match, you know it's genuine But this is where the crackers "crack" your app; they just code out the check so that any serial works without being tested.