Can / Why Change Hard Drive Serial Number

Our anti-piracy software identifies people according to their hard drive. I believe this is a permanent feature and will not change unless the user changes their primary physical drive - correct me if I'm wrong? We are using WMI

python module to get custom hard disk serial number.

For our 2 test computers, the hard drive serial number has changed. But we haven't changed our hard drive at all.

What could be causing this problem? Is our code that identifies a series that is not universal across all Windows operating systems? I noticed that the post mentions that you can get the wrong serial number if the standard custom process gets the serial number. But in our case, the error also occurred at the administrator.

Some important information:

  • Both of these test nodes are using Windows 8 Professional
  • One computer is a Toshiba laptop.
  • Another computer - Acer Iconia tablet
  • The tablet was recently upgraded from Windows 8 to Windows 8.1 and I noticed that the serial number was changed after this update
  • There is an admin user on the laptop who ran into a problem. The tablet has a standard user who ran into a problem.

Also is there the serial number of the hard drive the MAC address of the hardware device or something else?

Code for getting the serial number of the hard drive:

c = wmi.WMI()
for item in c.Win32_PhysicalMedia():
    if "PHYSICALDRIVE" in str(item.Tag).upper():
        serialNo = item.SerialNumber
        break

      

Edit: A short script that fetches the serial number of the user's hard drive as a normal process and as a promoted / admin process.

Note: For me, it outputs exactly the same serial number regardless of user or administrator. Does this script do the same for you?

import os
import sys
import wmi
import win32com.shell.shell as shell
ASADMIN = 'asadmin'

def get_elevated_privleges():
    if sys.argv[-1] != ASADMIN:
        script = os.path.abspath(sys.argv[0])
        params = ' '.join([script] + sys.argv[1:] + [ASADMIN])
        shell.ShellExecuteEx(lpVerb='runas', lpFile=sys.executable, lpParameters=params)


def get_hard_drive_serial():
    c = wmi.WMI()
    for item in c.Win32_PhysicalMedia():
        if "PHYSICALDRIVE" in str(item.Tag).upper():
            return str(item.SerialNumber)

    return None


print "HD Serial as Regular User: " + get_hard_drive_serial()
get_elevated_privleges()
print "HD Serial as Admin User: " + get_hard_drive_serial()

      

+3


source to share


2 answers


I know this is a little old thread, but I had the same problem using the serial number of the drive as the key. I thought it would be good to document my results somewhere.

One thing I noticed is that somewhere between Windows 7 and Windows 8.1 there seems to be a change in how the WMI routines return the serial number of the drive.

I have masked some characters.



Windows 10  reports: [S21D********04F]
Windows 8.1 reports: [S21D********04F]
Windows 7   reports: [2SD1********40 F]

      

It seems that W7 and below are not bytes for disc information exchange.

+3


source


Our anti-piracy software identifies people according to their hard drive. I believe this is a permanent feature and will not change unless the user changes their primary physical drive - correct me if I'm wrong?

The serial number should not change under normal use, but the user can change it if he tries to circumvent his anti-piracy method. See here for a list of tools that do this , aimed at people trying to bypass anti-cheat systems in games. Therefore, you need to consider whether the serial number of your hard drive is "good enough" to deter most people from piracy of your software.

What could be causing this problem? Is our code that identifies the serial number incompletely on Windows operating systems?

See this forum thread . Results vary depending on the version of Windows, whether the code is run as an administrator or not, and whether a class Win32_PhysicalMedia

or a class is used Win32_DiskDrive

. Seems pretty unreliable, you might have to write your own abstraction layer to handle it yourself, as described in these forum posts.

I tried it myself and found that I have two different serial numbers depending on admin vs normal and Win32_PhysicalMedia

vs Win32_DiskDrive

:

VB38bb50ab-0de50c12 

      



and

42563833626230356261302d6564303531632032

      

Note that the second line is actually the hex and byte version of the first line! Maybe the same is happening to you?

is the serial number of the hard drive the MAC address of the hardware device or something else?

MAC (Media Access Control) address only applies to network interfaces not associated with hard drives. The hard drive serial number is an arbitrary string given by the hard drive manufacturer - it may be something else and only make sense to the manufacturer, it may even be empty if the manufacturer does not implement it.

+2


source







All Articles