Click to See Complete Forum and Search --> : How to get a unique ID from a PC


August 11th, 1999, 09:30 PM
How to get a unique ID from a PC. Please help if you know.

Thanks in advance.

August 12th, 1999, 05:21 AM
I don't know if I answer to your question but you can use then Win32 API function GetVolumeInformation to get the serial number (which should be unique)of the hard drive of your computer.
Another possibility is to get the MAC adress of your net card if you have one, but it is more complex (use the NetBIOS API...!).

August 16th, 1999, 05:09 AM
I not sure that, is there any posibility that to change the volume serial number. If no chance to change, then I think its save. Thank you

peter

rzakrison
August 16th, 1999, 10:04 AM
From the Windows SDK, use a call to GetComputerObjectName() where the NameFormat is 'NameUniqueId'.

BOOLEAN GetComputerObjectName (
EXTENDED_NAME_FORMAT NameFormat, // name format
LPTSTR lpNameBuffer, // name buffer
PULONG nSize // size of name buffer
);



Parameters
NameFormat
Value from the EXTENDED_NAME_FORMAT enumeration type indicating the desired name format. This value cannot be NameUnknown.
lpNameBuffer
Pointer to a buffer that receives the name in the specified format.
nSize
Pointer to a ULONG variable. On input, the variable indicates the size, in characters, of the lpNameBuffer buffer. On output, the variable returns the size of the returned string including the terminating null character.
If the lpNameBuffer buffer is too small to hold the name, the function fails and nSize returns the required buffer size.

Return Values
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

CJE
August 16th, 1999, 01:11 PM
formatting the hard drive can alter the information retrieved with GetVolumeInfo

Ryan@Neoworx
August 16th, 1999, 02:32 PM
As far as I can see, this only works in win2000, and only if the machine is on some sort of network.

Ryan

NeoWorx Inc.
http://www.neotrace.com/img/gettrace_b.gif
Makers of NeoTrace, NeoLite, and other upcoming products
http://www.neoworx.com/

Ryan@Neoworx
August 16th, 1999, 02:38 PM
Unfortunately, a truly unique ID that persists with a machine and/or user is hard to find.

The serial # for a hard drive is the best, in my opinion. But, if the user installs a new HD, then it's no go.

Unfortunately, any item, whether hardware or software, where you get a serial # from will most likely be replaced during the life of a computer.

You could use a pair (say, HD serial and e-mail address). If the user changes HD's, then a new key can be e-mailed to them. If they change e-mail addresses, the program can use the HD key to authenticate the change request.

If they change both simultaneously, then they've most likely changed jobs and/or computers, and would most likely need to purchase a new key to stay legit.

Just my two cents.

Ryan

NeoWorx Inc.
http://www.neotrace.com/img/gettrace_b.gif
Makers of NeoTrace, NeoLite, and other upcoming products
http://www.neoworx.com/

Paul Belikian
August 16th, 1999, 09:25 PM
Hi,

There isn't a pratical way to do this. PCB vendors do not make mainboards one by one. This includes the BIOS. On a very rare occation, the PC vendor will put a serial number in the system's BIOS, but there is no standard saying where it should be put or that it has to be there in the first place. For reasons pointed out before, the HDD serial number, the NIC, or video BIOS are not good choices either. The only way to get a unique number from a PC is to put it in the PC in the form of a BIOS extension, like an ISA or PCI card yourself. Sometimes a hardware device or plug can be used on the printer or serial port that holds this information. But from a out the box PC, Compaq 360 #1 is the same as Compaq 360 #10,000. Maybe if you let us know why you are trying to do this, we could suggest a better way or method.


Regards,

Pau

Paul Belikian
August 16th, 1999, 09:25 PM
Hi,

There isn't a pratical way to do this. PCB vendors do not make mainboards one by one. This includes the BIOS. On a very rare occation, the PC vendor will put a serial number in the system's BIOS, but there is no standard saying where it should be put or that it has to be there in the first place. For reasons pointed out before, the HDD serial number, the NIC, or video BIOS are not good choices either. The only way to get a unique number from a PC is to put it in the PC in the form of a BIOS extension, like an ISA or PCI card yourself. Sometimes a hardware device or plug can be used on the printer or serial port that holds this information. But from a out the box PC, Compaq 360 #1 is the same as Compaq 360 #10,000. Maybe if you let us know why you are trying to do this, we could suggest a better way or method.


Regards,

Paul Belikian

August 17th, 1999, 02:39 AM
I'm trying to protect the software to be copied by unauthorized person. The idea is when I distribute the software to my client and during the program setup, it should read and generate an "ID' from the machine and I'll give a license code base on the "ID" to the client. This ID must be unique from one to the other to protect the license being abuse.
Is a good idea to use the HD serial number but I found that if i duplicate the HD then the HD label, volume serial number, registry info and even NT logon password will be the same. Netcard may be the solution but unfortunately, the machine doesn't require a network service.
I still looking for a better way. If someone know, please help! Thanks in advance.

Jack Shainsky
August 17th, 1999, 02:57 AM
The problem is that a lot of advanced users change their hardware and reinstall software constantly. For example, all my friends (and Me among them) reinstall Windows (and all software) at least once per month (and it means reformatting HD and changing it's volume number), and changing hardware at least once per 3 monthes. If every time we would need to request the new serial number from software creator, it would not be a good though.

Jack Shainsky
Jerusalem, Israel.
jack.shainsky@usa.net

Cat
August 17th, 1999, 03:55 AM
Hi out there,

i think using the MAC address is the best way as it is truely unique worldwide. There also must be a workaround if no ethernet card is installed.

Just think about the Win98 registration issue, where MS sent itself an

kkirkhope
July 11th, 2001, 11:36 AM
Another option is combining the data from two sources. Consdier this:
You can find the BIOS serial number. Though many of the BIOS manufacturers store it at different memory locations, it is always found between x0F0000 and x0FFFFF. You will need to map these memory locations and perform some string analysis on the regions. The next thing is to read the Windows product ID from the registry. If you encode these two items together you get a farely unique ID and it allows the user to re-install windows as long as they use the same disc and auth code.

This has worked well for me so far.. I have gone the extra mile to encode the installation date into the mix and check for the clock. My codes expire after 6 months anyway requiring a new auth code. This is a pain I know but this way if they say they have upgraded the system but really just copied the software on to another comupter, the codes expire. So they only have benefit of the addition copy for a short period of time. I personally learned a lot about software protection by breaking it. I have changed the HD serial number on a whim because I could. It is very easy to do and requires nothing more than the DEBUG program that come with all Windows and DOS. I wouldn't use it for any kiind of protection. Now if you want to go nuts. I know of a software vender that requires you system to have a NIC whether you are on a network or not. They use the MAC, the BIOS, the OS, the HDD, the Partition info, the amaount of RAM, etc. etc.. The auth code they send you is 96 digits. You even look at the system the wrong way and you require a new code. Is it annoying? You bet. Do they have any piracy? Not whatsoever...

Food for thought.

Ken Kirkhope

ces
July 23rd, 2001, 02:46 PM
If you are seeking software copy-protection, I can surely help you out. I know DanielK rightly points out using hardware identifiers is not good because hardware could be changed frequently and he would hardware dongles. But it is equally true that hardware dongles are costly solutions and why the hell will an end-user like to attach a hardware dongle to his/her computer's USB port (for example)? Moreover, if all software developers used several hardware dongle solutions, how many USB ports, serial ports, etc. are expected on a single non-networked computer? I tell you that people will eventually dislike hardware dongles unless they are thoroughly integrated with core hardware of the system and there is ONLY ONE standard. This is a thing far into future!

At present, you may take a look at my own product Digital Lock (http://digitallock.createevent.com/) for copy-protection. It somewhat addresses the hardware upgrade problem properly :-) And by the time hardware dongles are widely acceptable, Digital Lock will not be out of the market (I guess) because it is very easy to use hardware dongles with Digital Lock too. So don't hesitate to contact me for further details.

DanielK
July 23rd, 2001, 02:50 PM
Could you please stop spamming the forum with advertisments for your product? It's one thing to answer a question when it appears, but taking each and every software protection thread and replying to it, the same exact message???

We get it! you're selling a product. Don't interrupt the forum to do so. If anything, send private messages to the people asking for help, or wait until somebody posts a new question!

Got a question? try looking it up in MSDN first. Msdn comes with the Visual Studio, and can be found at http://msdn.microsoft.com
---===---
I'm not here for the rates, but rating a post is a good way for me to know how much i helped.
---===---
Daniel

ces
July 23rd, 2001, 02:59 PM
*I apologize for selling a product on a public form* ... but the thing is YOU (DanielK) ALSO PROMOTED A COMMERCIAL PRODUCT WHEN YOU TALKED ABOUT ALLADIN ... so you were the first one to do that. I read quite a number of messages and found out that you were promoting a product and no one else did.

and the product I talked about is not software-based system at all. It is just a SDK that uses hardware identification at its core and by the way ***any hardware can be used because of custom machine identification ... thus hardware dongles can be used if the developer wants to. Do check it out properly ... don't just quote the website news or product page info. And why the heck should people attach extra hardware to their systems and why should developers increase the per-unit overhead cost of their software products????????

DanielK
July 23rd, 2001, 03:08 PM
A. I only promote Aladdin when the subject comes up, and I believe the product can help.
B. I do not spam the forum.

And why the heck should people attach extra hardware to their systems and why should developers increase the per-unit overhead cost of their software products????????

For the same reason you need to go through a magnetic detector when you leave a store. Software developers have to constantly deal with hackers distributing illegal copies of their software. Hardware protection is the only way to stop this.


Got a question? try looking it up in MSDN first. Msdn comes with the Visual Studio, and can be found at http://msdn.microsoft.com
---===---
I'm not here for the rates, but rating a post is a good way for me to know how much i helped.
---===---
Daniel

ces
July 23rd, 2001, 03:22 PM
A: I also promoted my product when the subject came up. Definitely I didn't talk about it when some was asking a help regarding Winsock in the forum!

B: I believe that hardware is the best solution. But you must be convinced that my product didn't use ordinary random keys to implement copy-protection. It is flexible and can system hardware (default) or hardware attachments or anything else.

Okay, let's not fight :-))