我想很多朋友都碰到需要获取bios的sn吧。首先我们来罗列一下获取的这个的方法。
1.使用WMI的方式为win32_bios。这种方法很比较简单。
2.一般就是通过读取物理地址进行了。一般不同的主板都会将bios的信息存放到0xf0000至0xfffff之间的物理内存中。
如果知道dmi信息的朋友可能也知道,在0xf0000到oxfffff之间的物理内存中,同样也是dmi信息保持的地方。但是我阅读多smbios协议,bios的sn并没有保存在dmi中。因此,我们需要对不同的主板厂家进行区别对待了。以下是两篇关于这个获取的的方法。How to get the BIOS serial number under Windows XP。这边文章主要是告诉我们如何使用MemAccess Library,如果需要这个库可以通过下面这个链接进行下载http://www.zealsoftstudio.com/memaccess/。而后面一篇Deciphering the BIOS Serial Number是向我们介绍了主要几种主板厂家的sn的介绍。具体的代码可以参考网上公开的代码。
http://www.latiumsoftware.com/en/delphi/00050.php
<textarea cols="88" rows="15" name="code" class="c-sharp">One customer asked: "I have problem regarding bios, I want to get bios number using WINXP. Once I had found vbio32.dll that only work on 98 but not in XP. Is there any other dll for that?" You can use MemAccess Library to read the BIOS number from the memory starting from &HFEc71. Following is an example in Visual Basic 6.0. Private Sub btnGet_Click() Dim i As Integer Dim nAddress As Integer Dim sError As String sError = Space(255) ' Open the library If maOpenLibrary() = False Then maGetLastState sError MsgBox "Error: " + sError, vbCritical Exit Sub End If Label2.Caption = "BIOS serial number:" & GetBIOSSN() ' Close the library maCloseLibrary End Sub ' Get the BIOS serial number Public Function GetBIOSSN() As String Dim i As Integer, b As Byte Dim s As String s = "" For i = 1 To 50 b = maPeekB(V86_To_PhyAddress(&HFEC7, i)) If b = 0 Then Exit For s = s + Chr(b) Next GetBIOSSN = s End Function But this BIOS number is not unique for each monther board, and not applied to all BIOS vendors. You'd better use Ernesto De Spirito's algorithm to read BIOS check sum using MemAccess Library. </textarea>
Deciphering the BIOS Serial Number
http://www.hardwaresecrets.com/article/34
Many people want to find out their motherboard manufacturer without having to open their computer. In other cases, such as upgrading the BIOS and seeking drivers for the board, the manufacturer and model of a motherboard must be known.
The motherboard manufacturer can be found through the BIOS serial number. This number is shown onscreen (lower line) during the memory count that is always run when you turn your computer on. If you have never paid any attention, press the Pause key on your keyboard when the memory is being counted and you will be able to read the BIOS serial number from the frozen display. The same line contains important information, like the BIOS date. This information is important when you are considering upgrading your BIOS, to find out on the board manufacturer's site whether there is or not a later version of BIOS than the one your computer is currently using (we have already explained how to upgrade BIOS. Please refer to http://www.hardwaresecrets.com/article/33, if required).
For instance, assume that that the motherboard indicates the following number onscreen while counting memory: 06/06/2002-VT8366-8233/5-JL6LVC0CC-00. Painlessly, we can deduce two things: the BIOS date (BIOS version) is 06/06/2002, and the motherboard uses VIA chipset VT8366 and VT8233/5, widely known as VIA KT333.
There are three major BIOS software manufacturers, AMI, Award and Phoenix (Phoenix has recently bought Award). The format of serial numbers used by these manufacturers varies, as we will see below.
The format of BIOS Award's serial number is shown in Figure 1, where we can see that the first five digits indicate which chipset is used by the motherboard, the next two digits indicating the motherboard's manufacturer and the meaning of the remaining digits depends on the motherboard's manufacturer.
Figure 1: Award Serial Number.
As you will notice, this information is encoded. To decode it, you must use a table given in http://www.wimsbios.com/numbers.shtml. Check the serial number used in the above example, of a PCChips motherboard with chipset VX Pro (which is a rebranded VIA Apollo VP1).
The AMI BIOS serial number is longer than Award's one. The motherboard manufacturer is coded in the last four digits of the third group of numbers, counting from left to right, as shown in Figure 2.
Figure 2: AMI Serial Number.
In the same way as Award BIOS, you will have to consult a table to determine the manufacturer corresponding to the number you have found. This can be done at http://www.wimsbios.com/numbersami.shtml. Check the serial number of our example, which is a motherboard made by PCChips.
The major difference between AMI and Award's serial numbers is that the former usually contains information on the model of motherboard directly recorded in the serial number. For instance, serial number 61-1210-000747-00101111-071595-M747 is a PCChips M747 motherboard and serial number 51-0505-001437-00111111-071595-M1531/43-01-10-TX-PRO-0 corresponds to a PCChips motherboard using TX Pro chipset.
Note that there are exceptions to the rules described, mainly when dealing with PCChips motherboards. Looking at the serial number of a M747 motherboard you can see that the manufacturer's ID is an invalid number (there is no 0747 manufacturer); instead of identifying the manufacturer (PCChips), it is giving the model (M747). Whenever a motherboard's serial number does not conform to the rules described, you may be dealing with a PCChips piece.