获取 CPU 序列号

function GetCpuID: string;
var
  _eax, _ebx, _ecx, _edx: Longword;
  s, s1, s2: string;
begin
  asm
     push eax
     push ebx
     push ecx
     push edx
     mov eax,1
     db $0F,$A2
     mov _eax,eax
     mov _ebx,ebx
     mov _ecx,ecx
     mov _edx,edx
     pop edx
     pop ecx
     pop ebx
     pop eax
  end;
  s := IntToHex(_eax, 8);
  s1 := IntToHex(_edx, 8);
  s2 := IntToHex(_ecx, 8);
  result := s+s1+s2;
end;

 

posted @ 2016-06-16 10:55  谢方  阅读(278)  评论(0编辑  收藏  举报