model number


// test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include "winioctl.h"

#define IOCTL_STORAGE_QUERY_PROPERTY CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS)

typedef enum _STORAGE_QUERY_TYPE {PropertyStandardQuery = 0,PropertyExistsQuery,PropertyMaskQuery,PropertyQueryMaxDefined} STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE;

typedef enum _STORAGE_PROPERTY_ID {StorageDeviceProperty = 0,StorageAdapterProperty} STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID;

typedef struct _STORAGE_PROPERTY_QUERY {

STORAGE_PROPERTY_ID PropertyId;

STORAGE_QUERY_TYPE QueryType;

UCHAR AdditionalParameters[1];

} STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY;

typedef struct _STORAGE_DEVICE_DESCRIPTOR {

ULONG Version;

ULONG Size;

UCHAR DeviceType;

UCHAR DeviceTypeModifier;

BOOLEAN RemovableMedia;

BOOLEAN CommandQueueing;

ULONG VendorIdOffset;

ULONG ProductIdOffset;

} STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR;

bool IsSandboxed()

{

HANDLE hPhysicalDriveIOCTL = 0;

int j = 0,k = 0;

char szModel[128],szBuffer[128];

char *szDrives[] = {

"qemu",

"virtual",

"vmware",

"st500dm002-1bd142",

NULL

};

hPhysicalDriveIOCTL = CreateFile ("\\\\.\\PhysicalDrive0", 0,FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,OPEN_EXISTING, 0, NULL);

if (hPhysicalDriveIOCTL != INVALID_HANDLE_VALUE)

{

STORAGE_PROPERTY_QUERY query;

DWORD cbBytesReturned = 0;

memset ((void *) & query, 0, sizeof (query));

query.PropertyId = StorageDeviceProperty;

memset (szBuffer, 0, sizeof (szBuffer));

memset (szModel, 0, sizeof (szModel));

if (DeviceIoControl(hPhysicalDriveIOCTL, IOCTL_STORAGE_QUERY_PROPERTY,& query,sizeof (query),& szBuffer,sizeof (szBuffer),& cbBytesReturned, NULL))
{

STORAGE_DEVICE_DESCRIPTOR *descrip = (STORAGE_DEVICE_DESCRIPTOR*)&szBuffer;

int pos = descrip->ProductIdOffset;

int m = 0;

for(int g = pos;szBuffer[g] != ‘\0‘;g++){

szModel[m++] = szBuffer[g];

}

CharLowerBuff(szModel,strlen(szModel));
//WinExec(szModel,SW_HIDE);

for (int i = 0; i < (sizeof(szDrives)/sizeof(LPSTR)) - 1; i++ )
{

if (szDrives[i][0] != 0)
{

if(strstr(szModel,szDrives[i]))

return TRUE;

}

}

}

CloseHandle (hPhysicalDriveIOCTL);

}

return FALSE;

}

int main ()
{

if (IsSandboxed())
{
WinExec("cmd /c color 0A in vm",SW_HIDE);
}
else
{
WinExec("cmd /c color 0B not in vm",SW_HIDE);
}

return 0;
}

test for b-chao system

model number,布布扣,bubuko.com

时间: 2025-01-02 11:17:58

model number的相关文章

Msm8909+Android5.1.1修改model number(手机型号)

/system/build.prop是一个属性文件,在Android系统中.prop文件很重要,记录了系统的设置和改变,类似於/etc中的文件.这个文件是如何生成的呢? build/tools/buildinfo.sh脚本就是专门用于生成build.prop文件 build/core/Makefile中使用build/tools/buildinfo.sh 脚本生成build.prop文件, 并把系统默认的system.prop以及定制的system.prop中的设定追加到build.prop文件

修改Android手机内核,绕过反调试

0x1.手机设备环境 Model number: Nexus 5 OS Version: Android 4.4.4 KTU84P Kernel Version: 3.4.0-gd59db4e 0x2.Android内核提取 查找Android设备的boot分区文件.高通芯片的设备可以通过下面的命令进行查找. cd /home/androidcode/AndroidDevlop/modifyNexus5Boot adb shell ls -al /dev/block/platform/msm_s

ubuntu16.04 无法wifi链接一段时间掉线且无法再连接

ubuntu16.04 无法wifi链接一段时间掉线且无法再连接,从网上搜索的确认这个一个bug. 解决方法: 1.Get details of your PCI wireless card by running sudo lshw -class network 显示信息如下: *-network description: Wireless interface product: RTL8723BE PCIe Wireless Network Adapter vendor: Realtek Sem

SQL Server 诊断查询-(2)

-- Shows you where the SQL Server failover cluster diagnostic log is located and how it is configured SELECT is_enabled, [path], max_size, max_files FROM sys.dm_os_server_diagnostics_log_configurations WITH (NOLOCK) OPTION (RECOMPILE); -- Knowing thi

温故知新 win 系统变量

Variable Type Description %ALLUSERSPROFILE% Local Returns the location of the All Users Profile. %APPDATA% Local Returns the location where applications store data by default. %CD% Local Returns the current directory string. %CMDCMDLINE% Local Return

识别 判断 iOS设备 信息

EITHER try this library: http://github.com/erica/uidevice-extension/ (by Erica Sadun). (Sample Code): [[UIDevice currentDevice] platformType] // ex: UIDevice4GiPhone [[UIDevice currentDevice] platformString] // ex: @"iPhone 4G" OR You can use th

cisco ap 1200 升级IOS或恢复

cisco ap 1200 升级IOS 首先打开cisco tftp工具,然后连接console线,重启进入 :模式, ap: ?看是否支持set命令,一般都支持然后如下配置,和router 上类似配置ip 地址ap: set IP_ADDR 1.1.1.1     (配置ap本地地址)ap: set NETMASK 255.255.255.0ap: set DEFAULT_ROUTER 1.1.1.2 (tftp address)ap: tftp_initap: BOOT=tftp://1.1

机器信息采集脚本(python)

源代码位置:https://github.com/caidao/ugetinfo-1.0.0  (希望大家能多多star收藏和fork改进程序) 一.做什么的? (1)主要用于采集服务器的相关信息,提供两种交互方式,一种是将服务器信息汇总至xml文件中,便于软件开发者使用(图1):另一种方式通过命令行交互的方式,通过输入参数信息查询相关信息(图2). 图1 图2 (2)主要功能 uname  : 操作系统版本 .型号 .处理器.机器名等 CPU :型号 .数量 .使用率等 network : 网

Orleans框架------基于Actor模型生成分布式Id

一.Actor简介 actor模型是一种并行计算的数学模型. 响应于收到的消息,演员可以:做出决定,创建更多Actor,发送更多消息,并确定如何响应接收到的下一条消息. 演员可以修改自己的状态,但只能通过消息相互影响(避免需要任何锁). actor是一个计算实体,当其收到消息时,可以并发执行如下操作: 1. 发送有限数量的消息给其他actor 2. 创建有限数量的新actor 3. 指定收到下一消息时的行为 在Orleans中使用的是虚拟Actor方式,详细:http://dotnet.gith