Register for your free account! | Forgot your password?

You last visited: Today at 07:49

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



HWID Class

Discussion on HWID Class within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
HWID Class

Language = VB.

I don't take credits for any of the content, but I thought I would share it here, because it can be used for banning peoples. It will make them not able to login, even with ipchange. They would have to switch pc. In some cases it will work better than IPBan, but giving both will have a good effect of ban.

All credits goes to Aeonhack

Source:
Code:
Imports System.Text
Imports System.Net.NetworkInformation
Imports System.Management

Class Machine
    Const PN As UShort = 4129

    Private ID(3) As String
    Private Table(255) As UShort
    Private UTF8 As New UTF8Encoding

    Private _HardwareID As String
    ReadOnly Property HardwareID() As String
        Get
            Return _HardwareID
        End Get
    End Property

    Private _Seed As UShort
    Sub New(Optional ByVal seed As UShort = 0)
        Dim R As String = String.Format(" WHERE DeviceID='{0}:'", Environment.SystemDirectory(0))
        ID(0) = Search("Win32_BaseBoard", "SerialNumber")
        ID(1) = Search("Win32_Processor", "ProcessorID")
        ID(2) = Search("Win32_LogicalDisk" & R, "VolumeSerialNumber")
        ID(3) = Search()
        _Seed = seed
        Generate()
    End Sub

    Private Function Search(ByVal element As String, ByVal item As String) As String
        element = String.Format("SELECT {0} FROM {1}", item, element)

        Dim T As New StringBuilder
        Dim U As New ManagementObjectSearcher(element)
        For Each O As ManagementObject In U.Get
            If Not O(item) Is Nothing Then T.Append(O(item))
        Next
        U.Dispose()
        Return T.ToString
    End Function
    Private Function Search() As String
        For Each O As NetworkInterface In NetworkInterface.GetAllNetworkInterfaces
            If O.OperationalStatus = OperationalStatus.Up Then Return O.GetPhysicalAddress.ToString
        Next
        Return String.Empty
    End Function

    Private Function CRC16(ByVal data As Byte()) As UShort
        CRC16 = _Seed
        For I As Integer = 0 To data.Length - 1
            CRC16 = CRC16 << 8 Xor Table(CRC16 >> 8 Xor data(I))
        Next
        _Seed = CRC16
    End Function
    Private Sub CreateTable()
        Dim V, T As UShort
        For I As UShort = 0 To 255
            V = 0
            T = I
            For U As Byte = 0 To 7
                If ((V Xor T) And 1) <> 0 Then V = V >> 1 Xor PN Else V >>= 1
                T >>= 1
            Next
            Table(I) = V
        Next
    End Sub

    Private Sub Generate()
        CreateTable()
        Dim T As New List(Of Byte)
        For I As Byte = 0 To 3
            T.AddRange(BitConverter.GetBytes(CRC16(UTF8.GetBytes(ID(I)))))
        Next
        _HardwareID = BitConverter.ToString(T.ToArray).Replace(Convert.ToChar(45), String.Empty)
    End Sub

    Function Check(ByVal id As String) As Boolean
        If Not id.Length = 16 Then Return False
        id = id.Replace(Convert.ToChar(45), String.Empty).ToUpper

        Dim M As Integer
        For I As Byte = 0 To 15 Step 4
            If Not id.Substring(I, 4) = _HardwareID.Substring(I, 4) Then M += 1
        Next

        If M > 1 Then Return False Else Return True
    End Function
End Class
Generate:
Code:
'We can create a new Machine instance
'with a seed so that the ID is unique to
'our application.

'The current seed is 1234. The range
'you can use is below.

'0 Default - 65535 Maximum
Dim T As New Machine(1234)

'This will return the machines ID.
Dim ID As String = T.HardwareID
Check:
Code:
Dim T As New Machine(1234)

'Here we check if at least 3/4 of
'the components match.
If T.Check(ID) Then
    'We have a match, do something.
End If
Syst3m_W1z4rd is offline  
Old 03/27/2011, 11:29   #2
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
Honestly not in the mood to read any code longer than 2 lines, so could you please tell me what this does? How do you identify a machine?
Basser is offline  
Old 03/27/2011, 22:31   #3
 
|NeoX's Avatar
 
elite*gold: 0
Join Date: Nov 2010
Posts: 237
Received Thanks: 99
Dude research for Hardware ID you will find alot.
|NeoX is offline  
Old 03/28/2011, 00:23   #4
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
Quote:
Originally Posted by Basser View Post
Honestly not in the mood to read any code longer than 2 lines, so could you please tell me what this does? How do you identify a machine?
Motherboard, processor, hard drive etc. That's what this can do.
Syst3m_W1z4rd is offline  
Old 03/28/2011, 05:06   #5
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Correct me if I'm wrong, but wouldn't this need to be run client-side?
nTL3fTy is offline  
Old 03/28/2011, 05:29   #6
 
elite*gold: 80
Join Date: Sep 2007
Posts: 642
Received Thanks: 168
Quote:
Originally Posted by nTL3fTy View Post
Correct me if I'm wrong, but wouldn't this need to be run client-side?
That is exactly what i was thinking.
Santa is offline  
Old 03/28/2011, 08:15   #7
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
Quote:
Originally Posted by nTL3fTy View Post
Correct me if I'm wrong, but wouldn't this need to be run client-side?
Yup, then you make it interact with the server
Syst3m_W1z4rd is offline  
Old 03/28/2011, 11:01   #8
 
|NeoX's Avatar
 
elite*gold: 0
Join Date: Nov 2010
Posts: 237
Received Thanks: 99
HWID As UID as example
|NeoX is offline  
Reply


Similar Threads Similar Threads
HWID Generator & Dev-Tools für e*pvp's HWID System
01/28/2011 - Main - 0 Replies
Hier die Downloads passend zum News-Thread, da das Attachen von Daten an News-Threads nicht möglich ist ;) News-Thread: http://www.elitepvpers.com/forum/e-pvp-news-de/981 343-hwid-system-f-r-entwickler.html Credits für den 2. Generator gehen an Anfang! Lg, Ende!



All times are GMT +2. The time now is 07:49.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.