如何取得电脑的一个唯一的值?譬如CPUID、网卡MAC地址(200分)

  • 主题发起人 主题发起人 westdog
  • 开始时间 开始时间
W

westdog

Unregistered / Unconfirmed
GUEST, unregistred user!
主要用于程序加密。我试过mac的代码,在win2000下双网卡经常出问题。
有些cpuid的代码取得也只是一般的id,相同型号cpu是一样的。
 
注册表。
 
硬盘序列号
 
type
TCPUID = array[1..4] of Longint;

function GetCPUID : TCPUID; assembler; register; //得到CPU序列号
asm
PUSH EBX {Save affected register}
PUSH EDI
MOV EDI,EAX {@Resukt}
MOV EAX,1
DW $A20F {CPUID Command}
STOSD {CPUID[1]}
MOV EAX,EBX
STOSD {CPUID[2]}
MOV EAX,ECX
STOSD {CPUID[3]}
MOV EAX,EDX
STOSD {CPUID[4]}
POP EDI {Restore registers}
POP EBX
end;
 
我需要代码,另外cpuid不行的,我用过了。
 
To:zw84611

function GetCPUID : TCPUID; assembler; register;

问assembler; register; 这两个关键字是做什么用的?

我试了一下:GetCPUID[1]的值在不同计算机中不同,其它都是相同的!对吗?
 
运行时提示错误
---------------------------
Debugger Exception Notification
---------------------------
Project TComboBox.exe raised exception class EAccessViolation
with message 'Access violation at address 00425223 in module 'TComboBox.exe'.
Read of address 00000693'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
 

Similar threads

回复
0
查看
601
不得闲
回复
0
查看
808
不得闲
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部