Windows 8 series (8): an alternative to Win8 that cannot obtain the unique identifier of a machine

Source: Internet
Author: User
Tags intel core i5
ArticleDirectory
    • Ashwid Structure

In order to ensure the security of users, the server once required various clientsProgramBased on the unique identifier of the machine, such as MD5AlgorithmObtain a value and pass it to the server. However, I have searched the API documentation and the official msdn forum, and I have not found the function of using deviceextendedproperties. trygetvalue ("Deviceuniqueid",OutDeviceuniqueid) You can directly obtain the unique identifier of the machine. The result is only one sentence: you cannot do that from a Metro app. That is by design.

It may be that we started Win8 development earlier. Later, I don't know when. Recently, I learned that there is a way to get a similar identifier: app specific hardware ID (ashwid ), open the blog Park and share it with you.

 

APP specific hardware ID (ashwid) is translated into Chinese: application-specific hardware ID. For each application/package, the obtained ashwid is different. Unless the basic hardware has been changed, the two calls of the same application will lead to the same ashwid. However, if the hardware configuration file of the device is changed (for example, when the user pulls out the USB Bluetooth adapter), The ashwid is changed. The backend cloud service can verify the ashwid and compare it with the previously reported value. Although the ashwid changes, you can analyze it to check whether the changes are caused only by small changes (for example, memory increase in the system. The variation level is determined by the implementation of the backend cloud service. The subsequent sections provide guidance on specific elements that constitute ashwid and how to analyze these elements.

 

That is to say, on the same machine (the hardware devices are not changed), The ashwids of different applications are different, and the ashwids of different versions of the same application are the same. The same application has different ashwids on different machines.

 

Ashwid Structure

Ashwid is the result of multiple hardware components that constitute the device. Ashwid is designed to prevent system-specific behaviors and protect user privacy. Each component (if any) corresponds to a part of the returned ashiwd byte stream. Nine components are listed below:

 

    1. Cpu id of the processor
    2. Memory size
    3. Serial number of the disk device
    4. Network Adapter (nic mac address-First Instance)
    5. Audio Adapter
    6. Docking Station
    7. Bluetooth address
    8. Mobile broadband device ID
    9. Bios

 

Ashwids example

The enumeration sequence of different component IDs does not need to be consecutive. The following example shows a small number of ashwids. Note: in a stream, the number and sequence of component IDs are different.

 

    • 124,215, 206,143, 12,222, 128,255, 48,155, 250,155, 162,217, 92,101

      Mobile broadband found on Samsung Intel Core I5 tablets.

    • 124,215, 206,143,126,129, 12,222, 128,255, 6, 0, 1, 0,48,155, 178,193, 250,155, 162,217, 92,101, 9, 0

      There are three different audio adapters on the same device and three different network adapters on the same device.

    • 76,128, 250,138, 220,130, 20,164

      Three different disks are found on the desktop.

    • 24,211,6, 0, 1, 0, 162,255, 140,234

      NVIDIA tegra 3 device. You may notice that the stream "6, 0, 1, 0" corresponds to the docking station, regardless of the device or shape specifications.

 

Hardwareidentification. getpackagespecifictokenThe method can be used to generate the ashwid of the device that runs the application for the Metro-style application. Two applications that call this API on the same device will return different ashwids. For a given application/package, ashwid is not affected by the following operations:

    • OS reinstall
    • Push Button Reset
    • OS SKU upgrade
    • Application version update
    • Change User on the same device

That is to say, in general, as long as the hardware has not changed, the ashwid will not change. To a certain extent, it can solve the problem that the unique identifier cannot be obtained.

CodeAs follows:

         Private   String  Getuniqueid (){  VaR Token = windows. system. profile. hardwareidentification. getpackagespecifictoken ( Null  ); Ibuffer Buffer =Token. ID;  Using ( VaR Datareader = Datareader. frombuffer (buffer )){  VaR Bytes = New   Byte  [Buffer. Length]; datareader. readbytes (bytes );  Return  Bitconverter. tostring (bytes );}} 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.