Results 1 to 14 of 14

Thread: hardwareAddress(es)

  1. #1
    Join Date
    Sep 2007
    Location
    Ankara TURKEY
    Posts
    32
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question hardwareAddress(es)

    I need to know any hardware id which will never change? Like HDD, GPU, CPU or BIOS serial that unique and can't changeable.

    I tried to use QNetworkInterface but It couldn't helped because
    On one hand even if I format the OS and reinstall it MAC "QNetworkInterface::hardwareAddress()" doesn't changes but it can be chanced by anybody.
    On the other hand if I use "QNetworkInterface::name()" It can't be changed by anybody but after formating the system and reinstalling the OS, it change randomly.

    I need any unique and not changeable serial number (or string) of hardware
    Last edited by uygar; 11th June 2009 at 15:26.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: hardwareAddress(es)

    Quote Originally Posted by uygar View Post
    I need any unique and not changeable serial number (or string) of hardware
    That is not possible! Everything can change, you can change your CPU, your main board...

    I guess you will generate a serial number, so take a string which contains more information, like cpu, gpu, BIOS and whatever, and check against them in a manner that it is valid even if one parameter changed or two or... It depends how friendly you will be against your customer.

  3. #3
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    131
    Thanks
    11
    Thanked 16 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: hardwareAddress(es)

    What are you trying to archieve?

  4. #4
    Join Date
    Sep 2007
    Location
    Ankara TURKEY
    Posts
    32
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Post Re: hardwareAddress(es)

    Quote Originally Posted by nightghost View Post
    What are you trying to archieve?
    I want to protect my project and my pruduct. I install it by myself in the first time but after that, my customers calls me for a new serial key of my pruduct. I need to be sure that they ask for the same system that I installed before not for a new one.

    Quote Originally Posted by Lykurg View Post
    That is not possible! Everything can change, you can change your CPU, your main board...
    I know that, but it is not problem, because it happen too rare and it is acceptable to take a risk of it.
    Quote Originally Posted by Lykurg View Post
    I guess you will generate a serial number, so take a string which contains more information, like cpu, gpu, BIOS and whatever, and check against them in a manner that it is valid even if one parameter changed or two or...
    That is true, if I read more than one hardware serial, I could figure out that, that is just an upgrade or not.

    Or you may have any idea about protecting of software with out disturbing the customers.
    Last edited by uygar; 11th June 2009 at 15:25.

  5. #5
    Join Date
    Sep 2007
    Location
    Ankara TURKEY
    Posts
    32
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Re: hardwareAddress(es)

    Maybe BIOS and GPU serial could be good for this job but I don't know how I read these strings

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: hardwareAddress(es)

    Quote Originally Posted by uygar View Post
    Maybe BIOS and GPU serial could be good for this job but I don't know how I read these strings
    you have to use native functions. Qt won't help you on that. There are some threads about hard disk serial detection on that forum with some example code. Use the search to find them. I don't know them right now..

  7. The following user says thank you to Lykurg for this useful post:

    uygar (12th June 2009)

  8. #7
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    131
    Thanks
    11
    Thanked 16 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: hardwareAddress(es)

    Quote Originally Posted by Lykurg View Post
    you have to use native functions. Qt won't help you on that. There are some threads about hard disk serial detection on that forum with some example code. Use the search to find them. I don't know them right now..
    Qt Code:
    1. #ifdef Q_WS_X11
    2. //native code
    3. #elif Q_WS_MAC
    4. //native code
    5. #elif Q_WS_WIN
    6. //native code
    7. #endif
    To copy to clipboard, switch view to plain text mode 


    I think QNetworkInterface::hardwareAddress() will do the job. It may not be perfect, but enough to prevent easy copying. If you need more maybe a commercial License Management Solution will be a better solution

  9. The following user says thank you to nightghost for this useful post:

    uygar (12th June 2009)

  10. #8
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: hardwareAddress(es)

    Harddisk serial: see this thread.
    Last edited by Lykurg; 12th June 2009 at 10:53.

  11. #9
    Join Date
    Sep 2007
    Location
    Ankara TURKEY
    Posts
    32
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Talking Re: hardwareAddress(es)

    Quote Originally Posted by Lykurg View Post
    Harddisk serial: see this thread.
    Wow this's realy helpfull thanks a lot, I'll try it immediately.

  12. #10
    Join Date
    Sep 2007
    Location
    Ankara TURKEY
    Posts
    32
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Lightbulb Re: hardwareAddress(es)

    Qt Code:
    1. ...
    2. #ifdef Q_WS_WIN
    3. #define Q_WS_WIN
    4. DWORD dwVolSerial;
    5. BOOL bIsRetrieved;
    6. bIsRetrieved = GetVolumeInformation(TEXT("C:\\"), NULL, NULL, &dwVolSerial, NULL, NULL, NULL, NULL);
    7. if (bIsRetrieved) {
    8. QMessageBox::information(0, QString::fromUtf8("Good"), "Serial number of drive C is\n" + QString::number(dwVolSerial,16));
    9. } else {
    10. QMessageBox::warning(0, QString::fromUtf8("Bad"), "Serial number of drive C is nothing");
    11. }
    12. #endif
    13. ...
    To copy to clipboard, switch view to plain text mode 
    I read HardDisc VolumeSerial but after formating the system it changes. That because it is not perfect but it's OK.

    While I was searching about that, I found that link:
    http://msdn.microsoft.com/en-us/library/aa394373.aspx

    That is really good, especially UniqueId
    UniqueId
    Data type: string
    Access type: Read-only
    Globally unique identifier for the processor. This identifier may only be unique within a processor family. This property is inherited from CIM_Processor.
    But I could not use it because I am not too good at codding. What should I do to use this proporty?

  13. #11
    Join Date
    Apr 2009
    Posts
    21
    Thanked 3 Times in 2 Posts

    Default Re: hardwareAddress(es)

    http://crystalmark.info/?lang=en

    CPU id and Disk info, open source

  14. #12
    Join Date
    Sep 2007
    Location
    Ankara TURKEY
    Posts
    32
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: hardwareAddress(es)

    Quote Originally Posted by freezeblue View Post
    http://crystalmark.info/?lang=en

    CPU id and Disk info, open source
    Thank you freezeblue but I have alrady used them. It just gave me about what is cpu, Not unique things. I mean if both of us buy systems having same CPUs it returns same strings.

    ChipID=Intel(R) Core(TM)2 Duo CPU P7350 @ 2.00GHz
    VendorID=GenuineIntel
    etc.

  15. #13
    Join Date
    Sep 2007
    Location
    Ankara TURKEY
    Posts
    32
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: hardwareAddress(es)

    Qt Code:
    1. class Win32_Processor : CIM_Processor
    2. {
    3. uint16 AddressWidth;
    4. ...
    5. string UniqueId;
    6. ...
    7. uint32 VoltageCaps;
    8. };
    To copy to clipboard, switch view to plain text mode 

    This is the class I need to use but I can't.
    http://msdn.microsoft.com/en-us/library/aa394373.aspx
    Last edited by uygar; 15th June 2009 at 21:52.

  16. #14
    Join Date
    Jan 2007
    Posts
    201
    Thanks
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: hardwareAddress(es)

    same thing happened to I failed to get an address with a qt application

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.