Question

I 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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top