HWID System With Online/Offline Protection

Discussion in 'Programming General' started by Dark L3g3nd, Nov 29, 2010.

HWID System With Online/Offline Protection
  1. Unread #1 - Nov 29, 2010 at 4:43 PM
  2. Dark L3g3nd
    Joined:
    Mar 9, 2010
    Posts:
    157
    Referrals:
    0
    Sythe Gold:
    0

    Dark L3g3nd Active Member
    Banned

    HWID System With Online/Offline Protection

    Hi,

    Some of this code is from other people and I've just compiled it together and changed to C# as well as adding online/offline protection. There's two ways to doing this. You will need to host a database.txt file on a website which contains the valid HWID's.

    What is a HWID?

    http://www.webopedia.com/TERM/H/HWID.html

    First one :

    Step : 1

    This is to retrieve the HWID of the computer and paste it into a textBox.(button1_Click) Paste it inside the { and the } when you double click the Get HWID button.

    Code:
    string cpuInfo = string.Empty;
        ManagementClass mc = new ManagementClass("win32_processor");
        ManagementObjectCollection moc = mc.GetInstances();
    
        foreach (ManagementObject mo in moc)
        {
        if (string.IsNullOrEmpty(cpuInfo))
        {
        cpuInfo = mo["ProcessorID"].ToString();
        break;
        }
    
        }
        textBox1.Text = cpuInfo;
    Step : 2

    This is to retrieve the list of HWID's from your database.txt file and check it to the current computers.(button2_Click) Paste it inside the { and the } when you double click the Check/Login button.

    Code:
    try
        {
        string cpuInfo = string.Empty;
        WebClient webClient = new WebClient();
        string strings = null;
        strings = webClient.DownloadString("http://website.com/Database.txt");
        webClient.Dispose();
    
         if (strings.Contains(cpuInfo))
        {
    
         // If the HWID is in the file then it will return this.    MessageBox.Show("HWID Valid", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        this.Hide();
        Form1 frm1 = new Form1();
        frm1.ShowDialog();
         }
        else
        {
         // If the HWID isn't in the file then it will return this.
        MessageBox.Show("HWID Invalid", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        this.Close();
        }
        }
        catch (Exception)
        {
        // If not connected to the internet or can't connect to the site then it will return this.
        MessageBox.Show("Unable To Retrieve HWID", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        this.Close();
        }

    Second One :


    Step : 1


    This is to retrieve the HWID of the computer and paste it into a textBox.(button1_Click) Paste it inside the { and the } when you double click the Get HWID button.

    Code:
    string cpuInfo = string.Empty;
        ManagementClass mc = new ManagementClass("win32_processor");
        ManagementObjectCollection moc = mc.GetInstances();
    
        foreach (ManagementObject mo in moc)
        {
        if (string.IsNullOrEmpty(cpuInfo))
        {
        cpuInfo = mo["ProcessorID"].ToString();
        break;
        }
    
        }
        textBox1.Text = cpuInfo;
    Step : 2

    This will handle the checking of if you are connected to the internet.

    Code:
    [DllImport("wininet.dll")]
    private extern static bool InternetGetConnectedState( int out Description, int ReservedValue ) ;
    
    public static bool isConnectedToTheInternet( )
    {
    
        int Desc ;
        return InternetGetConnectedState( out Desc, 0 ) ;
    
    }

    Step : 3


    This is to retreive the list of HWID's from your database.txt file and chek it to the current computers.(button2_Click) Paste it inside the { and the } when you double click the Check/Login button.

    Code:
    if (!isConnectedToTheInternet()) //Checks if it isn't connected to internet
        {
        MessageBox.Show("Unable To Retrieve HWID", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        this.Dispose();
        } else
        { //Downloads the database.txt file.
        string cpuInfo = string.Empty;
        WebClient webClient = new WebClient();
        string strings = null;
        strings = webClient.DownloadString("http://website.com/Database.txt");
         webClient.Dispose();
    
        if (strings.Contains(cpuInfo))//If it contains the HWID in the database.txt file.
        {
        MessageBox.Show("HWID Valid", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        this.Hide();
        Form1 frm1 = new Form1();
        frm1.ShowDialog();
        } 
        if (!strings.Contains(cpuInfo))//If it doesn't contain the HWID in the database.txt file.(Could use else method)
        {
        {
        MessageBox.Show("HWID Invalid", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        this.Dispose();
        }
        }
    
        }
      }
    That's it, I recommend the first one for beginners or novice users and second for more experienced users as you have more control.

    Enjoy!
     
  3. Unread #2 - Mar 21, 2011 at 3:48 PM
  4. Divine blob
    Joined:
    Mar 14, 2007
    Posts:
    1,289
    Referrals:
    2
    Sythe Gold:
    0

    Divine blob Guru

    HWID System With Online/Offline Protection

    I used to use a bot that was protected by something similar to these. Are these good for selling programs?
     
  5. Unread #3 - Mar 23, 2011 at 7:54 PM
  6. Jeezal
    Joined:
    Mar 23, 2011
    Posts:
    285
    Referrals:
    0
    Sythe Gold:
    0

    Jeezal Forum Addict

    HWID System With Online/Offline Protection

    i was curious will these help for sell
     
< Charny Screenshot tool [v1.2] - [Auto-Upload images!@] | Need important help with java! >

Users viewing this thread
1 guest


 
 
Adblock breaks this site