Get biosid

Share your advanced PureBasic knowledge/code with the community.
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Get biosid

Post by sec »

Code updated For 5.20+

Code: Select all

; GetBiosid()
; by sec
; Many thank to Sebi

Procedure.s GetBIOSid()
  
  temppath.s=Space(1024)
  GetTempPath_(1024,@temppath)
  If Right(temppath,1)<>"\"
    temppath+"\"
  EndIf
  
  ;Extract data to a file
  If CreateFile(0,temppath+"getid.com")
    WriteData(0,?CData,?CDataEnd-?CData)
    CloseFile(0)
  EndIf
  
  ;run getid.com 
  RunProgram(temppath+"getid.com"," >getid.res","",1|2)
  
  ;delete file com
  DeleteFile(temppath+"getid.com")
  
  ;read the result
  If ReadFile(0,temppath+"getid.res")
    result.s=ReadString(0)
    CloseFile(0)
  Else
    result.s=""
  EndIf
  
  ;delete file with result
  DeleteFile(temppath+"getid.res") 
  
  ;return the result
  ProcedureReturn result
  
  ;code for the com ( CHANGED!!! )
  DataSection
    CData:
    Data.b 184,0,240,142,216,190,113,236,138,20,128
    Data.b 250,0,116,7,180,2,205,33,70,235,242,195
    CDataEnd:
  EndDataSection
  
EndProcedure


Debug GetBIOSid()

User avatar
grapy
User
User
Posts: 31
Joined: Sat Sep 06, 2003 9:32 am

Motherboard ID

Post by grapy »

Good job,

but you call it BiosID.
Better is Motherboard ID.
Look at http://www.aida32.hu.

urs Grapy
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Hmm.. Gives a bunch of garble when I run it on my Compaq laptop.. Returns a readable string on my desktops though...

Is there no way to get the ID in "pure" purebasic? What can the getid.com do that you can't do in straight PB?
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

Karbon wrote:Is there no way to get the ID in "pure" purebasic? What can the getid.com do that you can't do in straight PB?
on win9x, below command is well:
MessageRequester("SN",PeekS($FEC71),0)
but with win2k (as i used) when run it will crash with peeks($fec71) ...
i try shell dos (get string at f000:0ec71), and it ran :d
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

You need to use a device driver to get acces to this memory locations under NT-W2K-XP

viewtopic.php?t=5309
viewtopic.php?t=2549
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

;viewtopic.php?t=5309
;viewtopic.php?t=2549

thanks for link.

;Is there no way to get the ID in "pure" purebasic?

pure? can, i will as soon as post (need time for read :wink: )
Post Reply