Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[TUT] How to protect your program using your Windows Serial Key [VB.NET]
#1
What is this about?

Hey Guys! In this tutorial I'm going to show you how to protect your program with your Windows Serial Key.

Original Thread (by me): http://www.hackforums.net/showthread.php?tid=727561

How does it work?

It compares two serial keys! Your serial key (you set it in the source), and the serial key of the computer (Windows OS) you're using.
If the serial of the computer doesn't match with that you chose the program won't run. Victoire

So, how do I code that?

Step 1) Add to your project 2 forms (Form1 and Form2).
Form2 will be your program and Form1 will be the protection.

Step 2) Make your form1 invisible by changing its opacity to 0, and setting the ShowInTaskbar and ShowIcon to False.

Step 3) Add a label to your form1.

Step 4) Lets make our form1 imports Management.

Code:
Imports System.Management

Step 5) Now lets declare some variables.

Code:
Dim MOS As ManagementObjectSearcher = New ManagementObjectSearcher("Select * From Win32_OperatingSystem")
Dim MO As System.Management.ManagementObject
Dim MOC As System.Management.ManagementObjectCollection = MOS.Get
Dim WindowsSerial As String = String.Empty

Step 6) Now just add the folowing code to your form1_load event.

Code:
For Each MO In MOC
WindowsSerial = MO("SerialNumber")
Next
Label1.Text = WindowsSerial
If Label1.Text = "YOUR WINDOWS SERIAL" Then
    Form2.Show()
    Me.Hide
Else
    MsgBox("Your windows serial does not match.")
    Me.close
End If

This will compare your Windows OS serial with the one you chose.

Step 7) Create your program in Form2.

Step 8) Test it! Victoire

Hope you find use for this! Thumbsup
[Image: just-cause-2-header.jpg]
Reply
#2
I don't understand why you would want two forms for this, or why you would use:
Code:
Label1.Text = WindowsSerial
if you arent even using Label1.

If you used this as your Form1_Load it it would work just fine w/ one form.
Code:
Dim MOS As ManagementObjectSearcher = New ManagementObjectSearcher("Select * From Win32_OperatingSystem")
Dim MO As System.Management.ManagementObject
Dim MOC As System.Management.ManagementObjectCollection = MOS.Get
Dim WindowsSerial As String = String.Empty
For Each MO In MOC
WindowsSerial = MO("SerialNumber")
Next
If WindowsSerial = "YOUR WINDOWS SERIAL" Then
    Me.Opacity = 100
Else
    MsgBox("Your windows serial does not match.")
    Me.close
End If


Good share none the less. Thumbsup
Reply
#3
(12-06-2010, 03:43 PM)KoBE Wrote: I don't understand why you would want two forms for this, or why you would use:
Code:
Label1.Text = WindowsSerial
if you arent even using Label1.

If you used this as your Form1_Load it it would work just fine w/ one form.
Code:
Dim MOS As ManagementObjectSearcher = New ManagementObjectSearcher("Select * From Win32_OperatingSystem")
Dim MO As System.Management.ManagementObject
Dim MOC As System.Management.ManagementObjectCollection = MOS.Get
Dim WindowsSerial As String = String.Empty
For Each MO In MOC
WindowsSerial = MO("SerialNumber")
Next
If WindowsSerial = "YOUR WINDOWS SERIAL" Then
    Me.Opacity = 100
Else
    MsgBox("Your windows serial does not match.")
    Me.close
End If


Good share none the less. Thumbsup

Thanks for the tips and feedback Kobe.

That label is hidden on the form ... Ninja
[Image: just-cause-2-header.jpg]
Reply
#4
Nice i mite check this out looks helpful
Reply
#5
nice tutorial dude Thanks Smile
Reply
#6
Glad you guys liked it !

The 1* is the only thing that ruins this ;(
[Image: just-cause-2-header.jpg]
Reply
#7
Thanks, really good tutorial!
Gonna use that someday!
Reply
#8
(12-12-2010, 03:46 PM)Ɲymph Wrote: Thanks, really good tutorial!
Gonna use that someday!

Glad you liked it ! Thumbsup
[Image: just-cause-2-header.jpg]
Reply
#9
look pretty good mate. keep it up.
Reply
#10
Looks cool, using this as well as other stuff could make a pretty good log in system, instead of just HWID.

Problem is customers might not like the idea of you getting their serial number, so maybe just convert to MD5 right after you retrieve the serial number so you won't even know what it is (Since you can't decrypt MD5 unless you bruteforce, which takes years)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to hook the keyboard. [VB.NET] [TuT] Vorfin 92 61,821 09-23-2019, 11:55 AM
Last Post: Jamimartin
  [Preview] Windows 7 Tools [VB.NET] ƃu∀ ıʞƃu∀ 4 3,696 10-14-2014, 11:55 AM
Last Post: 'Onam
  Encrypt String using x509Certificate private Key wih RSA jeffstan 0 2,442 01-26-2014, 04:18 PM
Last Post: jeffstan
  VB.NET Port Scanner [TUT] Fragma 30 14,659 11-27-2012, 11:26 PM
Last Post: ƃu∀ ıʞƃu∀
  [TUT] MD5 Encrypter & Finder [VB.NET] Fragma 12 7,926 11-25-2012, 10:36 PM
Last Post: ƃu∀ ıʞƃu∀

Forum Jump:


Users browsing this thread: 13 Guest(s)