How to get TRUE hardware MAC address [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this questionI know, that this question was created many times, but it is stil open
The problem is following:
My application need to generate some UID for computer, it working on. I need it to implement the genuine protection.
MAC address is a good candidate, because it is unique for each ethernet card.
Many articles uses either GetAdaptersInfo, WMI, NetBIOS开发者_运维百科 or Sockets.
Here is one of them: Three ways to get your MAC address.
They, shore, return a MAC address, but this address can be set by hands from adapter properties
Control Panel > Network and Internet > Network and Sharing Center > Change Adatper Settings > right click on adapter > Properties > click "configure" button > go to "Advanced" tab > chose "Network Address" and change it
The all mentioned methods are not match my needs, because a MAC address, being set with driver has greater priority, than true hardware MAC address. This "fake" address will be returned by all Win API functions, that i know, and therefore, the genuine protection can easy be broken.
Any help from you, guys, will be greatly appreciated.
Thanks.
The only means that Windows has to access the MAC address is asking the driver.
That's what the driver is for - to talk to the hardware so that Windows doesn't have to include code for every single device anyone might come up with ever.
If the driver is telling Windows that the MAC address is something, then that's what the MAC address is.
MAC address is a good candidate, because it is unique for each ethernet card.
I'm afraid not. Firstly, I've read reports of customers receiving entire batches of machines with identical MAC addresses (apparently this causes pain when building clusters).
I have also seen with my own eyes a machine that changes its MAC address on reboot. Every time. It was an old IBM Thinkpad running Windows XP.
My advice: stay well away from MAC addresses if you're generating unique IDs.
I don't think "Network Address" you mention refers to the MAC address. Some devices allow you to "spoof" the MAC address for ISP purposes, but you should be able to get the real MAC using the methods you found.
精彩评论