glaube luckie hatte mal was gebastelt wo man bios infos auslesen kann
unter anderen die "Universal Unique ID"
die sieht so aus und ist auch immer anders
CC 28 4A B1 E8 45 DA 11 A4 B1 1B 87 B0 89 E7 6B
oder über die CPU ID
Delphi-Quellcode:
const
ID_BIT = $200000;
// EFLAGS ID bit
type
TCPUID =
array[1..4]
of Longint;
function IsCPUID_Available : Boolean;
register;
asm
PUSHFD
{direct access to flags no possible, only via stack}
POP EAX
{flags to EAX}
MOV EDX,EAX
{save current flags}
XOR EAX,ID_BIT
{not ID bit}
PUSH EAX
{onto stack}
POPFD
{from stack to flags, with not ID bit}
PUSHFD
{back to stack}
POP EAX
{get back to EAX}
XOR EAX,EDX
{check if ID bit affected}
JZ @exit
{no, CPUID not availavle}
MOV AL,True
{Result=True}
@exit:
end;
function GetCPUID: TCPUID;
assembler;
register;
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;
function GetCPUInfo:
string;
var
CPUID: TCPUID;
I: Integer;
begin
for I:=Low(CPUID)
to High(CPUID)
do CPUID[I]:=-1;
if IsCPUID_Available
then
begin
CPUID:= GetCPUID;
Result:= IntToHex(CPUID[1], 8)
+'
-'+ IntToHex(CPUID[2], 8)
+'
-'+ IntToHex(CPUID[3], 8)
+'
-'+ IntToHex(CPUID[4], 8);
end
else Result:='
CPUID not available';
end;