Solved

serial number

Posted on 2006-11-21
8
362 Views
Last Modified: 2010-04-05
How to take the serial number computer or motherboard
0
Comment
Question by:ProgsX
8 Comments
 
LVL 19

Expert Comment

by:MerijnB
ID: 17987999
0
 
LVL 18

Expert Comment

by:Johnjces
ID: 17988058
CPU Serial NUmber:

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;

Not sure you can get the graphics serial number as it is probably not coded into the GPU BIOS.

JJ
0
 
LVL 16

Accepted Solution

by:
CodedK earned 125 total points
ID: 17994672
This is for the motherboar Serial number id.
First download and save to your folder this pas file :
http://www.workshop-alex.org/sources/WbemScripting_TLB/WbemScripting_TLB.pas



uses
  ActiveX, WbemScripting_TLB;

~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
function GetSerialNumber: string;
const
  sQuery = 'select SerialNumber from CIM_BIOSElement';
var
  Item: SWbemObject;
  NumProp: LongWord;
  ObjectSet: ISWbemObjectSet;
  OleProperty: OleVariant;
begin
  ObjectSet := CoSWbemLocator.Create.ConnectServer( '', 'root\cimv2', '', '', '', '', 0, nil ).ExecQuery( sQuery, 'WQL', wbemFlagBidirectional, nil );
  if Succeeded( (ObjectSet._NewEnum as IEnumVariant).Next( 1, OleProperty, NumProp ) ) and ( NumProp > 0 ) and Succeeded( IDispatch( OleProperty ).QueryInterface( SWBemObject, Item ) ) then begin
    Result := VarToStr( Item.Properties_.Item( 'SerialNumber', 0 ) );
  end else begin
    Result := '<Not found>';
  end;
end;
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
OR USE THIS FOR FULL INFO :

function SerialNumber: string;
const
  sQuery = 'select SerialNumber from Win32_BIOS';
var
  Item: SWbemObject;
  NumProp: LongWord;
  ObjectSet: ISWbemObjectSet;
  OleProperty: OleVariant;
begin
  ObjectSet := CoSWbemLocator.Create.ConnectServer( '', 'root\cimv2', '', '', '', '', 0, nil ).ExecQuery( sQuery, 'WQL', wbemFlagBidirectional, nil );
  if Succeeded( ( ObjectSet._NewEnum as IEnumVariant ).Next( 1, OleProperty, NumProp ) ) and ( NumProp > 0 ) and Succeeded( IDispatch( OleProperty ).QueryInterface( SWBemObject, Item ) ) then begin
    Result := Item.Path_.RelPath;
  end
  else begin
    Result := '<Unknown>';
  end;
end;
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

Hope this helps :)
0
 

Author Comment

by:ProgsX
ID: 17998849
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 16

Expert Comment

by:CodedK
ID: 17999780
Strange... i can download it from my browser.

Try from here :
http://www.geocities.com/kalatz_gr_fisher/TheFiles/WbemScripting_TLB.pas
0
 
LVL 4

Expert Comment

by:David_Ward
ID: 18006661
CPU serial number?

Available on -some- PentiumIIIs not available on anything pre P3 and NOT available on anything after P3 either :(
0
 
LVL 4

Expert Comment

by:David_Ward
ID: 18006665
@CodeK: Nice one! WMI is the -only- way to fly.
0
 
LVL 16

Expert Comment

by:CodedK
ID: 18006667
:)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now