📄 main.frm
字号:
VERSION 5.00
Begin VB.Form fMain
Caption = "Award BIOS Manipulator"
ClientHeight = 5685
ClientLeft = 60
ClientTop = 345
ClientWidth = 3630
LinkTopic = "Form1"
ScaleHeight = 5685
ScaleWidth = 3630
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton bt_Select
Height = 285
Index = 16
Left = 1500
Picture = "Main.frx":0000
Style = 1 'Graphical
TabIndex = 8
Top = -300
Width = 315
End
Begin VB.CommandButton bt_Load
Caption = "Load"
Height = 315
Left = 0
TabIndex = 7
Top = 5340
Width = 1035
End
Begin VB.CommandButton bt_Store
Caption = "Store"
Height = 315
Left = 2580
TabIndex = 6
Top = 5340
Width = 1035
End
Begin VB.CommandButton BT_Change
Caption = "+"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Index = 16
Left = 3300
TabIndex = 5
Top = -300
Width = 315
End
Begin VB.TextBox TB_Offset
Height = 285
Index = 16
Left = 2580
TabIndex = 4
Text = "Offset"
Top = -300
Width = 675
End
Begin VB.TextBox TB_Base
Height = 285
Index = 16
Left = 1860
TabIndex = 3
Text = "Base"
Top = -300
Width = 675
End
Begin VB.TextBox TB_Data
Height = 285
Index = 16
Left = 0
TabIndex = 2
Text = "FileName"
Top = -300
Width = 1455
End
Begin VB.CommandButton bt_tSelect
Height = 285
Index = 0
Left = 3300
Picture = "Main.frx":0102
Style = 1 'Graphical
TabIndex = 1
Top = 60
Width = 315
End
Begin VB.TextBox tb_BIOS
Height = 285
Index = 0
Left = 0
TabIndex = 0
Text = "BIOS Filename"
Top = 60
Width = 3255
End
End
Attribute VB_Name = "fMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'AwardMod BIOS Manipulation Tool
'Copyright (C) 2001 Josef Hill
'
'This program is free software; you can redistribute it and/or
'modify it under the terms of the GNU General Public License
'as published by the Free Software Foundation; either version 2
'of the License, or any later version.
'
'This program is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'GNU General Public License for more details.
'
'You should have received a copy of the GNU General Public License
'along with this program; if not, write to the Free Software
'Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Private mA() As Boolean
Private mBD As AwardMod.BIOSDir
Private mO As Byte
Private mIn() As Integer 'Indeces of roms
Private Sub BT_Change_Click(Index As Integer)
Dim lI As Long
If mA(Index) = False Then
If Not IsNumeric(TB_Base(Index).Text) Then GoTo lPErr
If Not IsNumeric(TB_Offset(Index).Text) Then GoTo lPErr
If TB_Data(Index).Text = "Filename" Or TB_Data(Index).Text = "" Then GoTo lPErr
mIn(Index) = mBD.AddFile(TB_Data(Index).Text, CLng(TB_Base(Index).Text), CLng(TB_Offset(Index).Text))
Else
mBD.DelFile CLng(mIn(Index))
End If
pClearScreen
pLoad
Exit Sub
lPErr:
MsgBox "You must enter a Filename, and you must enter a number into the Base and Offset Fields"
End Sub
Private Sub bt_Load_Click()
'Only Load one or the other
Set mBD = New AwardMod.BIOSDir
pClear
If (tb_BIOS(0).Text <> "BIOS Filename") And (tb_BIOS(0).Text <> "") Then
mBD.LoadFile tb_BIOS(0)
GoTo out
End If
If (tb_BIOS(1).Text <> "BIOS Directory") And (tb_BIOS(1).Text <> "") Then
mBD.LoadDir IIf(Right(tb_BIOS(1), 1) <> "\", tb_BIOS(1) & "\", tb_BIOS(1))
GoTo out
End If
MsgBox "There was nothing to load"
out:
pLoad
tb_BIOS(0).Text = "BIOS Filename"
tb_BIOS(1).Text = "BIOS Directory"
End Sub
Private Sub bt_Select_Click(Index As Integer)
TB_Data(Index).Text = Trim2File(OpenDialogBox("", "Select Rom File", ""))
End Sub
Private Sub bt_tSelect_Click(Index As Integer)
tb_BIOS(Index).Text = OpenDialogBox("", "Select BIOS Rom/DefFile", "")
If Index = 1 Then
tb_BIOS(Index).Text = Trim2Path(tb_BIOS(Index).Text)
End If
End Sub
Private Sub bt_Store_Click()
Dim lB As Boolean
If (tb_BIOS(0).Text <> "BIOS Filename") And (tb_BIOS(0).Text <> "") Then
mBD.SaveFile tb_BIOS(0)
lB = True
End If
If (tb_BIOS(1).Text <> "BIOS Directory") And (tb_BIOS(1).Text <> "") Then
mBD.SaveDir IIf(Right(tb_BIOS(1), 1) <> "\", tb_BIOS(1) & "\", tb_BIOS(1))
lB = True
End If
If lB = True Then
Set mBD = Nothing
pClear
Else
MsgBox "You must Select a file and/or a directory to save"
End If
End Sub
Private Sub form_load()
pDupName
End Sub
Private Sub pDupName()
pAddElement tb_BIOS
tb_BIOS(tb_BIOS.UBound).Text = "BIOS Directory"
pAddElement bt_tSelect
pAddElement TB_Data
pAddElement bt_Select
pAddElement TB_Base
pAddElement TB_Offset
pAddElement BT_Change
TB_Data(17).Top = 780
bt_Select(17).Top = 780
TB_Base(17).Top = 780
TB_Offset(17).Top = 780
BT_Change(17).Top = 780
ReDim mIn(16 To 17)
ReDim mA(16 To 17)
pClearScreen
End Sub
Private Sub pAddElement(iCtl As Object)
Dim lI As Long
On Error Resume Next
lI = iCtl.UBound
Load iCtl(lI + 1)
iCtl(lI + 1).Top = iCtl(lI).Top + iCtl(lI).Height + 25
iCtl(lI + 1).Text = iCtl(lI).Text
iCtl(lI + 1).Visible = True
End Sub
Private Sub pClear()
Set mBD = Nothing
Set mBD = New AwardMod.BIOSDir
pClearScreen
End Sub
Private Sub pClearScreen()
Dim lI As Long
If TB_Data.UBound > 16 Then
For lI = 18 To TB_Data.UBound
Unload TB_Data(lI)
Unload bt_Select(lI)
Unload TB_Base(lI)
Unload TB_Offset(lI)
Unload BT_Change(lI)
Next lI
End If
TB_Data(17).Text = "FileName"
TB_Base(17).Text = "0"
TB_Offset(17).Text = "0"
TB_Data(17).Enabled = False
TB_Base(17).Enabled = False
TB_Offset(17).Enabled = False
bt_Select(17).Enabled = False
BT_Change(17).Enabled = False
bt_Store.Enabled = False
ReDim mIn(16 To 17)
ReDim mA(16 To 17)
mIn(17) = 0
mA(17) = False
End Sub
Private Sub pLoad()
Dim lV As Variant
Dim lI As Long
lV = mBD.GetDataArray
If IsEmpty(lV) Then Exit Sub
TB_Data(17).Enabled = True
TB_Base(17).Enabled = True
TB_Offset(17).Enabled = True
bt_Select(17).Enabled = True
BT_Change(17).Enabled = True
bt_Store.Enabled = True
For lI = LBound(lV) To UBound(lV)
pAddROM
mA(lI + 17) = True
mIn(lI + 17) = lV(lI, 0)
TB_Data(lI + 17).Text = lV(lI, 1)
TB_Base(lI + 17).Text = lV(lI, 2)
TB_Offset(lI + 17).Text = lV(lI, 3)
BT_Change(lI + 17).Caption = "-"
bt_Select(lI + 17).Visible = False
Next lI
End Sub
Private Sub pAddROM()
pAddElement TB_Data
pAddElement bt_Select
pAddElement TB_Base
pAddElement TB_Offset
pAddElement BT_Change
ReDim Preserve mIn(LBound(mIn) To UBound(mIn) + 1)
ReDim Preserve mA(LBound(mA) To UBound(mA) + 1)
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
Set mBD = Nothing
pClearScreen
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -