各位高手:这样格式的CPU系列号用什么代码取出的???(10分)

  • 主题发起人 主题发起人 凤仙花
  • 开始时间 开始时间

凤仙花

Unregistered / Unconfirmed
GUEST, unregistred user!
各位高手:这样格式的CPU系列号用什么代码取出的??????:<br><br>GenuineIntel-0387F9FF-00000672-0000BF07-357F6DBD<br><br>我用delphi取出的怎么和这不一样?比这少了很多内容!<br><br>
 
unit unit1;<br><br>interface<br>&nbsp;<br>uses <br>&nbsp; Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, <br>&nbsp; ExtCtrls, StdCtrls, Buttons; <br><br>type <br>&nbsp; TForm1 = class(TForm) <br>&nbsp; &nbsp; Label1: TLabel; <br>&nbsp; &nbsp; Label2: TLabel; <br>&nbsp; &nbsp; Label3: TLabel; <br>&nbsp; &nbsp; Label4: TLabel; <br>&nbsp; &nbsp; BitBtn1: TBitBtn; <br>&nbsp; &nbsp; Label5: TLabel;<br>&nbsp; &nbsp; BitBtn2: TBitBtn;<br>&nbsp; &nbsp; procedure BitBtn1Click(Sender: TObject);<br>&nbsp; &nbsp; procedure BitBtn2Click(Sender: TObject);<br>&nbsp; end; <br>&nbsp;<br>var <br>&nbsp; Form1: TForm;<br><br>implementation <br>&nbsp;<br>{$R *.DFM} <br>&nbsp;<br>type <br>&nbsp; TCPUID &nbsp;= array[1..4] of Longint;<br>&nbsp; TVendor = array [0..11] of char;<br>&nbsp;<br>function GetCPUID : TCPUID; assembler; register; <br>asm <br>&nbsp; PUSH &nbsp; &nbsp;EBX &nbsp; &nbsp; &nbsp; &nbsp; {Save affected register}<br>&nbsp; PUSH &nbsp; &nbsp;EDI <br>&nbsp; MOV &nbsp; &nbsp; EDI,EAX &nbsp; &nbsp; {@Resukt} <br>&nbsp; MOV &nbsp; &nbsp; EAX,1 <br>&nbsp; DW &nbsp; &nbsp; &nbsp;$A20F &nbsp; &nbsp; &nbsp; {CPUID Command} <br>&nbsp; STOSD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {CPUID[1]}<br>&nbsp; MOV &nbsp; &nbsp; EAX,EBX <br>&nbsp; STOSD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {CPUID[2]} <br>&nbsp; MOV &nbsp; &nbsp; EAX,ECX <br>&nbsp; STOSD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {CPUID[3]} <br>&nbsp; MOV &nbsp; &nbsp; EAX,EDX <br>&nbsp; STOSD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {CPUID[4]} <br>&nbsp; POP &nbsp; &nbsp; EDI &nbsp; &nbsp; &nbsp; &nbsp; {Restore registers}<br>&nbsp; POP &nbsp; &nbsp; EBX<br>end; <br>&nbsp;<br>function GetCPUVendor : TVendor; assembler; register; <br>asm <br>&nbsp; PUSH &nbsp; &nbsp;EBX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {Save affected register}<br>&nbsp; PUSH &nbsp; &nbsp;EDI<br>&nbsp; MOV &nbsp; &nbsp; EDI,EAX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {@Result (TVendor)}<br>&nbsp; MOV &nbsp; &nbsp; EAX,0<br>&nbsp; DW &nbsp; &nbsp; &nbsp;$A20F &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {CPUID Command}<br>&nbsp; MOV &nbsp; &nbsp; EAX,EBX <br>&nbsp; XCHG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EBX,ECX &nbsp; &nbsp; {save ECX result} <br>&nbsp; MOV &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ECX,4 <br>@1: <br>&nbsp; STOSB <br>&nbsp; SHR &nbsp; &nbsp; EAX,8 <br>&nbsp; LOOP &nbsp; &nbsp;@1 <br>&nbsp; MOV &nbsp; &nbsp; EAX,EDX <br>&nbsp; MOV &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ECX,4 <br>@2: <br>&nbsp; STOSB <br>&nbsp; SHR &nbsp; &nbsp; EAX,8 <br>&nbsp; LOOP &nbsp; &nbsp;@2 <br>&nbsp; MOV &nbsp; &nbsp; EAX,EBX <br>&nbsp; MOV &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ECX,4 <br>@3: <br>&nbsp; STOSB <br>&nbsp; SHR &nbsp; &nbsp; EAX,8 <br>&nbsp; LOOP &nbsp; &nbsp;@3 <br>&nbsp; POP &nbsp; &nbsp; EDI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{Restore registers} <br>&nbsp; POP &nbsp; &nbsp; EBX <br>end; <br>&nbsp;<br>procedure TForm1.BitBtn1Click(Sender: TObject);<br>var <br>&nbsp; CPUID : TCPUID; <br>&nbsp; I &nbsp; &nbsp; : Integer; <br>&nbsp; S &nbsp; &nbsp; : TVendor;<br>begin<br>&nbsp; for I := Low(CPUID) to High(CPUID) &nbsp;do CPUID := -1;<br>&nbsp; CPUID := GetCPUID;<br>&nbsp; Label1.Caption := 'CPUID[1] = ' + IntToHex(CPUID[1],8); <br>&nbsp; Label2.Caption := 'CPUID[2] = ' + IntToHex(CPUID[2],8); <br>&nbsp; Label3.Caption := 'CPUID[3] = ' + IntToHex(CPUID[3],8); <br>&nbsp; Label4.Caption := 'CPUID[4] = ' + IntToHex(CPUID[4],8); <br>&nbsp; S := GetCPUVendor; <br>&nbsp; Label5.Caption := S; <br>end; <br><br>procedure TForm1.BitBtn2Click(Sender: TObject);<br>begin<br>&nbsp; Close;<br>end;<br><br>end.<br>
 
procedure TForm1.Button1Click(Sender: TObject);<br>var<br>&nbsp; CPUID : TCPUID;<br>&nbsp; I &nbsp; &nbsp; : Integer;<br>&nbsp; S &nbsp; &nbsp; : TVendor;<br>begin<br>&nbsp; for I := Low(CPUID) to High(CPUID) &nbsp;do CPUID := -1;<br>&nbsp; CPUID := GetCPUID;<br>&nbsp; //Label1.Caption := 'CPUID[1] = ' + IntToHex(CPUID[1],8);<br>&nbsp; //Label2.Caption := 'CPUID[2] = ' + IntToHex(CPUID[2],8);<br>&nbsp; //Label3.Caption := 'CPUID[3] = ' + IntToHex(CPUID[3],8);<br>&nbsp; //Label4.Caption := 'CPUID[4] = ' + IntToHex(CPUID[4],8);<br>&nbsp; S := GetCPUVendor;<br>&nbsp; //Label5.Caption := S;<br>&nbsp; cpuid_edit.text := S+'-'+IntToHex(CPUID[4],8);<br>&nbsp; cpuid_edit.text :=cpuid_edit.text+'-'+IntToHex(CPUID[1],8);<br>&nbsp; cpuid_edit.text :=cpuid_edit.text+'-'+IntToHex(CPUID[2],8);<br>&nbsp; cpuid_edit.text :=cpuid_edit.text+'-'+IntToHex(CPUID[3],8);<br>end;<br><br>//以上Delhi调用结果: &nbsp; &nbsp; GenuineIntel-0383F9FF-000006B4-00000001-00000000 <br>//用VC的外部DLL调用结果: GenuineIntel-0383F9FF-000006B4-0C040882-00000000<br>//为什么 IntToHex(CPUID[2],8) 的结果和VC的DLL调用结果不一样?前者是00000001,后者是0C040882。<br><br>
 
我的是WinXP!<br>
 
或许是对它又做了加密
 
不会吧?原始的硬件信息也作加密?<br>上面两个CPU系列号,你是说哪一个正确呢?<br>
 
期待中。。
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部