Skip to content

Instantly share code, notes, and snippets.

@praswicaksono
Created November 24, 2014 04:29
Show Gist options
  • Select an option

  • Save praswicaksono/b25fff4045aa80c78108 to your computer and use it in GitHub Desktop.

Select an option

Save praswicaksono/b25fff4045aa80c78108 to your computer and use it in GitHub Desktop.
NetSarang Xmanager Keygen (Old)
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim year As String = Now.Year - 2000
Dim month As String
If (Now.Month > 10) Then
month = Now.Month
Else
month = "0" & Now.Month
End If
Dim day As String
If (Now.Day > 10) Then
day = Now.Day
Else
day = "0" & Now.Day
End If
Dim part1 As String = year & month & day
Dim part2 As String = "116" & genRandomString(3)
Dim part3 As String = "999888" & genRandomString(3)
Dim serial As String = part1 & "-" & part2 & "-" & part3
Dim x As Integer = (Asc(serial(9)) + calcHash(serial) - 48) Mod 1000
Dim y As Integer = Asc(serial(19)) + 10 * (Asc(serial(18)) + 10 * Asc(serial(17))) - 5328
'Dim y As Integer = Asc(serial(19)) + 10 * (Asc(serial(18)) + 10 * Asc(serial(17)) - 5328)
While (x <> y)
part3 = "999" & genRandomString(3)
serial = part1 & "-" & part2 & "-" & part3
x = (Asc(serial(9)) + calcHash(serial) - 48) Mod 1000
y = Asc(serial(19)) + 10 * (Asc(serial(18)) + 10 * Asc(serial(17))) - 5328
End While
'While (var3 + ((var2 + (var1 * 4) * 2) * 5) * 2 - 5328 > 9)
' var1 = genChar()
' var2 = genChar()
' var3 = genChar()
'End While
'x = var3 + ((var2 + (var1 * 4) * 2) * 5) * 2 - 5328
'MsgBox(x.ToString())
TextBox1.Text = serial
End Sub
Private Function genRandomString(ByVal lenght As Integer)
Dim validchars As String = "1234567890"
Dim sb As New StringBuilder()
For i As Integer = 1 To lenght Step 1
sb.Append(validchars(rand.Next(0, validchars.Length)))
Next
Return sb.ToString()
End Function
Private Function calcHash(ByVal input As String)
Dim v7 As Integer = 1
Dim v8 As Integer
Dim v9 As Integer
Dim v10 As Integer
Dim v1 As Integer = 1
Dim v11 As Integer
Dim v12 As Integer
Dim v13 As Integer
Dim v14 As Integer
Dim v15 As Integer
Dim v6 As Integer = 3
Dim v16 As Integer
Dim v17 As Integer
Dim v18 As Integer
Dim v19 As Integer
Dim v20 As Integer
Dim v21 As Integer
Do While (v7 - 1 < 20)
v8 = v7 - 1
If (v7 <> 7) Then
If (v8 <> 13) Then
v9 = Asc(Input(v7 - 1))
v10 = 57 - v9
If (57 <> v9) Then
If (v10 <> 1 And v8 < 17) Then
v1 = v1 * v10 Mod -1000
End If
End If
End If
End If
If (v7 <> 6) Then
If (v7 <> 13) Then
v11 = Asc(Input(v7))
v12 = 57 - v11
If (57 <> v11) Then
If (v12 <> 1 And v7 < 17) Then
v1 = v1 * v12 Mod -1000
End If
End If
End If
End If
v13 = v7 + 1
If (v7 <> 5) Then
If (v13 <> 13) Then
v14 = Asc(Input(v6 - 1))
v15 = 57 - v14
If (57 <> v14) Then
If (v15 <> 1 And v13 < 17) Then
v1 = v1 * v15 Mod -1000
End If
End If
End If
End If
v16 = v7 + 2
If (v7 <> 4) Then
If (v16 <> 13) Then
v17 = Asc(Input(v6))
v18 = 57 - v17
If (57 <> v17) Then
If (v18 <> 1 And v16 < 17) Then
v1 = v1 * v18 Mod -1000
End If
End If
End If
End If
v19 = v7 + 3
If (v7 <> 3) Then
If (v19 <> 13) Then
v20 = Asc(Input(v6 + 1))
v21 = 57 - v20
If (57 <> v20) Then
If (v21 <> 1) Then
If (v19 < 17) Then
v1 = v1 * v21 Mod -1000
End If
End If
End If
End If
End If
v7 += 5
v6 += 5
Loop
Return v1
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment