Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 14:14

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

Advertisement



[VB] HWID System

Discussion on [VB] HWID System within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1


 
Whoknowsit's Avatar
 
elite*gold: 146
Join Date: May 2009
Posts: 3,764
Received Thanks: 6,974
[VB] HWID System

Moin,

ich habe vor einigen Tagen mit VB.Net angefangen und direkt eine Frage dazu Es geht um das E*PVP HWID-System.

Dieses würde ich gerne in einem meiner Projekte einsetzen und tu dies auch schon recht erfolgreich. Warum ich schreibe ist, dass ich glaube, dass man das Ganze noch optimieren könnte Falls nicht, umso besser. Falls doch, freue ich mich über jeden Vorschlag.

Code:
Imports System.Runtime.InteropServices
Imports System.Text
Imports System.Security.Cryptography

Public Class HWID
    <Flags()> _
    Private Enum DockInfo
        DOCKINFO_DOCKED = &H2
        DOCKINFO_UNDOCKED = &H1
        DOCKINFO_USER_SUPPLIED = &H4
        DOCKINFO_USER_DOCKED = &H5
        DOCKINFO_USER_UNDOCKED = &H6
    End Enum

    <StructLayout(LayoutKind.Sequential)> _
    Public Class HW_PROFILE_INFO
        <MarshalAs(UnmanagedType.U4)> _
        Public dwDockInfo As Int32

        <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=39)> _
        Public szHwProfileGuid As String

        <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> _
        Public szHwProfileName As String
    End Class

    <DllImport("advapi32.dll", SetLastError:=True)> _
    Private Shared Function GetCurrentHwProfile(lpHwProfileInfo As IntPtr) As Boolean
    End Function

    Declare Function GetVolumeInformationA Lib "kernel32" ( _
        PathName As String, _
        VolumeNameBuffer As StringBuilder, _
        VolumeNameSize As UInt32, _
        ByRef VolumeSerialNumber As UInt32, _
        ByRef MaximumComponentLength As UInt32, _
        ByRef FileSystemFlags As UInt32, _
        FileSystemNameBuffer As StringBuilder, _
        FileSystemNameSize As UInt32) As Long

    Private Shared Function ProfileInfo() As HW_PROFILE_INFO
        Dim profile As HW_PROFILE_INFO
        Dim profilePtr As IntPtr = IntPtr.Zero
        Try
            profile = New HW_PROFILE_INFO()
            profilePtr = Marshal.AllocHGlobal(Marshal.SizeOf(profile))
            Marshal.StructureToPtr(profile, profilePtr, False)

            If Not GetCurrentHwProfile(profilePtr) Then
                Throw New Exception("Error cant get current hw profile!")
            Else
                Marshal.PtrToStructure(profilePtr, profile)
                Return profile
            End If
        Catch e As Exception
            Throw New Exception(e.ToString())
        Finally
            If profilePtr <> IntPtr.Zero Then
                Marshal.FreeHGlobal(profilePtr)
            End If
        End Try
    End Function

    Private Shared Function GetVolumeSerial(strDriveLetter As String) As String
        Dim serNum As UInteger = 0
        Dim maxCompLen As UInteger = 0
        Dim VolLabel As New StringBuilder(256)
        Dim VolFlags As New UInt32()
        Dim FSName As New StringBuilder(256)
        strDriveLetter += ":\"
        Dim Ret As Long = GetVolumeInformationA(strDriveLetter, VolLabel, CType(VolLabel.Capacity, UInt32), serNum, maxCompLen, VolFlags, _
         FSName, CType(FSName.Capacity, UInt32))
        Return Convert.ToString(serNum)
    End Function

    Shared Function getHWID() As String
        Dim info As HW_PROFILE_INFO = ProfileInfo()
        Dim GUID As String = info.szHwProfileGuid.ToString()
        Dim volumeserial As String = GetVolumeSerial(Environment.SystemDirectory.Substring(0, 1))

        Dim md5Hasher As MD5 = MD5.Create()
        Dim data As Byte() = md5Hasher.ComputeHash(Encoding.Default.GetBytes(GUID & volumeserial))
        Dim sBuilder As New StringBuilder()

        For i = 0 To data.Length - 1
            sBuilder.Append(data(i).ToString("x2"))
        Next i

        getHWID = sBuilder.ToString()
    End Function
End Class
Whoknowsit is offline  
Thanks
2 Users
Old 05/30/2012, 10:47   #2
 
qickly's Avatar
 
elite*gold: 0
Join Date: Apr 2011
Posts: 351
Received Thanks: 57
Besonders wenn du anfängst solltest du wissen, da jeder Nuub das umgehen kann. Indem er dein Programm patched...
qickly is offline  
Old 05/30/2012, 14:31   #3


 
Whoknowsit's Avatar
 
elite*gold: 146
Join Date: May 2009
Posts: 3,764
Received Thanks: 6,974
Und das sagt mir jetzt was? Ob und wie man da irgendetwas umgehen kann, war nicht gefragt Danke trotzdem.
Whoknowsit is offline  
Old 05/31/2012, 14:06   #4
 
Skriptum's Avatar
 
elite*gold: 0
Join Date: Oct 2010
Posts: 2,506
Received Thanks: 257
Quote:
Originally Posted by Whoknowsit View Post
Und das sagt mir jetzt was? Ob und wie man da irgendetwas umgehen kann, war nicht gefragt Danke trotzdem.
Ehm..., dafür ist die HWID in diesem Fall doch aber da, dass Programm sollen nur ausgewählte Personen benutzen können.

Wenn dieser Schutz leicht zu umgehen ist, bringt einem der ganze Mist doch nichts oder, was meinst du dazu?
Skriptum is offline  
Old 05/31/2012, 18:52   #5

 
Huibuh2010's Avatar
 
elite*gold: 80
Join Date: Feb 2010
Posts: 318
Received Thanks: 17
Er wollte sicherlich nur damit sagen wenn es nicht gerade sicher programmiert ist, kann es schnell so gecrackt werden das z.b. die ID egal ist.
Huibuh2010 is offline  
Old 05/31/2012, 20:39   #6


 
Whoknowsit's Avatar
 
elite*gold: 146
Join Date: May 2009
Posts: 3,764
Received Thanks: 6,974
Es geht einzig darum:

Da ich VB.net gerde erst begonnen habe, habe ich diesen Thread hier erstellt um heraus zu finden, ob man am obigen Code etwas verändern/optimieren muss/kann. Sinn und Unsinn war hier nicht gefragt. Denn dass das kein ultimativer Schutz ist, ist mir bewusst
Whoknowsit is offline  
Old 09/20/2012, 18:19   #7
 
1badbobby's Avatar
 
elite*gold: 250
Join Date: Dec 2010
Posts: 56
Received Thanks: 515
for some reason when people use this with my updater are telling me that they get a different HWID then you zyorsddl, care to help try and get them to match
1badbobby is offline  
Old 09/24/2012, 14:30   #8


 
Whoknowsit's Avatar
 
elite*gold: 146
Join Date: May 2009
Posts: 3,764
Received Thanks: 6,974
Just use the DLL instead of a custom function
Whoknowsit is offline  
Old 09/30/2012, 06:52   #9
 
1badbobby's Avatar
 
elite*gold: 250
Join Date: Dec 2010
Posts: 56
Received Thanks: 515
Quote:
Originally Posted by Whoknowsit View Post
Just use the DLL instead of a custom function
I Would but Vb2012 is saying the .dll "could not be added. Please make sure that the file is accessible,and that it is a valid assembly or COM component."

Got any help with this?
1badbobby is offline  
Old 09/30/2012, 09:28   #10


 
Whoknowsit's Avatar
 
elite*gold: 146
Join Date: May 2009
Posts: 3,764
Received Thanks: 6,974
I'll send you a pm.
Whoknowsit is offline  
Reply


Similar Threads Similar Threads
[C++] HWID System Dll
09/21/2011 - C/C++ - 7 Replies
Ich versuche schon seit einigen Tagen das HWID System in einer Dll zu benutzen. Da die Beispiele im offiziellen Thread down sind, habe ich nach weiteren Beispielen gesucht und fand diesen Thread. http://www.elitepvpers.com/forum/warrock-hacks-bo ts-cheats-exploits/1206005-cenwr-c-hotkey-base-hwi d-system-implementierung.html#post10878552 Nun crashte die Dll aber nachdem die GetUserInformation Funktion aufgerufen wurde. Ich bin alles durchgegangen und habe dann folgende Änderung gemacht....
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 +1. The time now is 14:16.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.