1

我知道,这个问题被创建了很多次,但它仍然是开放的

问题如下:

我的应用程序需要为计算机生成一些 UID,它正在运行。我需要它来实现真正的保护。

MAC 地址是一个很好的候选者,因为它对于每个以太网卡都是唯一的。

许多文章使用 GetAdaptersInfo、WMI、NetBIOS 或套接字。

这是其中之一:获取 MAC 地址的三种方法。

他们,支持,返回一个 MAC 地址,但是这个地址可以从适配器属性中手动设置

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

所有提到的方法都不符合我的需要,因为使用驱动程序设置的 MAC 地址比真正的硬件 MAC 地址具有更高的优先级。我知道,所有 Win API 函数都会返回这个“假”地址,因此,真正的保护很容易被打破。

伙计们,您的任何帮助将不胜感激。

谢谢。

4

3 回答 3

6

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.

于 2010-01-18T21:36:22.707 回答
1

MAC 地址是一个很好的候选者,因为它对于每个以太网卡都是唯一的。

恐怕不是。首先,我读过客户收到整批具有相同 MAC 地址的机器的报告(显然这会在构建集群时造成痛苦)。

我还亲眼看到了一台在重新启动时会更改其 MAC 地址的机器。每次。这是一台运行 Windows XP 的旧 IBM Thinkpad。

我的建议:如果您要生成唯一 ID,请远离 MAC 地址。

于 2010-01-27T22:06:41.870 回答
0

我不认为您提到的“网络地址”是指 MAC 地址。某些设备允许您出于 ISP 目的“欺骗” MAC 地址,但您应该能够使用您找到的方法获取真实的 MAC 地址。

于 2010-01-18T21:36:14.967 回答