CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Guest

    How to get a unique ID from a PC

    How to get a unique ID from a PC. Please help if you know.

    Thanks in advance.


  2. #2
    Guest

    Re: How to get a unique ID from a PC

    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...!).



  3. #3
    Guest

    Re: How to get a unique ID from a PC

    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


  4. #4
    Join Date
    Jul 1999
    Posts
    5

    Re: How to get a unique ID from a PC

    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.




  5. #5
    Join Date
    Aug 1999
    Posts
    107

    Re: How to get a unique ID from a PC

    formatting the hard drive can alter the information retrieved with GetVolumeInfo


  6. #6
    Join Date
    Jul 1999
    Location
    Dayton, OH
    Posts
    55

    Re: How to get a unique ID from a PC

    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.

    Makers of NeoTrace, NeoLite, and other upcoming products
    http://www.neoworx.com/

  7. #7
    Join Date
    Jul 1999
    Location
    Dayton, OH
    Posts
    55

    Re: How to get a unique ID from a PC


    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.

    Makers of NeoTrace, NeoLite, and other upcoming products
    http://www.neoworx.com/

  8. #8
    Join Date
    Jul 1999
    Location
    Pasadena, CA - USA
    Posts
    351

    Re: How to get a unique ID from a PC

    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

  9. #9
    Join Date
    Jul 1999
    Location
    Pasadena, CA - USA
    Posts
    351

    Re: How to get a unique ID from a PC

    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

  10. #10
    Guest

    Re: How to get a unique ID from a PC

    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.



  11. #11
    Join Date
    May 1999
    Location
    Jerusalem, Israel
    Posts
    251

    Re: How to get a unique ID from a PC

    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.
    [email protected]

  12. #12
    Join Date
    Mar 1999
    Location
    Bavaria/Germany
    Posts
    20

    Re: How to get a unique ID from a PC

    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

  13. #13
    Join Date
    Oct 2000
    Location
    Alberta, Canada
    Posts
    13

    Re: How to get a unique ID from a PC

    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

  14. #14
    Join Date
    Jul 2001
    Location
    India
    Posts
    26

    Re: How to get a unique ID from a PC

    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.


  15. #15
    Join Date
    Dec 1999
    Location
    Israel
    Posts
    2,851

    Re: How to get a unique ID from a PC

    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

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured