★HWID Authorization System★
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
4 posts
Page 1 of 1
Hello. 
Welcome to my new tutorial.
This tutorial will teach you how to use a combination of HWID to protect your application from leaker. 8-)
First, you create new class , and add these HWID function to it in order to call it later. Don't forget to add a reference to System.Management
![Image]()
Then we declare 3 variables to store 3 HWID by
Then we declare another variable to store the formatted HWID.
The format will look like this
After that, we add RC4 encryption algorithm below the sub form1_load
And if it's not the same , it show the msgbox that the license key is incorrect and end the application.
The next else show the machine ID and copy it to clipboard in case the license key is not found.
This is the final code
![Image]()
The generator part
Create new project and add 1 textbox and 1 button as below.
![Image]()
Then add
. You can freely change the order or salt . Don't forget to obfuscate your application to prevent viewing through reflector and keep your keygen private.
That's it! Have fun wahooo;
Please leave a thanks if you liked this tutorial.
Hope you liked it.
Regards,
Skillful

Welcome to my new tutorial.

This tutorial will teach you how to use a combination of HWID to protect your application from leaker. 8-)
First, you create new class , and add these HWID function to it in order to call it later. Don't forget to add a reference to System.Management
Code: Select all
So my class will look like this.Imports System.Management
Public Class clsComputerInfo
Public Shared Function GetProcessorId() As String
Dim strProcessorId As String = String.Empty
Dim query As New SelectQuery("Win32_processor")
Dim search As New ManagementObjectSearcher(query)
Dim info As ManagementObject
For Each info In search.Get()
strProcessorId = info("processorId").ToString()
Next
Return strProcessorId
End Function
Public Shared Function GetMACAddress() As String
Dim mc As ManagementClass = New ManagementClass("Win32_NetworkAdapterConfiguration")
Dim moc As ManagementObjectCollection = mc.GetInstances()
Dim MACAddress As String = String.Empty
For Each mo As ManagementObject In moc
If (MACAddress.Equals(String.Empty)) Then
If CBool(mo("IPEnabled")) Then MACAddress = mo("MacAddress").ToString()
mo.Dispose()
End If
MACAddress = MACAddress.Replace(":", String.Empty)
Next
Return MACAddress
End Function
Public Shared Function GetVolumeSerial(Optional ByVal strDriveLetter As String = "C") As String
Dim disk As ManagementObject = New ManagementObject(String.Format("win32_logicaldisk.deviceid=""{0}:""", strDriveLetter))
disk.Get()
Return disk("VolumeSerialNumber").ToString()
End Function
End Class

Then we declare 3 variables to store 3 HWID by
Code: Select all
So MacAddress,ProcessorID,HDVolume will be stored.Dim MyMacAddress As String = clsComputerInfo.GetMACAddress()
Dim MyProcessAddress As String = clsComputerInfo.GetProcessorId()
Dim MyVolumeAddress As String = clsComputerInfo.GetVolumeSerial()
Then we declare another variable to store the formatted HWID.
Code: Select all
The above code will declare TFC_MID to be a string with TFCZ as salt followed by last 4 string of MACAddress , ProcessID , Volume.Dim TFC_MID As String = "TFCZ-" & MyMacAddress.Substring(MyMacAddress.Length() - 4, 4) _
& "-" & MyProcessAddress.Substring(MyProcessAddress.Length() - 4, 4) & "-" & MyVolumeAddress.Substring(MyVolumeAddress.Length() - 4, 4)
The format will look like this
Code: Select all
*Note that you can change how to order those three above or change salt TFCZ into another name.TFCZ-XXXX-XXXX-XXXX
After that, we add RC4 encryption algorithm below the sub form1_load
Code: Select all
And don't forget to add this in the Imports
Public Shared Function rc4(ByVal message As String, ByVal password As String) As String
Dim i As Integer = 0
Dim j As Integer = 0
Dim cipher As New StringBuilder
Dim returnCipher As String = String.Empty
Dim sbox As Integer() = New Integer(256) {}
Dim key As Integer() = New Integer(256) {}
Dim intLength As Integer = password.Length
Dim a As Integer = 0
While a <= 255
Dim ctmp As Char = (password.Substring((a Mod intLength), 1).ToCharArray()(0))
key(a) = Microsoft.VisualBasic.Strings.Asc(ctmp)
sbox(a) = a
System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
End While
Dim x As Integer = 0
Dim b As Integer = 0
While b <= 255
x = (x + sbox(b) + key(b)) Mod 256
Dim tempSwap As Integer = sbox(b)
sbox(b) = sbox(x)
sbox(x) = tempSwap
System.Math.Max(System.Threading.Interlocked.Increment(b), b - 1)
End While
a = 1
While a <= message.Length
Dim itmp As Integer = 0
i = (i + 1) Mod 256
j = (j + sbox(i)) Mod 256
itmp = sbox(i)
sbox(i) = sbox(j)
sbox(j) = itmp
Dim k As Integer = sbox((sbox(i) + sbox(j)) Mod 256)
Dim ctmp As Char = message.Substring(a - 1, 1).ToCharArray()(0)
itmp = Asc(ctmp)
Dim cipherby As Integer = itmp Xor k
cipher.Append(Chr(cipherby))
System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
End While
returnCipher = cipher.ToString
cipher.Length = 0
Return returnCipher
End Function
Code: Select all
Then we add this to check that the file "TFC.lic" is existed or not
Imports System.IO
Imports System.Text
Code: Select all
And then add this to make a stream reader to read for our license key
If (File.Exists(Application.StartupPath & "\TFC.lic")) Then
Code: Select all
Then we decrypt the lic file to compare with our HWID with TFC as password
Dim stream_reader As New StreamReader(Application.StartupPath & "\TFC.LIC")
Code: Select all
After that we put
Dim myMIDReader = rc4(stream_reader.ReadToEnd, "TFC")
stream_reader.close()
Code: Select all
to check that the decrypted lic file is same as TFC_MID or not. If yes, the program run normal.If (myMIDReader = TFC_MID) Then
Else
MsgBox("The license key is incorrect, please contact email@email.com for more information", MsgBoxStyle.Critical)
End
End If
Else
MsgBox("Your machine ID is : " & TFC_MID & vbCrLf & "Your machine ID is copied to clipboard, press ctrl+v to paste it!", MsgBoxStyle.Critical)
Clipboard.SetText(TFC_MID)
End
End If
And if it's not the same , it show the msgbox that the license key is incorrect and end the application.
The next else show the machine ID and copy it to clipboard in case the license key is not found.
This is the final code

The generator part
Create new project and add 1 textbox and 1 button as below.

Then add
Code: Select all
And now for the RC4 Encryption Fucntion.
Imports System.IO
Imports System.Text
Code: Select all
Now finally under the Button1_Click event add this code.
Public Shared Function rc4(ByVal message As String, ByVal password As String) As String
Dim i As Integer = 0
Dim j As Integer = 0
Dim cipher As New StringBuilder
Dim returnCipher As String = String.Empty
Dim sbox As Integer() = New Integer(256) {}
Dim key As Integer() = New Integer(256) {}
Dim intLength As Integer = password.Length
Dim a As Integer = 0
While a <= 255
Dim ctmp As Char = (password.Substring((a Mod intLength), 1).ToCharArray()(0))
key(a) = Microsoft.VisualBasic.Strings.Asc(ctmp)
sbox(a) = a
System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
End While
Dim x As Integer = 0
Dim b As Integer = 0
While b <= 255
x = (x + sbox(b) + key(b)) Mod 256
Dim tempSwap As Integer = sbox(b)
sbox(b) = sbox(x)
sbox(x) = tempSwap
System.Math.Max(System.Threading.Interlocked.Increment(b), b - 1)
End While
a = 1
While a <= message.Length
Dim itmp As Integer = 0
i = (i + 1) Mod 256
j = (j + sbox(i)) Mod 256
itmp = sbox(i)
sbox(i) = sbox(j)
sbox(j) = itmp
Dim k As Integer = sbox((sbox(i) + sbox(j)) Mod 256)
Dim ctmp As Char = message.Substring(a - 1, 1).ToCharArray()(0)
itmp = Asc(ctmp)
Dim cipherby As Integer = itmp Xor k
cipher.Append(Chr(cipherby))
System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
End While
returnCipher = cipher.ToString
cipher.Length = 0
Return returnCipher
End Function
Code: Select all
*Note that the password "TFC" must the same as your application and keep it private or else anyone can gen your lic file Dim write_file As New StreamWriter(Application.StartupPath & "\TFC.lic", False)
write_file.Write(rc4(TextBox1.Text, "TFC"))
write_file.Close()

That's it! Have fun wahooo;
Please leave a thanks if you liked this tutorial.
Hope you liked it.
Regards,
Skillful
Last edited by Skillful on Wed Mar 21, 2012 2:36 pm, edited 1 time in total.
Instead of LOL use this -
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
nice tut :lol:
no link? to download the tut :P
no link? to download the tut :P
Last edited by Dummy1912 on Wed Mar 21, 2012 2:41 pm, edited 1 time in total.
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Link for what?
Instead of LOL use this -
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023