Announcement

Collapse

Maintenance

The forum could be offline for 30-60 minutes in the very near future for maintenance (said 3pm Pacific). I was behind on getting this notice. I do apologize.
See more
See less

Intel Processor Serial Numbers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Intel Processor Serial Numbers

    I am interested in accessing the Pentium CPU Serial Number which I think can be read from a PIII onwards.

    Does anyone have any idea how I might go about this task? I need to be able to identify a PC very precisely. I know I can use the Disk Serial No but I understand that that can change if the disk is reformatted.

    Any help would be much appreciated.

    Thanks in advance...

    Mike Letchford


    ------------------
    Mike Letchford

  • #2
    mike,
    peter lameijn left a nice piece of code that does everything you need.

    see:

    regards,
    --bob


    ------------------
    "It was too lonely at the top".

    Comment


    • #3
      Many Thanks for your help Bob....I'll try this

      Mike


      ------------------
      Mike Letchford

      Comment


      • #4
        I have a chunk of code that will do all you are asking, includes the serial# part for the CPU etc...
        (And that code does P2's as well, don't kid yourself, they all have serial numbers)..


        Scott


        ------------------
        Scott
        mailto:[email protected][email protected]</A>
        Scott Turchin
        MCSE, MCP+I
        http://www.tngbbs.com
        ----------------------
        True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

        Comment


        • #5
          scott,
          how about posting it for all of us to enjoy
          --Don

          ------------------
          www.basicguru.com/dickinson
          Don Dickinson
          www.greatwebdivide.com

          Comment


          • #6
            I would not rely on the serial # returned for the P2,
            it's not unique.....

            -per


            ------------------

            Comment


            • #7
              Be happy to post it, I am NOT the author of the functions to retrieve the information and would never take credit for that.

              I just put it all together in a PB/CC app.

              I believe I posted the Server Information CGI app that also contains it, check the last 30 days or so in Source Code.


              Code:
              #Include "win32api.inc"
              #Resource "TNGCPU.PBR"
              
              Type Myapp
               Title As String * 4
               Creator As String * 27
               Ver As String * 4
               copyrite As String * 19
               rights As String * 20
              End Type
              
              Declare Function GetPIIISerial As String
              Declare Function CPUMfc () As String
              Declare Function CPUSpeed () As String
              Declare Function CPUName () As String
              
              Declare Function DrawCC(App As Myapp) As Long
              
              '======================================================================================================================
              
              Function PbMain() As Long
              Dim App As MyApp
              App.Title       = "CPU"
              App.Creator     = "Computer Creations Software
              App.Copyrite    = "Copyright (c) 1998"
              App.rights      = "All rights reserved."
              App.Ver         = "v1.0"
              If Instr(Trim$(Command$),"?") Then
                 DrawCC App
                 Exit Function
              End If
              Color 15,0
              StdOut
              StdOut "Processor type : ";
              Color 14,0
              StdOut CPUName
              Color 15,0
              StdOut "Processor Speed: " ;
              Color 14,0
              StdOut CPUSpeed ;
              Color 15,0
              StdOut " MHz"
              If Instr (CPUName, "Pentium III") Or Instr(Trim$(UCase$(Command$)),"F") Then ' If it's a PIII, it must support Serialno..
                  StdOut "Serial number  : ";
                  Color 14,0
                  StdOut GetPIIISerial
              End If
              Color 7,0
              StdOut
              End Function
              '===================================================================================================
              Function DrawCC(App As MyApp) As Long
              Page 1,2
              Local X As Integer
              Local Y As Integer
              Color 9,0
              '1st row of "C1"
              StdOut String$(5,32)+Chr$(220)+ Chr$(219)+ Chr$(223)+ Chr$(220)+ Chr$(219)
              '2nd row of "C1"
              StdOut String$(4,32)+Chr$(222)+Chr$(219)+Chr$(221)+String$(2,32)+Chr$(219)
              '3rd row of "C1"
              StdOut String$(4,32)+String$(2,219)+String$(3,32);
              Color 11,0
              '1st row of "C2"
              StdOut Chr$(220)+ Chr$(219)+ Chr$(223)+ Chr$(220)+ Chr$(219)
              '4th row of "C1"
              Color 9,0
              StdOut String$(4,32)+Chr$(222)+Chr$(219)+Chr$(221)+Chr$(32);
              Color 11,0
              '2nd row of "C2"
              StdOut Chr$(222)+Chr$(219)+Chr$(221)+String$(2,32)+Chr$(219)
              '5th row of "C1"
              Color 9,0
              StdOut String$(5,32)+Chr$(223)+Chr$(219)+Chr$(220);
              '3rd row of "C2"
              Color 11,0
              StdOut String$(2,219)+String$(3,32);
              Color 9,0:StdOut 'Left$(App.Creator,8)
              '4th row of "C2"
              Color 11,0
              StdOut String$(8,32)+Chr$(222)+Chr$(219)+Chr$(221)+String$(3,32);
              Color 9,0
              StdOut "  " + App.Creator
              Color 11,0
              '5th row of "C2"
              StdOut String$(9,32)+Chr$(223)+Chr$(219)+Chr$(220)+Chr$(220)+Chr$(223);
              Color 14,0: StdOut"  " + App.Title + " " + App.Ver + " 32 bit"
              Y=CursorX
              X=CursorY
              If Y < 25 Then Locate X,17 Else StdOut:Locate X,17
              Color 11,0:StdOut App.Copyrite + " " + App.rights
              If Y < 25 Then Locate X + 1,17 Else StdOut:Locate X + 1,17
              Color 15,0:StdOut "http://www.tngbbs.com"
              Color 7,0
              StdOut "Useage: CPU </F>"
              StdOut "Where: /F forces display of  the serial number on PII's."
              StdOut "Otherwise CPU Displays:"
              Color 15,0
              StdOut "Processor Type"
              StdOut "Serial No."
              StdOut "Frequency"
              Color 7,0:StdOut
              Page 1,1
              End Function
              '======================================================================================================================
              
              '======================================================================================================================
              ' GetPIIISerial - Returns serial no on Intel PIII
              '----------------------------------------------------------------------------------------------------------------------
              Function GetPIIISerial As String
              Local t As Dword, m As Dword, b As Dword
              !mov eax,1
              !cpuid
              !mov t,eax
              !mov eax,3
              !cpuid
              !mov m,edx
              !mov b,ecx
              Function = Hex$(HiWrd(t),4) + "-" + Hex$(LoWrd(t),4) + "-" + Hex$(HiWrd(m),4) + "-" + _
              Hex$(LoWrd(m),4) + "-" + Hex$(HiWrd(b),4) + "-" + Hex$(LoWrd(b),4)
              End Function
              '======================================================================================================================
              ' CPUMfc - Returns manufacturer name string of CPU
              '----------------------------------------------------------------------------------------------------------------------
              Function CPUMfc () Export As String
              Dim lID As Local String * 12
              ! xor eax,eax
              ! cpuid
              ! push edi
              ! lea edi, lID
              ! mov[edi],ebx
              ! mov[edi+4],edx
              ! mov[edi+8],ecx
              ! pop edi
              Function = lID
              End Function
              '======================================================================================================================
              ' CPUSpeed - Returns CPU speed in MHz
              '----------------------------------------------------------------------------------------------------------------------
              Function CPUSpeed () Export As String
              Local lCnt As Dword, lCnt1 As Quad, lCnt2 As Quad, lBoost As Long, lhMod As Long, lhProc As Long, lPrio As Long
              lhMod = GetModuleHandle("KERNEL32.DLL")
              If lhMod Then
                  lCnt = GetProcAddress (lhMod,"GetTickCount")
                  If IsFalse lCnt Then Exit Function
              End If
              
              lhProc = GetCurrentProcess
              lPrio = GetPriorityClass (lhProc) 'Must set back org.prio....
              lBoost = SetPriorityClass (lhProc, %REALTIME_PRIORITY_CLASS)
              If lBoost Then
                  ! pushad
                  ! call dword ptr lcnt
                  ! mov ecx,eax
              Waiter1:
                  ! call dword ptr lcnt
                  ! cmp ecx,eax
                  ! je Waiter1
                  ! mov ecx,eax
                  ! db &h0f, &h31
                  ! mov lcnt1[04],edx
                  ! mov lcnt1[00],eax
                  ! add ecx, 100 ;for 0.1 sec
              Waiter2:
                  ! call dword ptr lcnt
                  ! cmp ecx,eax
                  ! ja Waiter2
                  ! db &h0f, &h31
                  ! mov lcnt2[04],edx
                  ! mov lcnt2[00],eax
                  ! popad
                  SetPriorityClass lhProc, lPrio
                  Function = Trim$(Str$((lCnt2 - lCnt1) \ 100000))
                  Exit Function
              End If
              End Function
              '======================================================================================================================
              ' CPUName - Returns name string of a CPU
              '----------------------------------------------------------------------------------------------------------------------
              Function CPUName () Export As String
              Local lFamily As Long, lModel As Long, lStepping As Long, lType As Long
              Local lName As String, lCache As Long, lString As String
              lString = CPUMfc
              If lString <> "GenuineIntel" Then
                  Function = lString
                  Exit Function
              End If
              
              ! mov eax,1
              ! cpuid
              ! and eax, &b1111
              ! mov lStepping, eax
              ! mov eax,1
              ! cpuid
              ! shr eax, 4
              ! and eax, &b1111
              ! mov lModel, eax
              ! mov eax,1
              ! cpuid
              ! shr eax, 8
              ! and eax, &b1111
              ! mov lFamily, eax
              ! mov eax,1
              ! cpuid
              ! shr eax, 12
              ! and eax, &b11
              ! mov lType, eax
              ! mov eax,2
              ! cpuid
              ! and edx, &b11111111
              ! mov lCache, edx
              
              If lFamily = 3 Then
                  Select Case lModel
                      Case 0 : lName = "Intel386 DX"
                      Case 2 : lName = "Intel386 SX/CX"
                      Case 4 : lName = "Intel386 SL"
                  End Select
              ElseIf lFamily = 4 Then
                  Select Case lModel
                      Case 0, 1 : lName = "Intel486 DX"
                      Case 2 : lName = "Intel486 SX"
                      Case 3 : lName = "IntelDX2"
                      Case 4 : lName = "Intel486 SL"
                      Case 5 : lName = "IntelSX2"
                      Case 7 : lName = "IntelDX2 Enhanced"
                      Case 8 : lName = "IntelDX4"
                  End Select
              ElseIf lFamily = 5 Then
                  Select Case lModel
                      Case 1, 2 : If lType = 0 Then lName = "Pentium" Else lName = "Pentium OverDrive"
                      Case 3 : lName = "Intel486 Pentium OverDrive"
                      Case 4 : If lType = 0 Then lName = "Pentium MMX" Else lName = "Pentium MMX OverDrive"
              End Select
              ElseIf lFamily = 6 Then
                  Select Case lModel
                      Case 1 : lName = "Pentium Pro"
                      Case 3 : If lType = 0 Then lName = "Pentium II" Else lName = "Pentium II OverDrive"
                      Case 5
                          Select Case lCache
                              Case &h40 : lName = "Celeron"
                              Case &h41 : lName = "Celeron/128"
                              Case &h42,&h43,&h82,&h83 : lName = "Pentium II"
                              Case &h44,&h45,&h84,&h85 : lName = "Pentium II Xeon"
                          End Select
                      Case 6 : lName = "Celeron"
                      Case 7, 8
                          Select Case lCache
                              Case &h40 : lName = "Celeron"
                              Case &h41 : lName = "Celeron/128"
                              Case &h42,&h43,&h82,&h83 : lName = "Pentium III"
                              Case &h44,&h45,&h84,&h85 : lName = "Pentium III Xeon"
                          End Select
                      Case 10 : lName = "Pentium III Xeon-A"
                  End Select
              Else
                  lName = "Intel"
              End If
              Function = lName
              End Function
              '===================================================================================================
              ------------------
              Scott
              mailto:[email protected][email protected]</A>
              Scott Turchin
              MCSE, MCP+I
              http://www.tngbbs.com
              ----------------------
              True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

              Comment

              Working...
              X