亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cpuid.c

?? 通過機器硬件設備加密軟件的算法,支持反敗為勝跟蹤等.
?? C
字號:

#include <windows.h> 
#include "cpuid.h"
//#include "speed.h"


// Global Variable /////////////////////////////////////////////
int clone_flag;				// Flag to show whether processor
							//   is an Intel clone



// Public DLL Functions ////////////////////////////////////////

/***************************************************************
* wincpuidsupport()
*
* Inputs: none
*
* Returns:
*  1 = CPUID opcode is supported
*  0 = CPUID opcode is not supported
***************************************************************/

WORD wincpuidsupport() {
	int cpuid_support = 1;

	_asm {
        pushfd					// Get original EFLAGS
		pop		eax
		mov 	ecx, eax
        xor     eax, 200000h	// Flip ID bit in EFLAGS
        push    eax				// Save new EFLAGS value on
        						//   stack
        popfd					// Replace current EFLAGS value
        pushfd					// Get new EFLAGS
        pop     eax				// Store new EFLAGS in EAX
        xor     eax, ecx		// Can not toggle ID bit,
        jnz     support			// Processor=80486
		
		mov cpuid_support,0		// Clear support flag
support:
      }
	
	return cpuid_support;

} // wincpuidsupport()



/***************************************************************
* wincpuid()
*
* Inputs: none
*
* Returns:
*  0 = 8086/88
*  2 = 80286
*  3 = 80386
*  4 = 80486
*  5 = Pentium(R) Processor
*  6 = PentiumPro(R) Processor
*  7 or higher = Processor beyond the PentiumPro6(R) Processor
*
*  Note: This function also sets the global variable clone_flag
***************************************************************/

WORD wincpuid() {

	WORD cpuid;
	
	if ( wincpuidsupport() ) 	// Determine whether CPUID 
								//   opcode is supported
		cpuid=check_IDProc();

	else {
		
		clone_flag=check_clone();
	
		cpuid=check_8086();			// Will return FFFFh or 0
		if (cpuid == 0) goto end;
	
    	cpuid=check_80286();       	// Will return FFFFh or 2
		if (cpuid == 2) goto end;

    	cpuid=check_80386();       	// Will return FFFFh or 3
		if (cpuid == 3) goto end;    // temporarily commented out.
        
        cpuid=4;		// If the processor does not support CPUID,
        				//  is not an 8086, 80286, or 80386, assign
        				//  processor to be an 80486
	}

end:
	if (clone_flag)
		cpuid = cpuid | CLONE_MASK;	// Signify that a clone has been
									//   detected by setting MSB high 

   	return cpuid;

} // wincpuid ()



/***************************************************************
* wincpuidext()
*
* Inputs: none
*
* Returns:
* AX(15:14) = Reserved (mask these off in the calling code 
*				before using)
* AX(13:12) = Processor type (00=Standard OEM CPU, 01=OverDrive,
*				10=Dual CPU, 11=Reserved)
* AX(11:8)  = CPU Family (the same 4-bit quantity as wincpuid())
* AX(7:4)   = CPU Model, if the processor supports the CPUID 
*				opcode; zero otherwise
* AX(3:0)   = Stepping #, if the processor supports the CPUID 
*				opcode; zero otherwise
*
*  Note: This function also sets the global variable clone_flag
***************************************************************/

WORD wincpuidext(BOOL bUse) 
{
	int i=0;
	WORD cpu_type=0x0000;
	WORD cpuidext=0x0000;
	BYTE vendor_id[12]="------------";
	BYTE intel_id[12]="GenuineIntel";

if(bUse)
{
	if ( wincpuidsupport() ) 
	{

	_asm {      

			xor     eax, eax		// Set up for CPUID instruction
        
			CPU_ID                  // Get and save vendor ID

			mov     dword ptr vendor_id, ebx
			mov     dword ptr vendor_id[+4], edx
			mov     dword ptr vendor_id[+8], ecx
		}

		for (i=0;i<12;i++)
		{
			if (!(vendor_id[i]==intel_id[i]))
				clone_flag = 1;    
		}

	_asm {
        
			cmp     eax, 1			// Make sure 1 is valid input 
        							//   for CPUID
        
			jl      end_cpuidext	// If not, jump to end
			xor     eax, eax
			inc		eax
			CPU_ID					// Get family/model/stepping/
        							//   features

			mov		cpuidext, ax

	end_cpuidext:
			mov		ax, cpuidext
    	}
	}
	else 
	{

	cpu_type = wincpuid();		// If CPUID opcode is not
	cpuidext = cpu_type << 8;	//   supported, put family
								//   value in extensions and
	}							//   return

}
else
{
	cpuidext = 0x0f24;
}

	return cpuidext;

} // wincpuidext()



/***************************************************************
* wincpufeatures()
*
* Inputs: none
*
* Returns:
*   0 = Processor which does not execute the CPUID instruction.
*          This includes 8086, 8088, 80286, 80386, and some 
*		   older 80486 processors.                       
*
* Else
*   Feature Flags (refer to App Note AP-485 for description).
*      This DWORD was put into EDX by the CPUID instruction.
*
*	Current flag assignment is as follows:
*
*		bit31..10   reserved (=0)
*		bit9=1      CPU contains a local APIC (iPentium-3V)
*		bit8=1      CMPXCHG8B instruction supported
*		bit7=1      machine check exception supported
*		bit6=0      reserved (36bit-addressing & 2MB-paging)
*		bit5=1      iPentium-style MSRs supported
*		bit4=1      time stamp counter TSC supported
*		bit3=1      page size extensions supported
*		bit2=1      I/O breakpoints supported
*		bit1=1      enhanced virtual 8086 mode supported
*		bit0=1      CPU contains a floating-point unit (FPU)
*
*	Note: New bits will be assigned on future processors... see
*         processor data books for updated information
*
*	Note: This function also sets the global variable clone_flag
***************************************************************/

DWORD wincpufeatures(BOOL bUse) {

	int i=0;
	DWORD cpuff=0x00000000;
	BYTE vendor_id[12]="------------";
	BYTE intel_id[12]="GenuineIntel";

if(bUse)
{
	if ( wincpuidsupport() ) {

_asm {      

		xor     eax, eax		// Set up for CPUID instruction
        
		CPU_ID                  // Get and save vendor ID

        mov     dword ptr vendor_id, ebx
        mov     dword ptr vendor_id[+4], edx
        mov     dword ptr vendor_id[+8], ecx
	}

	for (i=0;i<12;i++)
	{
		if (!(vendor_id[i]==intel_id[i]))
			clone_flag = 1;    
	}

_asm {
         
		cmp     eax, 1			// Make sure 1 is valid input 
        						//   for CPUID
        
        jl      end_cpuff		// If not, jump to end
        xor     eax, eax
        inc		eax
        CPU_ID					// Get family/model/stepping/
        						//   features

		mov		cpuff, edx

end_cpuff:
		mov		eax, cpuff
      }
	}
}
else
{
	cpuff = 0x3febfbff;
}

	return cpuff;

} // wincpufeatures()



/***************************************************************
* winrdtsc()
*
* Inputs: none
*
* Returns:
*   0 = CPU does not support the time stamp register
*
* Else
*   Returns a variable of type TIME_STAMP which is composed of 
*      two DWORD variables. The 'High' DWORD contains the upper
*      32-bits of the Time Stamp Register. The 'Low' DWORD 
*      contains the lower 32-bits of the Time Stamp Register.
*
*  Note: This function also sets the global variable clone_flag
***************************************************************/

struct TIME_STAMP winrdtsc() {

	struct TIME_STAMP timestamp;    // Return variable for time
									//   stamp read
	DWORD features = wincpufeatures(TRUE);	// Processor Features
	
	timestamp.Low  = 0;
	timestamp.High = 0;
		
	if ( features & 0x00000010 ) {

		RDTSC						// Read Time Stamp

		_asm
			{
			MOV timestamp.Low, EAX
			MOV timestamp.High, EDX

			}
	}
	
	return timestamp;

} // winrdtsc



/***************************************************************
* getdllversion()
*
* Inputs: none
*
* Returns:  Major and Minor version of this DLL.
* 		
*		i.e.	getdllversion() = 0x01 00
*					  Major Version<--|-->Minor Version
*			
***************************************************************/

unsigned short getdllversion(void) {
	unsigned short Version = VERSION;
	
	return Version;

} // getdllversion()



// Internal Private Functions //////////////////////////////////

/***************************************************************
* check_clone()
*
* Inputs: none
*
* Returns:
*   1      if processor is clone (limited detection ability)
*   0      otherwise
***************************************************************/

static WORD check_clone()
{
	short cpu_type=0;

	_asm 
		{
  					MOV AX,5555h	// Check to make sure this
					XOR DX,DX		//   is a 32-bit processor
					MOV CX,2h
					DIV CX			// Perform Division
					CLC
					JNZ no_clone
					JMP clone
		no_clone:	STC
		clone:		PUSHF
					POP AX          // Get the flags
					AND AL,1
					XOR AL,1        // AL=0 is probably Intel,
									//   AL=1 is a Clone
					
					MOV cpu_type, ax
		}
	
    cpu_type = cpu_type & 0x0001;
    
	return cpu_type;
		
} // check_clone()



/***************************************************************
* check_8086()
*
* Inputs: none
*
* Returns: 
*   0      if processor 8086
*   0xffff otherwise
***************************************************************/

static WORD check_8086()
{

		WORD cpu_type=0xffff;

_asm {
        pushf                   // Push original FLAGS
        pop     ax              // Get original FLAGS
        mov     cx, ax          // Save original FLAGS
        and     ax, 0fffh       // Clear bits 12-15 in FLAGS
        push    ax              // Save new FLAGS value on stack
        popf                    // Replace current FLAGS value
        pushf                   // Get new FLAGS
        pop     ax              // Store new FLAGS in AX
        and     ax, 0f000h      // If bits 12-15 are set, then
        cmp     ax, 0f000h      //   processor is an 8086/8088
        mov     cpu_type, 0    	// Turn on 8086/8088 flag
        je      end_8086    	// Jump if processor is 8086/
        						//   8088
        mov		cpu_type, 0ffffh
end_8086:
		push 	cx
		popf
		mov		ax, cpu_type

      }
	
	return cpu_type;

} // check_8086()



/***************************************************************
* check_80286()
*
* Inputs: none
*
* Returns:
*   2      if processor 80286
*   0xffff otherwise
***************************************************************/

static WORD check_80286()
{

		WORD cpu_type=0xffff;

_asm {
		pushf
		pop		cx
		mov		bx, cx
        or      cx, 0f000h      // Try to set bits 12-15
        push    cx              // Save new FLAGS value on stack
        popf                    // Replace current FLAGS value
        pushf                   // Get new FLAGS
        pop     ax              // Store new FLAGS in AX
        and     ax, 0f000h      // If bits 12-15 are clear
        
        mov     cpu_type, 2     // Processor=80286, turn on 
        						//   80286 flag
        
        jz      end_80286       // If no bits set, processor is 
        						//   80286
		
		mov		cpu_type, 0ffffh
end_80286:
		push	bx
		popf
		mov		ax, cpu_type

      }
	
	return cpu_type;

} // check_80286()



/***************************************************************
* check_80386()
*
* Inputs: none
*
* Returns:
*   3      if processor 80386
*   0xffff otherwise
***************************************************************/

static WORD check_80386()
{

		WORD cpu_type=0xffff;

_asm {   
		mov 	bx, sp
		and		sp, not 3
        pushfd					// Push original EFLAGS 
        pop     eax				// Get original EFLAGS
        mov     ecx, eax		// Save original EFLAGS
        xor     eax, 40000h		// Flip AC bit in EFLAGS
        
        push    eax             // Save new EFLAGS value on
        						//   stack
        
        popfd                   // Replace current EFLAGS value
        pushfd					// Get new EFLAGS
        pop     eax             // Store new EFLAGS in EAX
        
        xor     eax, ecx        // Can't toggle AC bit, 
        						//   processor=80386
        
        mov     cpu_type, 3		// Turn on 80386 processor flag
        jz      end_80386		// Jump if 80386 processor
		mov		cpu_type, 0ffffh
end_80386:
		push	ecx
		popfd
		mov		sp, bx
		mov		ax, cpu_type
		and		eax, 0000ffffh
      }

	return cpu_type;

} // check_80386()



/***************************************************************
* check_IDProc()
*
* Inputs: none
*
* Returns:
*  CPU Family (i.e. 4 if Intel 486, 5 if Pentium(R) Processor)
*
*  Note: This function also sets the global variable clone_flag
***************************************************************/

static WORD check_IDProc() {

		int i=0;
		WORD cpu_type=0xffff;
		BYTE stepping=0;
		BYTE model=0;
		BYTE vendor_id[12]="------------";
		BYTE intel_id[12]="GenuineIntel";

_asm {      

        xor     eax, eax		// Set up for CPUID instruction
        
        CPU_ID                  // Get and save vendor ID

        mov     dword ptr vendor_id, ebx
        mov     dword ptr vendor_id[+4], edx
        mov     dword ptr vendor_id[+8], ecx
}

for (i=0;i<12;i++)
{
	if (!(vendor_id[i]==intel_id[i]))
		clone_flag = 1;    
}

_asm {

        cmp     eax, 1			// Make sure 1 is valid input 
        						//   for CPUID
        
        jl      end_IDProc		// If not, jump to end
        xor     eax, eax
        inc		eax
        CPU_ID					// Get family/model/stepping/
        						//   features

		mov 	stepping, al
		and		stepping, 0x0f //0fh
		
		and 	al, 0f0h
		shr		al, 4
		mov 	model, al
		
		and		eax, 0f00h
        shr     eax, 8			// Isolate family
		and		eax, 0fh
        mov     cpu_type, ax	// Set _cpu_type with family

end_IDProc:
		mov		ax, cpu_type
      }
	
	return cpu_type;

} // Check_IDProc()

///////////////////////////////////////////
//write by lr

char* wincpuVendorID(BOOL bUse) {

	int i=0;
	static BYTE vendor_id[12+1]="------------";
	BYTE intel_id[12]="GenuineIntel";
	BYTE unsupport_id[12]="unsupport_id";

if(bUse)
{
	if ( wincpuidsupport() ) {

_asm {      

		xor     eax, eax		// Set up for CPUID instruction
        
		CPU_ID                  // Get and save vendor ID

        mov     dword ptr vendor_id, ebx
        mov     dword ptr vendor_id[+4], edx
        mov     dword ptr vendor_id[+8], ecx
}

		for (i=0;i<12;i++)
		{
			if (!(vendor_id[i]==intel_id[i]))
				clone_flag = 1;    
		}
	}
	else {
		// If CPUID opcode is not supported
		for (i=0;i<12;i++)
		{
			vendor_id[i]=unsupport_id[i];
		}

	}
}
else
{
	for (i=0;i<12;i++)
	{
		vendor_id[i]=intel_id[i];
	}
}
	return vendor_id;

} // wincpufeatures()


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩久久不卡| 久久国产精品区| bt7086福利一区国产| 国产精品视频一区二区三区不卡| 国产精品综合久久| 国产欧美日韩在线视频| 91一区二区三区在线观看| 亚洲综合区在线| 91精品国产色综合久久不卡电影 | 99久久国产综合精品麻豆| 国产精品少妇自拍| 色综合色综合色综合| 亚洲综合av网| 日韩视频一区二区三区| 国产ts人妖一区二区| 国产精品久久久久久久久久免费看 | 精品理论电影在线| 成人高清免费观看| 一区二区三区**美女毛片| 在线视频你懂得一区二区三区| 亚洲高清免费在线| 久久影院视频免费| 99久久伊人久久99| 天天免费综合色| 久久先锋资源网| 色av一区二区| 久久99国产精品尤物| 亚洲欧美日韩成人高清在线一区| 欧美精品v日韩精品v韩国精品v| 国产精品综合一区二区三区| 亚洲精品高清在线观看| 日韩精品一区二区三区蜜臀| 成人午夜伦理影院| 日韩电影在线免费看| 久久理论电影网| 欧美性大战久久久久久久蜜臀| 美女网站视频久久| 亚洲乱码日产精品bd| 欧美成人高清电影在线| 一本一道综合狠狠老| 久久精品国产999大香线蕉| 综合色天天鬼久久鬼色| 欧美大肚乱孕交hd孕妇| 欧亚洲嫩模精品一区三区| 国产精品资源在线看| 视频一区视频二区在线观看| 国产欧美视频一区二区| 日韩视频一区二区三区| 欧美日韩国产免费| 99re热这里只有精品免费视频| 国产伦精品一区二区三区免费| 亚洲成人综合在线| 亚洲精品视频在线| 国产精品高潮呻吟| 久久久久88色偷偷免费| 欧美一二区视频| 欧美综合色免费| 97精品电影院| 丁香婷婷深情五月亚洲| 久久国产精品第一页| 婷婷久久综合九色综合伊人色| 国产精品欧美一区喷水| 国产亚洲一区二区三区在线观看| 欧美伦理影视网| 欧美日韩国产另类一区| 欧美在线高清视频| 在线影院国内精品| 91浏览器在线视频| 91啦中文在线观看| 91麻豆文化传媒在线观看| 波多野洁衣一区| 成人a级免费电影| 9久草视频在线视频精品| jizzjizzjizz欧美| 成人午夜在线播放| 成a人片亚洲日本久久| 成人午夜av电影| 99re这里只有精品首页| 91麻豆国产在线观看| 一本久久a久久精品亚洲| 色综合天天综合给合国产| www.日韩大片| 91久久线看在观草草青青| 91美女片黄在线| 色婷婷综合激情| 精品视频一区三区九区| 欧美二区乱c少妇| 欧美一区二区三区免费视频| 欧美α欧美αv大片| 久久久久久久久久久久久女国产乱 | 亚洲国产另类精品专区| 亚洲va欧美va人人爽午夜| 天天色综合天天| 久久99国产精品久久| 粉嫩aⅴ一区二区三区四区五区 | 色一区在线观看| 色88888久久久久久影院野外 | 不卡一区在线观看| 日本丶国产丶欧美色综合| 精品视频一区三区九区| 精品久久久久久久久久久院品网| 亚洲精品一区二区三区精华液| 国产精品丝袜在线| 亚洲综合偷拍欧美一区色| 麻豆91精品91久久久的内涵| 成人黄色电影在线| 精品视频一区二区不卡| 久久中文字幕电影| 亚洲一区免费在线观看| 国产一区福利在线| 91成人在线免费观看| 精品女同一区二区| 亚洲私人黄色宅男| 美腿丝袜一区二区三区| 91在线观看高清| 日韩三级视频在线看| 国产精品不卡一区二区三区| 日日摸夜夜添夜夜添国产精品| 国产一区二区三区黄视频| 91国偷自产一区二区使用方法| 日韩欧美三级在线| 一区二区三区四区蜜桃| 国模娜娜一区二区三区| 欧美体内she精视频| 国产午夜精品在线观看| 首页欧美精品中文字幕| 成人精品视频一区二区三区| 91精品一区二区三区久久久久久| 国产精品久线观看视频| 日韩av电影一区| 91浏览器在线视频| 国产亚洲精品aa午夜观看| 日韩精品视频网站| 91网站最新网址| 久久久久久一二三区| 视频一区在线播放| 欧美影视一区在线| 日韩毛片视频在线看| 国产精品99久| 91精品国产综合久久香蕉麻豆| 亚洲欧美日韩一区二区| 国产成都精品91一区二区三| 日韩一级成人av| 亚洲国产精品久久久久秋霞影院| 99久久综合色| 国产精品盗摄一区二区三区| 国产精品99久| 欧美精品一区二区久久久| 日韩黄色免费电影| 欧美日韩成人在线| 亚洲精品日韩综合观看成人91| 大陆成人av片| 国产视频一区在线观看| 国产毛片一区二区| 欧美不卡一区二区| 精品制服美女丁香| 日韩一级精品视频在线观看| 天堂午夜影视日韩欧美一区二区| 在线观看不卡视频| 亚洲精品网站在线观看| 91国产福利在线| 一区二区日韩电影| 欧美在线观看一区二区| 一区二区三区精品视频在线| 在线亚洲+欧美+日本专区| 一区二区高清视频在线观看| 日本精品一区二区三区四区的功能| 亚洲欧洲国产日韩| 一本一道久久a久久精品| 一区二区免费视频| 91超碰这里只有精品国产| 日韩精品亚洲专区| 精品精品欲导航| 国产精品影视网| 国产精品人人做人人爽人人添| www.亚洲精品| 一区二区三区在线视频免费| 欧美午夜电影一区| 免费成人av资源网| 亚洲精品一线二线三线| 成人午夜电影网站| 又紧又大又爽精品一区二区| 色妹子一区二区| 亚洲福利一区二区| 精品国产髙清在线看国产毛片| 国产精品一区二区黑丝| 中文在线一区二区| 色诱亚洲精品久久久久久| 日韩在线一二三区| 国产欧美一区二区精品性色超碰| 99久久精品国产导航| 亚洲影视在线播放| 精品国产人成亚洲区| 成人高清视频在线| 午夜久久久影院| 26uuu亚洲综合色欧美| 色综合色综合色综合色综合色综合| 亚洲一区二区五区| 欧美mv日韩mv国产网站app| www.亚洲人|