Giter Site home page Giter Site logo

njmacmurchy96 / hardwareid Goto Github PK

View Code? Open in Web Editor NEW
23.0 7.0 7.0 26 KB

Creates a unique identifier based on the properties of hardware installed; also called HWID, HID, or hardware id/identity. Uses Windows Management Instrument (WMI) and standard code structuring to provide ease-of-use.

License: GNU General Public License v3.0

C# 49.47% Visual Basic .NET 50.53%
csharp vbnet licensing license-generator license hardware hardware-information protection desktop software

hardwareid's Introduction

C#/VB.NET Hardware ID Generator (HWID / HardwareID)

An API that makes efficient use of the Windows Management Instrument Win32 Providers to generate a unique identifier (Hardware ID) based upon the properties of the Motherboard, CDROM, BIOS, HDD, GPU, and CPU. This APIs main purpose is to allow software to remain locked to one PC (or multiple) depending upon its utilization.

Windows Manage Instruments based on the Win32 Provider Classes (WMI)

Usage

C# Syntax Usage:

//Initialize instance of HardwareID
HardwareID HWID = new HardwareID();

//Generate Unique ID based upon hardware of current PC.
Console.WriteLine(HWID.Generate());

//Every time *Generate* is called it sets the *LastID* property.
Console.WriteLine(HWID.LastID)

//The internal *GetProperties* function uses a string array that follows the format { WMI_CLASS, Properties... }. 
//                           Motherboard      --> Parameters
// string[] MOTHERBOARD = { "Win32_BaseBoard", "Name", "Manufacturer", "Version" };
GetProperties(WMI_CLASSES.MOTHERBOARD);

private static string GetProcessorProperties()
{
    return GetProperties(WMI_CLASSES.CPU);
}

VB.NET Syntax Usage:

'Initialize instance of HardwareID
Dim HWID As New HardwareID()

'Generate Unique ID based upon hardware of current PC
Console.WriteLine(HWID.Generate())

'Every time Generate is called LastID is set
Console.WriteLine(HWID.LastID)

'The internal *GetProperties* function uses a string array that follows the format { WMI_CLASS, Properties... }. 
'                                              Motherboard      --> Parameters
' Dim MOTHERBOARD As String() = New String() { "Win32_BaseBoard", "Name", "Manufacturer", "Version" }
Private Shared Function GetProcessorProperties()
    Return GetProperties(WMI_CLASSES.CPU)
End Function

Every property gathered from the WMI class is hashed together with SHA1 and then turned into a Hex string.

//Output: A7EA-FB91-9995-84B7-E843-CCB4-4E81-51B9-2B3B-6587

Updates

  • Increased speed and efficiency.
  • Found reliable properties of each piece of hardware.

TO-DO

  • Further Optimize WMI Access & Query Generation
  • Check if Hardware Exists, if not then attempt other options (Runtime Error Prevention)

Issues

  • Assumes CDROMDrive exists.

License
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007

hardwareid's People

Contributors

njmacmurchy96 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hardwareid's Issues

help

hey where is the rest of the project can you create a n example for button to generate a machine id key from cup bios hdd ect

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.