Can/Why Does A Hard Drive Serial Number Change

╄→尐↘猪︶ㄣ 提交于 2019-12-05 21:57:14

I know this is a bit of an old thread, but I have just had the same issue, using the drive's serial number as a key. I thought it would be good to document my findings somewhere.

One thing I noticed was that somewhere between Windows 7 and Windows 8.1, there seems to have been a change in how the WMI routines return the drive serial number.

I have masked out 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 byte-swapping the drive info.

Our anti-piracy software identifies people according to their Hard Drive Serial. This I believe is a constant feature and will not change unless the user changes their primary physical drive - correct me if I am wrong?

In normal usage the serial number should not change, but it is possible for a user to change it if they are trying to bypass your anti-piracy technique. See here for a list of tools that do this, aimed at people trying to bypass anti-cheat systems in games. So you have to consider whether the hard disk serial number is "good enough" to deter most people from pirating your software.

What could cause such a problem? Is our code that identifies the serial not comprehensive across windows operating systems?

See this forum thread. Results are varying depending on Windows version, on whether the code is run as admin or not, and whether the Win32_PhysicalMedia class is used or the Win32_DiskDrive class. Seems pretty unreliable, you may have to write your own abstraction layer to handle it yourself, as described in these forum posts.

I tried it myself and found I got two different serial numbers depending on admin vs normal and Win32_PhysicalMedia vs Win32_DiskDrive:

VB38bb50ab-0de50c12 

and

42563833626230356261302d6564303531632032

Notice that the second string is actually a hex-encoded and byte-reversed version of the first string! Maybe the same is happening to you?

is the Hard Drive Serial number the MAC address of the hardware device or something else?

A MAC (Media Access Control) address only relates to network interfaces, nothing to do with hardid disks. The hard drive serial number is an arbitrary string set by the hard disk manufacturer - it can be anything and only has meaning to the manufacturer, it could even be blank if the manufacturer does not implement it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!