**DONOTDELETE**
(Lurker)
2001-01-15 04:09 PM
Retreiving Serial Number

Hey Guys,

I know this isn't the correct BBS for this, but I thought you guys might know the answer. My company heavily uses Dell computers. I know that Dell stores the Service Tag (same as Serial #) somewhere in the BIOS ROM. I know this because you can see it in the BIOS setup screen and the diagnostic disk can access it. I would like to create a script that calls a simple Assembler program to inventory the serial #'s to the computer name. I can write simple assembly program but I was wondering how I might find the memory address to read from?

Thanks,
Mark

Paul_Berquam
(Hey THIS is FUN)
2001-01-15 05:16 PM
Re: Retreiving Serial Number

Actually CJ posted some info on this here . I started working on doing the same thing with the Dells and found that they don't keep it in the same place between the desktops and the laptops, even different models seems to be in various places. I'll track down the code that I have so far and post it.

OK here it is. It is by no means complete, and I would like to change it to use an external data file for each of the manufacturers and set up a sort of 'default' options where it parses the dump for the information.

Hopefully I'll have some time soon to work on it some more. Enjoy

code:

break on

;Bios rev checker - Paul Berquam
;This script checks the model number, service tag and bios rev from bios
;tested on CPX laptops and GX110 desktops

GLOBAL $range
GLOBAL $cline
GLOBAL $outlen
GLOBAL $mfname
GLOBAL $first
GLOBAL $diff
GLOBAL $output2
GLOBAL $outlen2
GLOBAL $biosrev
GLOBAL $Biosdate
Global $sysinfo

:setrange
?
? "Is this computer a Dell? (Y/N) "
get $c
select
case ucase($c) = "Y"
? "Is this Dell a laptop or a desktop? (L/D) "
$sysinfo = "C:\Dell\sysinfo.dat"
$MFname = "Dell Computer Corporation"
$CRLF=chr(13)+chr(10)
$mfg = "Dell"

get $c
select
case ucase($c) = "L"
$range = "65a0 67a0"
$biosrevoffset = 1
$biosrevlen = 3
$biosrevdateoffset = 1
$biosdatelen = 10

case ucase($c) = "D"
$range = "0450 0650"
case ucase($c) = "X"
goto end
case 1
endselect
goto dell

case ucase($c) = "N"

$range = "0d00 0f00" ;or
$mfname = "Intel Corp"
$mfname2 = "Intel Corporation"
$biosrevoffset = 2
$biosrevlen = 21
$biosrevdateoffset = 12
$biosdatelen = 8
$sysinfo = "C:\sysinfo.dat"
$stnumber = "None"
goto intel
case 1

endselect

;**********************************************************************
;***
;*** Start Dell Computers

:dell

$currentST = readprofilestring("$sysinfo","ServiceTag","ServiceTag")

if exist("$sysinfo") = 1
$sysinfoexist = "True"
; File not found
else
$sysinfoexist = "False"
endif

gosub getdump

if $first = 0
goto notdell
endif


$second = instr($output2,$mfname)
$diff2 = $second+$mflen+1

$output3 = substr($output2,$diff2,$outlen2-$mflen-1)
$outlen3 = len($Output3)

$third = instr($output3,$mfname)

$STbegin = instr($output3,".")

$model = substr($output2,$diff2,$stbegin-1)
$STnumber = substr($output3,$STbegin+1,10)

$STend = instr($STNumber,".")
$stnumber = substr($stnumber,1,$stend-1)
$stnumber = rtrim($stnumber)

? "Info From Bios" ?
? "$mfname"
? "Model = $model"
? "Service Tag = $Stnumber"
? "Biosrev = $BiosRev"
? "BiosDate = $BiosDate"
?
? "Sysinfo = $sysinfo"
? "Current ST = $currentST"
?

If $currentST <> $stnumber and $sysinfoexist = "True"
?
? "Service tag in Bios differs from the local system"
? "Local file will be updated from $currentst to $stnumber"
copy "$sysinfo" "$sysinfo.old"
$= writeprofilestring("$sysinfo","Servicetag","Servicetag","$stnumber")
if @error = 0
? "File updated successfully"
else
? "There was an error updating the file."
sleep 2
endif
?
endif

;******************************
? "Done"


get $c

quit
exit


:notdell
if $mfg = "Intel"
goto intel
endif
? "This does not appear to be a Dell system"
$mfg = "Intel"
goto setrange
sleep 1

exit


;**********************************************************************
;***
;*** Start Intel

:intel
? "Starting Intel"

;
;$range = 0d00 0f00
gosub getdump

$mflen2 = len(mfname)
$second = instr($output2,$mfname2)
$diff2 = $second+$mflen2+1

$output3 = substr($output2,$diff2,$outlen2-$mflen-1)
$outlen3 = len($Output3)

$modelstart = instr($output3,".")
$model = substr($output3,$modelstart+1,10)
$model = rtrim($model)


? "Info From Bios" ?
? "$mfname"
?
? "Model = $model"
? "Biosrev = $BiosRev"
? "BiosDate = $BiosDate"
?
?


;******************************


? "Done"
get $c


;*******************************************************

:getdump
; Generate DEBUG script
del "c:\temp\debug.scr"
$=open(1, "c:\temp\debug.scr", 5)
$=writeline(1, "d f000:$range"+$CRLF) ; this is the address range in memory
;$=writeline(1, "d f000:0 ffff"+$CRLF)
$=writeline(1, "q"+$CRLF)
$=close(1)
sleep 1

; run script and output to .RES file
shell "cmd /c debug <c:\temp\debug.scr >c:\temp\@wksta.res"

$output = "Begin "
$=open(1, "c:\temp\@wksta.res")
$ = readline(1)
$line = readline(1) ;? "$line"

while $line <> "-q"
$cline =substr($line, 62, 16) ;? "$cline"
$Output = $output + $cline
$line = readline(1)
loop
$=close(1)


$outlen = len($output)
$mflen = len($mfname)
$first = instr($output,$mfname)

$diff = $first+$mflen+$biosrevoffset
$output2 = substr($output,$diff,$outlen-$diff)
$outlen2 = len($output2)

$BiosRev = substr($output,$Diff,$biosrevlen)
$biosdate = substr($output,$diff + $biosrevlen + $biosrevdateoffset,$biosdatelen)


return


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


"He was a good little monkey and always very curious..."

[This message has been edited by Paul_Berquam (edited 15 January 2001).]

**DONOTDELETE**
(Lurker)
2001-01-15 07:06 PM
Re: Retreiving Serial Number

Thanks CJ!

This looks like it will work for what I need. We only use about 5 or 6 different models so I should be able to modify it for each. I will play with it and see what happens.

Mark


Paul_Berquam
(Hey THIS is FUN)
2001-01-15 07:17 PM
Re: Retreiving Serial Number

If you find any different offsets for the different model please post them. No sense in reinventing the wheel.

Glad it worked for you.

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

"He was a good little monkey and always very curious..."

**DONOTDELETE**
(Lurker)
2001-01-15 07:20 PM
Re: Retreiving Serial Number

I will. I also would like to sort of automate it to maybe autodetect Mfg and model. I will need to look at the dumps from several computers to see if I can do that or not though.

Bryce
(KiX Supporter)
2001-01-15 08:43 PM
Re: Retreiving Serial Number

I just ran this script on my GX1 and it was not able to find the information.

My GX100 gave me this.

Dell Computer Corporation
Model = OptiPlex GX100
Service Tag = 1MVY10B
Biosrev =
BiosDate =

Sysinfo = C:\Dell\sysinfo.dat
Current ST =

I have the following Dell models avaliable to me here.

G1
GX1
Gx100
Gx110
Gx300

Poweredge 1300
Poweredge 2400
Poweredge 4400

Also, all dell computers are wiped clean, and reformatted using a ghost image that was built from the ground up (almost all dell support software is not installed, this includes the c:\dell directory)

I would be glad to assist in any way that i could, for this project (but i have no idea on how to work debug )

Bryce

**DONOTDELETE**
(Lurker)
2001-01-15 08:57 PM
Re: Retreiving Serial Number

I have done a BIOS dump (F000:0 FFFF) on two different systems so far. One was a GXi and the other a GX1.

The GX1 had the following things of interest to me:

F000:B5DC B5E8 = "Optiplex GX1" -Could be useful for autodetecting model.
F000:B622 B626 = 5 Digit Service Tag

The GXi had:

F000:C192 C1A7 = "Optiplex GXi" =Could be useful for autodetecting model.

Unfortunately I could not find the service tag anywhere in the dump from the GXi. I don't know if this means it is not stored in the ROM of GXi's or if I was just not looking in the correct ranges.

Debug is a utility built into DOS (and NT) that is useful for running short Assembly segments, but can also be used to dump data from memory. To use it just type debug at the command prompt and you will be given a new prompt. Type ? for a list of commands. If you type "d F000:0 FFFF" you will be given a memory dump from F000:0000 to F000:FFFF. (This may take a while, debug is slow).

Mark

cj
(MM club member)
2001-01-15 09:15 PM
Re: Retreiving Serial Number

Very cool script Paul,

Need to move $CRLF=chr(13)+chr(10) from where it is to under GLOBALs. It is not defined in non-Dell section otherwise and you get a DEBUG.SCR without the CRLFs - hangs the DOS box.

Bryce, (and others)

Debug is used here to dump the information in the BIOS ROM about the computer. The DEBUG.SCR file is a set of keystrokes that we < to DEBUG.EXE and then capture the result.

D is for Dump and it displays memory at a starting address. The range is the amount of mem to dump. The default range is 0x180.

Q is quit. So the script runs DEBUG.EXE, Dumps a small piece of memory and then Quits. The output file is in the format of

Segment:offset/\/\un0ln0/\un1ln1/\...-../\un15ln15/\/\/\c0c1c2....c15CRLF

where
segment:offset = the absolute address
/\ = space
unX = upper nibble of byte X
lnX = lower nibble of byte X
cX = character of byte X

X is the absolute address of the byte. eg:

0ADF:0100 06 F8 96 01 74 09 50 56-9A E0 01 C5 10 5E 58 FF ....t.PV.....^X.

at address 0adf:0100 is byte 0x06 which looks like "." (it doesn't really, but that is what DEBUG.EXE shows for non-displayable characters)

as an aside... 0adf:0100 translates to 0adf0 + 100 = 0aef0 in physical memory. This is the 44,784th btye (prob on the first sim)

I love assembly!

cj

ShawnAdministrator
(KiX Supporter)
2001-01-15 09:31 PM
Re: Retreiving Serial Number

I've got a neat little DOS program called smbios.exe that pumps out bios info to an INI type file...

Works great on HP's - not too sure 'bout DELL's - I'll email it to anyone that's interested...

Shawn.


Bryce
(KiX Supporter)
2001-01-15 09:33 PM
Re: Retreiving Serial Number

Sent it my way please!

Bryce

Paul_Berquam
(Hey THIS is FUN)
2001-01-15 09:46 PM
Re: Retreiving Serial Number

I would be interested in checking that out as well. Wouldn't hurt to see if it would work on the Dells.

Thanks

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

"He was a good little monkey and always very curious..."

Bryce
(KiX Supporter)
2001-01-15 10:10 PM
Re: Retreiving Serial Number

Shawn, i got the program and it seems to be working just fine with my dell gx1, and gx100

Nice little program!

Bryce

Paul_Berquam
(Hey THIS is FUN)
2001-01-15 10:14 PM
Re: Retreiving Serial Number

I second that one. Very cool. What did you write it in?

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

"He was a good little monkey and always very curious..."

ShawnAdministrator
(KiX Supporter)
2001-01-15 10:24 PM
Re: Retreiving Serial Number

Guys...

Unfortunately - I can't take the credit for this one... it was developed by one of our external consultants (or he lifted it from somewhere else) not too sure of the history here...

But yes - I do own the source code. It was developed using Borland C++ ... glad you like it...

Shawn.


kholm
(Korg Regular)
2001-01-15 10:47 PM
Re: Retreiving Serial Number

Shawn

I wonder if your smbios.exe is the same as found on this site: http://www.ibm.com/products/surepath/other/smbios.html
Sourcecode also found on this site. Anyway lots of info. Other utils found in WinBios.exe

Erik

[This message has been edited by kholm (edited 15 January 2001).]

ShawnAdministrator
(KiX Supporter)
2001-01-16 12:20 AM
Re: Retreiving Serial Number

Erik:

hmmm - I just download the source code for IBM's SMBIOS - it's definitely not the same one I have (but maybe it was based on an earlier version of this utility)...

But the brief look I did have seems to suggest that this is one cool tool - there's TONS of command line switches (ours has none) - definitely worth a look-see ...

We use our version of smbios during the discovery portion of our automated NT installs - we create one CD that will support the entire line of HP Vectra workstations...

In a week or two - we have to do the same thing with an IBM line of computers - will definitely check this program out at that time...

Thanks...

Shawn.


Radimus
(KiX Supporter)
2001-01-16 06:48 PM
Re: Retreiving Serial Number

could you shoot it to me also??

I have to SP6a every PC we have but not the dell laptops...

Radimus
(KiX Supporter)
2001-01-16 08:19 PM
Re: Retreiving Serial Number

here is the debug range for compaq deskpros

-d f000:a336 a35a

**DONOTDELETE**
(Lurker)
2001-01-16 08:38 PM
Re: Retreiving Serial Number

this is the code I have used for a while now that allows me to get bios info from a system during a dos lan logon . I can then load the image that is correct for the system.

I am using 2 programs vpdump.exe and smbios2.exe both supplied to me from IBM (we have 4000 ibm systems)

the command line switches in smbios2.exe allow for geting more info from the bios if needed ( on some systems I can get the network card that is installed.)

I am useing kixtart version that works in dos so this code could be done better if you could do it from windows

I'm not sure if the code will post correctly as I don't know what the commands are to to separate it from the text.

;***********************************************************8
;********* kixtart for dos login that gets model and serial no.
;*************
;************* sections
;************* :
;************* :10/11/00 had to add provision to use smbios2 before vpddump... t-20s don't reconize serial number and model
;************* :
;************* :
shell "%comspec% /c n:\dosboot\smbios2.exe/g 01 >a:\smbios.txt"
"@error"?
"@ldrive"?
IF EXIST ("a:\smbios.txt")
$rc=OPEN(1,"a:\smbios.txt")

$offset=0
$string="Serial Number"
while $offset=0
$Line=READLINE(1)
$offset=INSTR("$Line","$string") ;************* serial no line is 22 model no is 34 both are both are 7 char long
;?"offset is : $offset"?
;" serial : $Line"?

if $offset=1 ;found serial no
$serial=$line ;this will change the $string to look for Model no because we have alredy found serial number
$offset=0
$string="Model Number"
$Serial=SUBSTR("$serial",LEN($serial)-6,7)
endif

if $offset=14 ;found model no
$model=$line
;$mod_lgth=LEN("$model")
$model=SUBSTR("$model",LEN($model)-6,7)
endif
Loop
? "$serial"?
"$model"
$rc=close(1)

;sleep 20

Endif

IF $serial = "" OR $model = ""
shell "%comspec% /c n:\dosboot\vpddump.exe >a:\vpd.txt"
"@error"?
"@ldrive"?


IF EXIST ("a:\vpd.txt")
$rc=OPEN(1,"a:\vpd.txt")

$offset=0
$string="Serial Number"
while $offset=0
$Line=READLINE(1)
$offset=INSTR("$Line","$string") ;************* serial no line is 22 model no is 34 both are both are 7 char long
;?"offset is : $offset"?
;" serial : $Line"?

if $offset=1 ;found serial no
$serial=$line ;this will change the $string to look for Model no because we have alredy found serial number
$offset=0
$string="Model Number"
$Serial=SUBSTR("$serial",LEN($serial)-6,7)
endif

if $offset=14 ;found model no
$model=$line
;$mod_lgth=LEN("$model")
$model=SUBSTR("$model",LEN($model)-6,7)
endif
Loop
? "$serial"?
"$model"
$rc=close(1)

;sleep 20

Endif

endif

;************* :
;************* :
;************* :
;************* :

ShawnAdministrator
(KiX Supporter)
2001-01-16 09:01 PM
Re: Retreiving Serial Number

brown, et al...

yeah - that smbios2 from IBM seems to work pretty well.. I just ran it over here on some HP's like this...

smbios2 /g 01
smbios2 /g 02
smbios2 /g 03

spits out the bios in pieces... neat...

Shawn.


Radimus
(KiX Supporter)
2001-01-16 10:55 PM
Re: Retreiving Serial Number

Here is what I have just come up with, I'm not certain of how much value this is, but here it is... Big thanks to Paul, who contributed greatly to this (so it can't be all my fault... )

BTW, Not all sections have been fleshed out, but you'll get the idea.

code:

;Generate DEBUG script
$CRLF=chr(13)+chr(10)
del "c:\temp\debug.scr"
$=open(1, "c:\temp\debug.scr", 5)
$=writeline(1, "d f000:a306 a69f"+$CRLF) ;compaq en 400
$=writeline(1, "d f000:15f9 164d"+$CRLF) ;compaq en 600
$=writeline(1, "d f000:65a0 67a0"+$CRLF) ;dell laptop
$=writeline(1, "q"+$CRLF)
$=close(1)
sleep 1

? "running debug"
shell "cmd /c debug <c:\temp\debug.scr >c:\temp\@wksta.res"

$Output =""
$=open(1, "c:\temp\@wksta.res")
$ = readline(1)
$line = readline(1)
while $line <> "-q"
$cline =substr($line, 62, 16)
$Output = "$output"+"$cline"
$line = readline(1)
if substr($line,1,2)="-d"
if instr("$output","dell")>0 or instr("$output","compaq")>0
? " found it"
$=close(1)
goto "parse"
endif
$Output =""
endif
? "looping"
loop
$=close(1)

arse
$output=ltrim("$output")
$output=rtrim("$output")
select
case substr($Output,1,6)="compaq" ;compaq en 400
$make =substr($Output,1,6)
$model =substr($Output,56,17)
$serial=substr($Output,74,12)
$bios =substr($Output,14,8)
$chip =substr($Output,878,13)
$speed =substr($Output,907,7)
case substr($Output,1,6)="compaq" ;compaq en 600
$make =substr($Output,1,6)
$model =substr($Output,56,17)
$serial=substr($Output,74,12)
$bios =substr($Output,14,8)
$chip =substr($Output,878,13)
$speed =substr($Output,907,7)
case instr("$output","dell")
$make =""
$model =""
$serial=""
$bios =""
$chip =""
$speed =""
endselect

? $Output
?
? $make
? $model
? $serial
? $bios
? $chip
? $speed
?
get $k




**DONOTDELETE**
(Lurker)
2001-01-17 02:24 PM
Re: Retreiving Serial Number

Ok,

I finally had a chance to work on this again. Anyways I have tried all of the utilities that were referenced earlier and most of them will work on later Dell's. However I could not get any of them to work on the GXi series. I have also dumped the entire bios section and extended bios section from memory (thanks to the memory map available on dells site). The serial number was not found anywhere in any of the dumps. This leads me to believe that you cannot get the serial number from older Dell's. Although if you run the BIOS setup it will report the serial number. I wonder if it is stored somewhere in un-addressable memory. I may just write the scripts without support for older Dell's.

Thanks,
Mark

[This message has been edited by mm0015 (edited 17 January 2001).]

frederiek
(Lurker)
2002-01-08 06:17 PM
Re: Retreiving Serial Number

Hi,

I'm currently looking for dumping the below Dellinfo into the registy. I'm able to pipe this information into a textfile, but i don't see to manage to read from the textfile the info to dump it into the registry? I was wondering if somebody has any idea's on doing this?

TIA

Fre
DELLINFO.EXE v0.92. Copyright Dell Computer Corporation 1999
System Vendor .... Dell Computer Corporation
Product Name ..... OptiPlex GX110
Dell System ID ... 00B4
BIOS Version ..... A05
BIOS Date ........ 09/18/2000
Service Tag ...... C6BL20J
Asset Tag ........

Will Hetrick
(Hey THIS is FUN)
2002-01-08 07:02 PM
Re: Retreiving Serial Number

FRE,
What are you using to pull the info to a text file?


frederiek
(Lurker)
2002-01-09 07:42 AM
Re: Retreiving Serial Number

Hi,


I'm using dellinfo.exe to pull the info into the txt file.

Fre