Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique Computer ID

Status
Not open for further replies.

NaijaMan

Programmer
Jan 31, 2002
8
NL
Has anyone out there discovered how to generate or retrieve a unique ID for a PC. I have tried using the Network Card MAC address but not every system has a network card does the BIOS or CPU have a unique ID? If so how can you retrieve this using VB.
 
Thanks Sunaj, I forgot to mention that I have already tried the serial number route. The Serial no is not really unique as it changes each time the harddisk is formated.
 
Originally posted by Alt255:

----------------------------------------------------------
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(7) As Byte
End Type

Private Declare Function CoCreateGuid Lib "OLE32.DLL" (pGuid As GUID) As Long

Private Function GetGUID() As String
Dim udtGUID As GUID
If (CoCreateGuid(udtGUID) = 0) Then
GetGUID = _
String(8 - Len(Hex$(udtGUID.Data1)), "0") & _
Hex$(udtGUID.Data1) & _
String(4 - Len(Hex$(udtGUID.Data2)), "0") & _
Hex$(udtGUID.Data2) & _
String(4 - Len(Hex$(udtGUID.Data3)), "0") & _
Hex$(udtGUID.Data3) & _
IIf((udtGUID.Data4(0) < &H10), &quot;0&quot;, &quot;&quot;) & _
Hex$(udtGUID.Data4(0)) & _
IIf((udtGUID.Data4(1) < &H10), &quot;0&quot;, &quot;&quot;) & _
Hex$(udtGUID.Data4(1)) & _
IIf((udtGUID.Data4(2) < &H10), &quot;0&quot;, &quot;&quot;) & _
Hex$(udtGUID.Data4(2)) & _
IIf((udtGUID.Data4(3) < &H10), &quot;0&quot;, &quot;&quot;) & _
Hex$(udtGUID.Data4(3)) & _
IIf((udtGUID.Data4(4) < &H10), &quot;0&quot;, &quot;&quot;) & _
Hex$(udtGUID.Data4(4)) & _
IIf((udtGUID.Data4(5) < &H10), &quot;0&quot;, &quot;&quot;) & _
Hex$(udtGUID.Data4(5)) & _
IIf((udtGUID.Data4(6) < &H10), &quot;0&quot;, &quot;&quot;) & _
Hex$(udtGUID.Data4(6)) & _
IIf((udtGUID.Data4(7) < &H10), &quot;0&quot;, &quot;&quot;) & _
Hex$(udtGUID.Data4(7))
End If
End Function

Private Sub Form_Load()
MsgBox GetGUID
End Sub
------------------------------------------------------------

Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
And, as previously observed, it doesn't return the same result twice (which is the whole point of GUIDs, of course), so you can't use it to fingerprint a PC...
 
Strongm, as usual, is right. The GUID string might be unique, but that's the problem... it's almost always unique.

I don't think there is a reliable way to &quot;fingerprint&quot; a system. You might try thread711-173216 (to get a BIOS ID string) but this ID is much less &quot;unique&quot; than a disk serial number... it will be the same on identical machines. You might try thread711-178792 (to create a checksum of 64kb of BIOS memory). The value appears to be unique on identical machines but tends to change when equipment changes (that's one of the problems with &quot;fingerprints&quot;... if you replace a person's hand, the fingerprints change - same problem you encounter after replacing a hard drive.)

Both of the preceeding threads have limited value since they probably won't work across Win versions. A guy like Strongm could probably find a stable way to code them, but what would be the point?

The most consistent way to identify a system would be to identify the user. Get his fingerprints. Hardware, firmware and software are mutable. Human fingerprints aren't.
VCA.gif
 
One additional note on HD serial numbers. We purchased several PCs from Dell with the same specs. They all came in with the same HD serial number.
 
Why do you need the unique id? What are you doing?

If you're trying to identify the client in a server client app, have you thought of just dropping a server generated unique value in to the registry, and using that?

 
>> What are you doing?
I don't want the user to copy the software and let it work on another pc.
So i'm very interested in how to get a pc's fingerprint.

 
If that is the reason then you should try one of the commercial applications that allows your software to do that.

Bear in mind that whatever protection scheme you use it is always possible to bypass it if a user has the required knowledge.
So any protection you can think of will only prevent the casual user from copying the software.


Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top