Thanks!!!..... although I think I just hit the report button instead of the thanks button stupid trackpad on laptop Andy
For drewb95 The initial detection code Code: Private Function ProcessOriginal(ByRef sName As String, ByRef sSLICName As String, ByVal bVerbose As Boolean) As Boolean Dim iCount, iCount2, iCount3, iOff As Integer Dim lOffset, lBIOSLen, l1BLen, lTemp, lIndex, lAdjustment, lSegOff As UInteger Dim sVersion As String Dim sBIOS(), s1B() As Byte Dim lModules(255, 80) As UInteger Dim bDone, bEmbedded As Boolean Dim sTemp As String Dim iStatus As MsgBoxResult Dim sType, sInfo As String On Error GoTo UnhandledError ProcessOriginal = False ' ** Parse Original BIOS bEmbedded = ParseBIOS(sName, sBIOS, lBIOSLen) If lBIOSLen = 0 Then Exit Function ' ** Check BIOS size If (lBIOSLen Mod 65536) <> 0 Then AddLine("BIOS size not valid", cError) cmdVerify.Enabled = False cboManufacturer.SelectedIndex = -1 : lblManufacturer.Enabled = False : cboManufacturer.Enabled = False DisableControls() Exit Function End If ' ** Check core v8 lOffset = Find(sBIOS, "AMIBIOSC08", 10, 16) If lOffset = cEnd Then lOffset = Find(sBIOS, "AMIBIOSCTarg", 10, 16) If lOffset <> cEnd Then sVersion = "AMIBIOS core version is 0800" AddLine(sVersion) lblStatus.Text = sVersion bCore8 = True bCore7 = False ' ** Fill in filenames lbl1B.Text = "BIOS 1B File" lblOutput.Text = "Output 1B File" chkDSDTOnly.Text = "DSDT Only" Else lOffset = Find(sBIOS, "AMIBIOSC07", 10, 16) If lOffset = cEnd Then lOffset = Find(sBIOS, "AMIBIOSC06", 10, 16) If lOffset <> cEnd Then sVersion = "AMIBIOS core version is " & GetString(sBIOS, lOffset + 8, 4) AddLine(sVersion) lblStatus.Text = sVersion bCore7 = True bCore8 = False ' ** Disable controls DisableControls7() chkDSDTOnly.Text = "Use Bootblock" ' ** Control labels changed later depending on SLIC/SLP End If End If If lOffset <> cEnd Then If bEmbedded Then ' ** Adjust filenames sTemp = sName If VB.Right(sTemp, 4) = ".EXE" Then sTemp = Mid(sTemp, 1, Len(sTemp) - 4) sTemp &= ".ROM" My.Computer.FileSystem.WriteAllBytes(sTemp, sBIOS, False) sName = sTemp End If If bCore8 Then If InStrRev(sName, "\") <> 0 Then sBIOSPath = VB.Left(sName, InStrRev(sName, "\")) Else sBIOSPath = "" sPath = VB.Left(Application.ExecutablePath, InStrRev(Application.ExecutablePath, "\")) If Dir(sBIOSPath & "1B.BIN") <> "" Then My.Computer.FileSystem.DeleteFile(sBIOSPath & "1B.BIN") ' ** See if junk at start If lBIOSLen < &H100000 Then lAdjustment = (&H100000 - lBIOSLen) Else lAdjustment = 0 If sBIOS(lOffset - 5) <> 0 And (sBIOS(lOffset - 4) And 1) = 1 Then lSegOff = &H10000 Else lSegOff = &H10 lIndex = ConvertDWord(sBIOS(lOffset + &H12), sBIOS(lOffset + &H13), sBIOS(lOffset + &H14), sBIOS(lOffset + &H15)) lOffset = ConvertOffset(sBIOS(lOffset + &H12), sBIOS(lOffset + &H13), sBIOS(lOffset + &H14), sBIOS(lOffset + &H15), lSegOff, lAdjustment) If lOffset < lBIOSLen And lIndex <> cEnd Then iOff = 0 Do Until IsValidHeader8(sBIOS, lBIOSLen, lOffset + iOff - 8, False, False) Or (iOff + &H10000) >= lBIOSLen iOff += &H10000 Loop End If If IsValidHeader8(sBIOS, lBIOSLen, lOffset + iOff - 8, False, False) And iOff <> 0 Then ' ** Remove initial If iOff > 0 Then Buffer.BlockCopy(sBIOS, iOff, sBIOS, 0, lBIOSLen - iOff) ReDim Preserve sBIOS(lBIOSLen - iOff - 1) lBIOSLen = UBound(sBIOS) + 1 End If My.Computer.FileSystem.WriteAllBytes(sBIOSPath & "TEMPBIOS.ROM", sBIOS, False) sOriginalBIOSName = sBIOSPath & "TEMPBIOS.ROM" bExtra = True iBIOSOffset = iOff Else sOriginalBIOSName = sName bExtra = False iBIOSOffset = 0 End If ' ** Cannot use extract function as need to determine if MMTool2 needed bMMTool2 = False RunAMIMMWin(Chr(34) & sOriginalBIOSName & Chr(34) & " /e 1B " & Chr(34) & sBIOSPath & "1B.BIN" & Chr(34) & " /u") If Dir(sBIOSPath & "1B.BIN") = "" Then ' ** Try and see if MMTool2 will do it bMMTool2 = True RunMMTool2(sOriginalBIOSName, "/e 1B", sBIOSPath & "1B.BIN", "") If Dir(sBIOSPath & "1B.BIN") = "" Then AddLine("Failed to extract 1B module", cError) DisableControls() Exit Function End If End If s1B = My.Computer.FileSystem.ReadAllBytes(sBIOSPath & "1B.BIN") l1BLen = UBound(s1B) + 1 ' ** Enable controls lblManufacturer.Enabled = True : cboManufacturer.Enabled = True ' ** Scan for manufacturer bExistingSLIC = False lExistingSLICOffset = 0 bReverseSLIC = False bForceDynamic = False bFullSLIC = False bMultipleF = False lFModule = 0 bDone = False cboManufacturer.SelectedIndex = -1 sTemp = sName If UCase(VB.Right(sTemp, 4)) = ".ROM" Then sTemp = VB.Mid(sTemp, 1, Len(sTemp) - 4) If Find(sBIOS, "$ASUSAMI", 0) <> cEnd Then cboManufacturer.SelectedIndex = cASUS : bDone = True If Find(s1B, "ASUSTEK", 0) <> cEnd Then cboManufacturer.SelectedIndex = cASUS : bDone = True If Find(s1B, "BIOSTAR") <> cEnd Then cboManufacturer.SelectedIndex = cBIOSTAR : bDone = True If GetString(sBIOS, lOffset + 14, 4) = GetString(sBIOS, lBIOSLen - 256, 4) Then cboManufacturer.SelectedIndex = cXFX : bDone = True If Not bDone And Find(sBIOS, "ASR") <> cEnd And Find(s1B, "_ASR") <> cEnd Then cboManufacturer.SelectedIndex = cASRock : bDone = True If Not bDone And Find(s1B, "Acer") <> cEnd Then cboManufacturer.SelectedIndex = cAcer : bDone = True If Not bDone And UCase(VB.Right(sTemp, 4)) = ".BST" Then cboManufacturer.SelectedIndex = cBIOSTAR : bDone = True If Not bDone And UCase(VB.Right(sTemp, 4)) = ".BSP" Then cboManufacturer.SelectedIndex = cBIOSTAR : bDone = True If Not bDone And VB.Mid(sTemp, Len(sTemp) - 3, 1) = "." And IsNumeric(VB.Mid(sTemp, Len(sTemp) - 2, 3)) = True Then cboManufacturer.SelectedIndex = cMSI : bDone = True If bBatch And Not bDone Then cboManufacturer.SelectedIndex = cOther : bDone = True If Not bDone Then cboManufacturer.SelectedIndex = -1 : DisableControls() cmdVerify.Enabled = True : cmdExtract.Enabled = True ProcessOriginal = True ' ** Find RSDT table to see if already SLICd lOffset = Find(s1B, "RSDT" & Chr(44)) If lOffset <> cEnd Then lOffset = ConvertDWord(s1B(lOffset + 40), s1B(lOffset + 41), s1B(lOffset + 42), s1B(lOffset + 43)) If lOffset <= &HFF400 Then ' ** SSV3 lTemp = Match(s1B, "eAeMeIeBeIeOeSe o0o1") If lTemp = cEnd Then lTemp = Find(s1B, "AMIBIOS Targa") lOffset = lTemp - (&HFF400 - lOffset) If lOffset < l1BLen Then If GetString(s1B, lOffset, 4) = "SLIC" Then ' ** See if OA2.0 or 2.1 SLIC If GetString(s1B, lOffset + &HE2, 4) = Chr(1) & Chr(0) & Chr(2) & Chr(0) Then sType = "2.1" Else sType = "2.0" AddLine("This BIOS has already had a SLIC (" & sType & ") table (" & TidyString(GetString(s1B, lOffset + 10, 22)) & ") added with the SSV3 method", cOKOnly) Buffer.BlockCopy(s1B, lOffset, sExistingSLIC, 0, 374) bExistingSLIC = True End If End If Else lOffset = lOffset - (&H100000000 - lBIOSLen) If lOffset < lBIOSLen Then If GetString(sBIOS, lOffset + &HE2, 4) = Chr(1) & Chr(0) & Chr(2) & Chr(0) Then sType = "2.1" Else sType = "2.0" If IsValidHeader8(sBIOS, lBIOSLen, lOffset - 20, False, False) Then ' ** SSV1 AddLine("This BIOS has already had a SLIC (" & sType & ") table (" & TidyString(GetString(sBIOS, lOffset + 10, 22)) & ") added with the SSV1 method", cOKOnly) bExistingSLIC = True ElseIf GetString(sBIOS, lOffset, 4) = "SLIC" Then AddLine("This BIOS has already had a SLIC (" & sType & ") table (" & TidyString(GetString(sBIOS, lOffset + 10, 22)) & ") added with the SSV2 method", cOKOnly) lExistingSLICOffset = lOffset bExistingSLIC = True End If If bExistingSLIC Then Buffer.BlockCopy(sBIOS, lOffset, sExistingSLIC, 0, 374) End If End If Else ' ** Check for dynamic SLIC lOffset = Find(s1B, "RSDT" & Chr(40)) If lOffset <> cEnd Then lOffset = Find(s1B, "SLICv", lOffset) If lOffset <> cEnd Then ' ** See if dummy For iCount = 0 To 127 If s1B(lOffset + &H40 + iCount) <> 0 Then Exit For Next If iCount < 128 Then If GetString(s1B, lOffset + &HE2, 4) = Chr(1) & Chr(0) & Chr(2) & Chr(0) Or GetString(s1B, lOffset + &HE2, 4) = Chr(&HFE) & Chr(&HFF) & Chr(&HFD) & Chr(&HFF) Then sType = "2.1" Else sType = "2.0" iStatus = Ask("This BIOS has already had a SLIC (" & sType & ") table (" & TidyString(GetString(s1B, lOffset + 10, 22)) & ") added with the dynamic method. Allow modification?") Buffer.BlockCopy(s1B, lOffset, sExistingSLIC, 0, 374) If iStatus = vbNo Then bExistingSLIC = True Else bForceDynamic = True End If End If If Not bExistingSLIC And Not bForceDynamic Then ' ** Look for FC and F0 modules ModuleScan8(sBIOS, lBIOSLen, lModules, False, True) For iCount = &HF0 To &HFF iCount2 = 1 Do Until lModules(iCount, iCount2) = 0 And lModules(iCount, iCount2 + 1) = 0 If (lModules(iCount, iCount2 + 1) = 340 And (GetString(sBIOS, lModules(iCount, iCount2) + 36, 4) = "RSA1" Or GetString(sBIOS, lModules(iCount, iCount2) + 218, 4) = "RSA1")) Or _ (lModules(iCount, iCount2 + 1) = 376 And GetString(sBIOS, lModules(iCount, iCount2) + 72, 4) = "RSA1") Then If lModules(iCount, iCount2 + 1) = 340 Then ' ** Partial SLIC If GetString(sBIOS, lModules(iCount, iCount2) + &HDA, 4) = "RSA1" Then lTemp = &H36 : bReverseSLIC = True Else lTemp = &HD2 If GetString(sBIOS, lModules(iCount, iCount2) + lTemp, 4) = Chr(1) & Chr(0) & Chr(2) & Chr(0) Then sType = "2.1" Else sType = "2.0" sInfo = TidyString(GetString(sBIOS, lModules(iCount, iCount2) + lTemp - 22, 14)) Else ' ** Full SLIC If GetString(sBIOS, lModules(iCount, iCount2) + &HF6, 4) = Chr(1) & Chr(0) & Chr(2) & Chr(0) Then sType = "2.1" Else sType = "2.0" bFullSLIC = True sInfo = TidyString(GetString(sBIOS, lModules(iCount, iCount2) + &H1E, 22)) End If ' ** See if dummy If bFullSLIC Then lTemp = &H40 Else If bReverseSLIC Then lTemp = &HD2 Else lTemp = &H1C For iCount3 = 0 To 127 If sBIOS(lModules(iCount, iCount2) + lTemp + 20 + iCount3) <> 0 Then Exit For Next iStatus = Ask("This BIOS has already had a " & IIf(iCount3 = 128, "Dummy ", "") & "SLIC (" & sType & ") table (" & sInfo & ") inserted in the " & Hex(iCount) & " module. Allow modification?", True) If iStatus <> MsgBoxResult.Cancel Then If lModules(iCount, iCount2 + 1) = 340 Then ' ** Partial SLIC Buffer.BlockCopy(sBIOS, lModules(iCount, iCount2) + 20, sExistingSLIC, 36, 156) Else ' ** Full SLIC Buffer.BlockCopy(sBIOS, lModules(iCount, iCount2) + 20, sExistingSLIC, 0, 374) End If lFModule = iCount If iStatus = vbNo Then bExistingSLIC = True Else bForceDynamic = True End If ' ** See if another module with same id If lModules(iCount, 5) <> 0 Then bMultipleF = True End If iCount2 += 4 Loop Next End If End If End If If bExistingSLIC Then DisableControls() lblCertificate.Enabled = True : txtCertificate.Enabled = True : cmdVerifyCert.Enabled = True lblManufacturer.Enabled = True : cboManufacturer.Enabled = True If cboManufacturer.SelectedIndex <> -1 Then lblSLP.Enabled = True : txtSLP.Enabled = True : cmdSLP.Enabled = True cmdGo.Enabled = True End If optSSV2.Checked = True Else If bForceDynamic Then If cboManufacturer.SelectedIndex <> -1 Then DynamicControls() optDynamic.Checked = True If lFModule <> 0 Then gOptions.bFOnly = True gOptions.b1BOnly = True Else gOptions.bFOnly = False gOptions.b1BOnly = True End If ' ** MSI Special case If cboManufacturer.SelectedIndex = cMSI And lFModule <> 0 Then gOptions.b1BOnly = False gOptions.bNoTables = True End If End If lblCertificate.Enabled = False : txtCertificate.Enabled = False : cmdVerifyCert.Enabled = False End If chkDSDTOnly.Enabled = True : chkDSDTOnly.Checked = False My.Computer.FileSystem.DeleteFile(sBIOSPath & "1B.BIN") Else ' ** Not core v8 sOriginalBIOSName = sName bExtra = False cboManufacturer.SelectedIndex = -1 : lblManufacturer.Enabled = False : cboManufacturer.Enabled = False lblSLIC.Enabled = True : txtSLIC.Enabled = True : cmdSLIC.Enabled = True lblSLP.Enabled = True : txtSLP.Enabled = True : cmdSLP.Enabled = True optSSV1.Enabled = True 'xxx optSSV2.Enabled = True chkLog.Enabled = True cmdGo.Enabled = True cmdVerify.Enabled = True cmdOptions.Enabled = True chkDSDTOnly.Enabled = True : chkDSDTOnly.Checked = False ' ** Set default options (as no manufacturer) gOptions.bOnlySDT = False gOptions.bOEMIDOnly = False gOptions.bAlternate = False gOptions.bSLPSSV2 = False gOptions.bManualAddress = False gOptions.lManualAddress = 0 gOptions.bRange = False gOptions.lStartRange = 0 gOptions.lEndRange = 0 gOptions.bPadding = False gOptions.bAdjust32 = True gOptions.bForceBelow = True gOptions.bPreferBelow = False gOptions.bAllowNVRAM = False gOptions.bUseLHA = True gOptions.bSLICModule = False gOptions.bAllowBB = False End If ' ** Fill in filenames If InStrRev(sName, ".") <> 0 Then sTemp = UCase(Mid(sName, 1, InStrRev(sName, ".") - 1)) Else sTemp = UCase(sName) sTemp &= "_SLIC" If InStrRev(sName, ".") <> 0 Then sTemp &= UCase(Mid(sName, InStrRev(sName, "."))) sSLICName = sTemp ProcessOriginal = True Else ' ** Disable controls DisableControls() cmdVerify.Enabled = False : cmdExtract.Enabled = False cboManufacturer.SelectedIndex = -1 : lblManufacturer.Enabled = False : cboManufacturer.Enabled = False If Find(sBIOS, "AMIBIOSC0", 10, 16) = cEnd Then lblStatus.Text = "Not AMI BIOS" AddLine("Not AMI BIOS", cError) Else lblStatus.Text = "AMIBIOS core version is not supported" AddLine("AMIBIOS core version is not supported", cError) End If End If Exit Function UnhandledError: DisableControls() If Not bBatch Then MsgBox("Error " & CStr(Err.Number) & " - " & Err.Description, MsgBoxStyle.OkOnly, "Error") End Function Private Function ParseBIOS(ByVal sLoadPath As String, ByRef sBIOS() As Byte, ByRef lBIOSLen As UInteger) As Boolean Dim sLoad() As Byte Dim lStart, lEnd As UInteger ParseBIOS = False lBIOSLen = 0 sLoad = My.Computer.FileSystem.ReadAllBytes(txtOriginalBIOS.Text) lStart = Find(sLoad, "_EMBEDDED_ROM_START_" & Chr(0)) If lStart <> cEnd Then lEnd = Find(sLoad, "_EMBEDDED_ROM_END_" & Chr(0)) If lStart <> cEnd And lEnd <> cEnd Then ' ** Embedded in flash program lBIOSLen = lEnd - (lStart + 21) ReDim sBIOS(lBIOSLen - 1) Buffer.BlockCopy(sLoad, lStart + 21, sBIOS, 0, lBIOSLen) ParseBIOS = True Else lBIOSLen = UBound(sLoad) + 1 ReDim sBIOS(lBIOSLen - 1) Buffer.BlockCopy(sLoad, 0, sBIOS, 0, lBIOSLen) End If End Function
@andyp Btw, seems that I have located a bug. After opening a SLIC 2.2 modded bios using this tool, it reports "The BIOS has already had a SLIC 2.0 table".
Does Anyone has this BIOS MODE please? Requests Bios Mod Manufacturer:HP Motherboard: Pegatron IPIBL-LB (Benicia) SLIC: HP 2.2 SLP: HP
Thank you for the reply. I did try that, but it greys out "SLIC File" and doesn't allow me to select one. The radio button for SSV2 is selected and is also greyed out. is it maybe because I using win 8, I shouldn't matter, should it? Thanks
Thanks that did the trick. Not sure why I never tried cancel. I don't even think I really noticed the cancel button. lol
PCIe BIOS update Hi everyone, I would like to modify the Asus Z9PE-D16/L2 BIOS to accommodate additional PCIe I/O boards which will be attaches to the Asus MB via PCIe expansion chassis such as Magma or Cycle Technologies. Currently with an industrial backplane I'm limited to only 32 PCIe devices (Linux OS) and the rest are not recognized. This is due to PCIe enumeration issue which on some BIOS does not recognize PCIe slots outside of its internal slots. The vendor of an older motherboard modified their BIOS but now we are moving on to faster boards and moving to PCIe, I have not been able to get any support from Asus or AMI and I'm hoping I can avoid the original vendor and use this Asus board. Can i modify the Asus Z9PE-D16/L2 AMI BIOS using this tool to change the PCIe enumeration? Thanks
Hello, I have a ASUS M4A78L-M, is a AMI Bios. With the #1 program, Windows activate should not? But I have a question, the program modifies DMI not? there any way to go back?
Yah, after modding with this tool you can easily activate Windows. No, it doesn't modify DMI. Just flash the official non-modded version again.