Giter VIP home page Giter VIP logo

wmic's Introduction

WMIC

wmic 是一款获取PC电脑相关硬件信息的程序,使用 wmi com c++ 编写。

目前可以获取以下硬件信息:

  • 显卡
  • 硬盘
  • 主板
  • 主板 bios 芯片
  • 内存条
  • CPU处理器
  • 网卡

以及以下软件信息:

  • 电脑系统

使用示例

#include <iostream>
#include "WMIC.h"

int main()
{
    system("COLOR 0A");
	try
	{
		WMIC wmic;
		wmic.OperatingSystem();//系统
		wmic.VideoController();//显卡
		wmic.DiskDrive();//硬盘
		wmic.BaseBoard();//主板
		wmic.BIOS();//主板 BIOS 芯片
		wmic.PhysicalMemory();//内存条
		wmic.Processor();//CPU处理器
		wmic.NetworkAdapter();//网卡
	}
	catch (const WMICException& e)
	{
		std::cout << e.what() << std::endl;
	}
	return 0;
}

应用场景

硬件指纹 - 根据一系列的硬件特征信息生产一个唯一的指纹信息应用于 软件许可限制

获取用户电脑唯一ID

# 例如使用网卡地址生成唯一ID
mac_address = {0x00,0xf1,0xf3,0x86,0xc5,0xaa}

id = 0
for v in mac_address :
    id = (id << 8) | v

id = id & 0x1fffffff

print("uid:",id)
# uid: 331712171

原理

https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmi-start-page

编译

仅支持 windows 版本,使用 C++14 or 更高即可编译。

其他工具

window系统可以使用系统自带的工具(ComputerHardwareIds.exe)获取 硬件id

wmic's People

Contributors

cheungxiongwei avatar jjoy-zz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.