the absolute unique number of each pc ? how to get it in d3

I need.. a ABSOLUTE unique number (like the processor serialn. or motherboards n. or or or)
it's to generate a key-file for my app.. so some samples are welcome to :)

Who is Participating?
chrismoConnect With a Mentor Commented:
Sorry 'bout that.

A GUID is a Globally Unique ID. The algorithm for generating it was created by Microsoft I believe. Some math heads claim it's not absolutely reliable for a truly globally unique ID - but for practical uses it works very well.

GUIDs are used with COM objects. Every COM object must have a GUID to identify itself and register's itself on your machine in your registry with its GUID. This should allow multiple COM objects to be installed on your machine and guarantee there won't be an ID conflict.

To programmatically generate a GUID in D3 - use the following API call:

CoCreateGUID (check the Win32.hlp file for specifics). This call exists in the OLE2.pas file in the RTL\WIN Delphi source directory.

Delphi provides a TGUID record for working with the value as well as GUIDToString and StringToGUID functions for ease of use. You will most likely have to store the GUID as a string in your table (perhaps not an option for you).

What database platform are you using? If you're using MS SQL Server - it has a timestamp data type which is a unique value as well - though it's a bit awkward to work with.

If you'd like more information on the contents of a GUID, check out the following:
what about combining all these togheter to one key?
Combining them all is a good solution.
Include the MAC-address also (if there is one)?

/// John
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi Skatan,

We have been working on this problem for around nine months now.  Unfortunately, appart from the network cards' address, there is no way of getting a completely unique number for every PC.  And, the addres of a network card can only be retrieved from cards which support it.  To date, I have not been able to get it to work on very many cards at all except for genuine NE2000 cards (from Novel).

The best that we have been able to come up with is the hard disk serial number, combined with the Windows OEM number, Date and Time of Installation, Name and Company name and physical drive attributes.  We use all of these factors and then use a random seed to generate a unique ID number.

Problem with this is, if someone uses hard disk copying program which does the drive sector by sector, you will end up getting fairly similar numbers.

My suggestion to you would be to use what we have done above.  If you are interested, I can send you some code to get going with, but obviously I can not send you everything we are using.  I have the code to return the NICs' address, and I can forward that onto you as well.

The main problem with retrieving all that stuff you where after is this.  Using a protected mode operating system, you have to do "Thunking" to retrieve that info (because it resides in protected memory areas).  I dont know too much about this, so I wont go into it.  All I know is what I have been told, and its DAMN hard.

Good luck, and let me know if you want some of our code.


it sounds like you're doing something very similar to something I tried to do a while back. I couldn't make it work though... (that wonderful thunking problem you were talking about) I know it's  a bit cheeky, but I'd be really grateful if you could mail me any code which you don't mind sharing, or point me at a resource covering this sort of thing.

Incidentally, I know there is a way of getting the MAC address out of non NE2000 cards - although I don't know how you do it... It  has been done though; Quake will give you the MAC address in it's network game setup screen. I'll dig around and see what I can find...



Email :

95 AND nt?


skatan187Author Commented:
the component I have right now is not coded by me..
but it finds the serial number of the motherboard..

A problem I have with the hard-disk serial is that when a user changes
the drive wich contains the used number.. the program will have to be
reregistered.. and since hard-drives are more often changed then
processors or motherboard numbers... However,, I am also looking for
a working sample to make somekinda serial number protection with
this key : I tried encryption of the string-combined with the name
of the users .. and use this as the 3 veriables for checking the

why do I need this: the most users of my program have serial number
lists and know what warez are :) .. to avoid that the app will be listed in
these lists, I wan't to combine this unique number with the name of the user
and make a key with these values .. If somebody knows another solution then
using this unique number .. like for example the windows registery : the
problem here is that cracks will be made ! (my app: a menu for cd's ..
yea : also warez cd's ! so most users will use the crack if it's availeble)

Adam: I'll post you off some stuff today.  Parts are in C, others are in Delphi.

Skatan187: Any chance of getting a look at that component at all?  Does it have the source code at all, if so, we maybe on track to being able to get some other info!

Why not generate a GUID? I know there's debate over whether these are truly unique - but will it do for your purposes?
skatan187Author Commented:
I rejected your answer because there is not eneuf information explaining how ..

skatan187Author Commented:
I'll accept this anwer.. but it still not exactly what I was looking for:
I am looking for a number wich is stored somewhere is the hardware of the
user.. so that he can only use the software on HIS computer .

(like: perhaps a serial of the CPU, mother-mainboard, hardisk dunno.. )
I also prefer hardware that is a part of the basics of the pc: like
the mainboard, C-drive, CPU ...

If you look up the DejaNews links I provided - some of the GUID data is read from the machine, combined with some timestamping algorithmic stuff...

But you are correct - if you simply want a single number per machine - a GUID is not really it. Thanks for the points, however! Hope it works out for you...
hoi, chrismo -

are these those which are to be found in the HKEY_CLASSES_ROOT\CLSID -Key structure?

Black Death.
I know this is a dead question, but perhaps my comments serv to someone.

Like several guys of you, I've also worked during almost one year to get a unique machine ID number.

What I've finally discovered is a "machine's fingerprint" derived from several parts of machine itself:
1- BIOS's creation date
2- Machine's processor type, model and manufacturer
3- Creation date & time of directory where system is stored
4- Disk geometry (cyls/sectors/heads)
5- Info stored at non-reachable regions of disk

Of course, if user buys a new machine, he must call to re-register, but that's the only way I've found to obtain a secure protection scheme.

The registering program remains at user's machine; this program is used each time user needs to install the system in another machine (or if he has changed, let's say, the disk, or the motherboard). It uses single-use telephone passwords which disables user to re-register each time he want, because the right passwords to open registering process must be supplied when user is in front of the screen and after giving me some "control numbers" displayed at initial screen, numbers that change on each program execution.

I've installed more than 400 copies of a system developed by me, and all of them run under this scheme. Of course, from time to time, I receive a call from someone which has upgraded the machine, perhaps buying a faster processor (of course, with another mobo), or a higher-capacity disk. The process to call me to re-install the system lasts no more than 3 minutes. And I can sleep very quietly knowing that my system is secure.

Unfortunately, all of this require non-protected mode accesses, which make my system be yet a DOS application. I'll see what will occur when I migrate to Windoze... :~(
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.