hard drive serial number
Page 1 of 3 123 LastLast
Results 1 to 15 of 44

Thread: hard drive serial number

  1. #1
    Join Date
    Oct 1998
    Location
    Farmington Hills, MI USA
    Posts
    149

    hard drive serial number

    I have a commercial software package for small business that I have been selling for a long time. Its kind of like a POS but does a lot more.

    I have been using different ways of software security to avoid piracy including dongle hardware lock, third party software licensing etc. Most of these require a new compile of the product on my part for every new client.

    I have come up with a way to do it within the software without having to buy a third party product which only adds on my nightmares of post-sales support. I want your openion on this:

    When the product is launched, it checks for hard drive serial number and stores in the memory. It then checks for a particular place in the registry for an encrypted text. If it finds it, it decrypts it, parses out the multiple keys from the string and the remaining is hard drive serial number. Then it compares the hard drive serial number found in the decrypted text with the serial number of the hard drive it earlier retrieved. If the encrypted text in the registry was not found at all or the hard drive serial numbers didn't match, it tells the user that the software is not registered. It also displays the hard drive serial number to the user telling him to call or email my company to let me know the number.

    Most of the time I am the one putting together the hardware and software for my customer so the user won't see this dialog in most cases. But I wanna be able to allow downloading the product over the web etc so I do want to be able to register the product remotely.

    I have created a tool to generate a registry file. The tool uses the serial number and a combination of keys to create a encrypted string to be stored in a registry location. The registry file would then be sent to the buying/paying customer.

    I didn't mean to bore you guys with the whole story here but what I want to know is that is is possible to change the serial number of a hard drive?

    If you use ghost software or something similar to create ghost images and then deploy them back to a new hard drive, does the serail number of the source hard drive get copied too?

    Also, let me know of what you think about it and if you have a better idea or point out and disadvantages that I am not seeing?

    I know that this idea will not work with SCSI hard drives but I am not concerend about that.

    I really appreciate your time...
    Last edited by masif; November 18th, 2002 at 11:40 AM.

  2. #2
    Join Date
    Sep 1999
    Location
    Dallas, Tx.
    Posts
    20,656
    Last software company I worked for also used the hdd serial number for registration. Worked pretty well.


    Yes the serial number can be changed via a hex editor. (i've never done it as its not for the waek at heart) And yes cloning drives can be an issue too.
    "Imagine a world where dogs took bad owners to the pound."

    http://www.hopeforpaws.org/

  3. #3
    Join Date
    Jul 2002
    Posts
    215
    You cannot change the serial number, this is hard coded by manufacturer as they use it for warranty and tracking purposes.

  4. #4
    DrMDJ is offline Virtual PC Specialist!!!
    Join Date
    Apr 2000
    Location
    NJ, USA
    Posts
    8,428
    The hardware/device serial number is pretty secure. This is the number you'll get if you are using (say) the low level (ATA) command Identify Drive to retrieve the serial number. The disk/volume serial number is not secure at all. It can be changed/altered any number of ways, even by simply formatting. This is the number you get if you use something like the windows api GetVolumeInformation call to retrieve the serial number (here the serial number is in the format XXXX-XXXX).
    Please remember to post back whether your problem is resolved or
    not, so that others may gain from the knowledge.

  5. #5
    Join Date
    Oct 1998
    Location
    Farmington Hills, MI USA
    Posts
    149
    DrMDJ

    Are u sure u are talking about serial number of the HD or the volume name?

    I know that the volume name can be changed by formatting the hard drive but I never knew that serial number can also be changed like that.

  6. #6
    Join Date
    Sep 1999
    Location
    Dallas, Tx.
    Posts
    20,656
    When you type DIR at a dos prompt and see:

    Volume Serial Number is F819-AB02

    Yes, this is the serial number can be changed.
    "Imagine a world where dogs took bad owners to the pound."

    http://www.hopeforpaws.org/

  7. #7
    Join Date
    Oct 1998
    Location
    Farmington Hills, MI USA
    Posts
    149
    Ok, now I am confused...

    When I type DIR on my command prompt, I get is C418-684B.

    But when I use the API to get the volume information, I get a different serial number which is always numeric. I have tested this on more than 20 machines.

    Here is an example of how I get the serial number programatically in visual basic:


    Private Declare Function GetVolumeInformation Lib "Kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long


    Private Sub Form_Load()Dim Serial As Long, VName As String, FSName As String
    'Create buffers
    VName = String$(255, Chr$(0))
    FSName = String$(255, Chr$(0))
    'Get the volume information
    GetVolumeInformation "C:\", VName, 255, Serial, 0, 0, FSName, 255
    'Strip the extra chr$(0)'s
    VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
    FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)
    Debug.Print "The Volume name of C:\ is '" + VName + "', the File system name of C:\ is '" + FSName + "' and the serial number of C:\ is '" + Trim(Str$(Serial)) + "'", vbInformation + vbOKOnly, App.Title
    End Sub



    The output of this is following:


    The Volume name of C:\ is 'C', the File system name of C:\ is 'NTFS' and the serial number of C:\ is '1082622541'



    hmmmm

    Are u sure we are talking about the same thing?

  8. #8
    Join Date
    Oct 1998
    Location
    Farmington Hills, MI USA
    Posts
    149
    Originally posted by Zedy
    You cannot change the serial number, this is hard coded by manufacturer as they use it for warranty and tracking purposes.

    Zedy, this is what I thought, but from all the other responses I am getting here, it sounds like I was wrong


    - masif

  9. #9
    Join Date
    Sep 1999
    Location
    Dallas, Tx.
    Posts
    20,656
    Not sure how to phrase this. The serial number I posted: F819-AB02 is the "hexadecimal" version which calculates into 4162431746.
    "Imagine a world where dogs took bad owners to the pound."

    http://www.hopeforpaws.org/

  10. #10
    Join Date
    Oct 1998
    Location
    Farmington Hills, MI USA
    Posts
    149
    Originally posted by Steve R Jones
    Not sure how to phrase this. The serial number I posted: F819-AB02 is the "hexadecimal" version which calculates into 4162431746.
    u can say hexadecimal. I am a programmer.

    This is very interesting though. I will see if my hexadecimal number is equal to the serial number
    my code doesn't break, it only bends

  11. #11
    Join Date
    Oct 1998
    Location
    Farmington Hills, MI USA
    Posts
    149
    Originally posted by Steve R Jones
    Not sure how to phrase this. The serial number I posted: F819-AB02 is the "hexadecimal" version which calculates into 4162431746.
    Ok, I am still confused...

    when I type DIR on dos prompt, I get: C417-683B

    This calculates to decimal value of 3289868347 which is not equal to the serial number I get via the API. read on...

    When I use the API, the serial number is: 1082622541

    When I convert this to hexadecimal it is: 4087824D


    Now the number that u posted (4162431746) does infact transtales to F819-AB02 but how did u get that number?
    my code doesn't break, it only bends

  12. #12
    Join Date
    Oct 1998
    Location
    Farmington Hills, MI USA
    Posts
    149
    [Not sure how to phrase this. The serial number I posted: F819-AB02 is the "hexadecimal" version which calculates into 4162431746.

    oooops!! you are right, I was on a different drive (U:\>)when I tried DIR on dos prompt. my bad....

    when I try it on c:\ they are same numbers.

    Thanks for ur help....

    u still stand by the fact that this number could be changed huh?
    my code doesn't break, it only bends

  13. #13
    Join Date
    Aug 2001
    Location
    Joplin, MO USA
    Posts
    2,111
    I trust greater minds than mine will answer you... but...:

    I'm of the opinion that any change you make in this regard is actually changing a value that's in memory (perhaps mirrored in the registry or other config files of some sort), NOT the actual HD serial number embedded in the hardware. If this premise is correct, then a reboot would always reset this number to the actual HD serial number, thereby losing your change. But I've been wrong 3 times this year, so maybe this is the fourth?!!

    Various Windows and Linux platforms...

  14. #14
    Join Date
    Sep 1999
    Location
    Dallas, Tx.
    Posts
    20,656
    I sent a PM to DrMDJ. Am sure he can explain where the number is etc...

    Like I mentioned, my old company used the same number. We caught one company trying to beat our registration process by changing the serial number on a few machines. And the super geeks in the back room had to make us a a little to change the number on cloned drives.

  15. #15
    DrMDJ is offline Virtual PC Specialist!!!
    Join Date
    Apr 2000
    Location
    NJ, USA
    Posts
    8,428
    Sorry for not checking back here sooner. I only rarely pop over to the 2k forum. Anway, got Steve's PM and...

    Steve already explained about the fact that the number you are getting back when issuing the GetVolumeInformation API is the decimal eqivalent of the number you see doing something like the Dir command (ie. a hex number in the form xxxx-xxxx). This all is what I was talking about in my first post, that the GetVolumeInformation does not return the real "hardware" serial number. To get that number you need to issue something like the low level ATA command Identify Drive.

    The number that GetVolumeInformation returns is for a partition. This number can be set and reset in a variety of ways. Like I said before, just formatting a drive changes the number. With a format the number gets set/assigned randomly. You can also force the number to a specific one programmatically. An example of a utility out there that does just this is VolumeID from www.sysinternals.com.

    I kinda figured you weren't relying on the hardware serial number, but wasn't sure. Anyway, using the number returned by GetVolumeInformation is not really a reliable means of providing security in your software.
    Last edited by DrMDJ; November 19th, 2002 at 10:59 PM.
    Please remember to post back whether your problem is resolved or
    not, so that others may gain from the knowledge.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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