cmd 查询bios序列号_取计算机特征码(网卡MAC、硬盘序列号、CPU ID、BIOS编号)

本文介绍了如何通过CMD命令行利用系统结构和函数定义来查询计算机的BIOS序列号、硬盘序列号、CPU ID等硬件特征码。通过创建文件句柄、发送控制命令以及解析响应数据来实现不同类型的硬件标识读取。
摘要由CSDN通过智能技术生成

系统特征码已取得。

以下是其中用到的某些结构及函数的定义:

#define  FILE_DEVICE_SCSI              0x0000001b

#define  IOCTL_SCSI_MINIPORT_IDENTIFY  ( ( FILE_DEVICE_SCSI << 16 ) + 0x0501 )

#define  IOCTL_SCSI_MINIPORT 0x0004D008  //  see NTDDSCSI.H for definition

#define  IDENTIFY_BUFFER_SIZE  512

#define  SENDIDLENGTH  ( sizeof( SENDCMDOUTPARAMS ) + IDENTIFY_BUFFER_SIZE )

#define  IDE_ATAPI_IDENTIFY  0xA1  //  Returns ID sector for ATAPI.

#define  IDE_ATA_IDENTIFY    0xEC  //  Returns ID sector for ATA.

#define  DFP_RECEIVE_DRIVE_DATA   0x0007c088

typedef struct _IDSECTOR

{

USHORT  wGenConfig;

USHORT  wNumCyls;

USHORT  wReserved;

USHORT  wNumHeads;

USHORT  wBytesPerTrack;

USHORT  wBytesPerSector;

USHORT  wSectorsPerTrack;

USHORT  wVendorUnique[3];

CHAR    sSerialNumber[20];

USHORT  wBufferType;

USHORT  wBufferSize;

USHORT  wECCSize;

CHAR    sFirmwareRev[8];

CHAR    sModelNumber[40];

USHORT  wMoreVendorUnique;

USHORT  wDoubleWordIO;

USHORT  wCapabilities;

USHORT  wReserved1;

USHORT  wPIOTiming;

USHORT  wDMATiming;

USHORT  wBS;

USHORT  wNumCurrentCyls;

USHORT  wNumCurrentHeads;

USHORT  wNumCurrentSectorsPerTrack;

ULONG   ulCurrentSectorCapacity;

USHORT  wMultSectorStuff;

ULONG   ulTotalAddressableSectors;

USHORT  wSingleWordDMA;

USHORT  wMultiWordDMA;

BYTE    bReserved[128];

} IDSECTOR, *PIDSECTOR;

typedef struct _DRIVERSTATUS

{

BYTE  bDriverError;  //  Error code from driver, or 0 if no error.

BYTE  bIDEStatus;    //  Contents of IDE Error register.

//  Only valid when bDriverError is SMART_IDE_ERROR.

BYTE  bReserved[2];  //  Reserved for future expansion.

DWORD  dwReserved[2];  //  Reserved for future expansion.

} DRIVERSTATUS, *PDRIVERSTATUS, *LPDRIVERSTATUS;

typedef struct _SENDCMDOUTPARAMS

{

DWORD         cBufferSize;   //  Size of bBuffer in bytes

DRIVERSTATUS  DriverStatus;  //  Driver status structure.

BYTE          bBuffer[1];    //  Buffer of arbitrary length in which to store the data read from the                                                       // drive.

} SENDCMDOUTPARAMS, *PSENDCMDOUTPARAMS, *LPSENDCMDOUTPARAMS;

typedef struct _SRB_IO_CONTROL

{

ULONG HeaderLength;

UCHAR Signature[8];

ULONG Timeout;

ULONG ControlCode;

ULONG ReturnCode;

ULONG Length;

} SRB_IO_CONTROL, *PSRB_IO_CONTROL;

typedef struct _IDEREGS

{

BYTE bFeaturesReg;       // Used for specifying SMART "commands".

BYTE bSectorCountReg;    // IDE sector count register

BYTE bSectorNumberReg;   // IDE sector number register

BYTE bCylLowReg;         // IDE low order cylinder value

BYTE bCylHighReg;        // IDE high order cylinder value

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值