level 1
穿IDcl
楼主
仙一有个音效文件是.mkf格式的,想解包了用。但是网上没找到mkf解包器。只找到了源码
Dim FJ() As Byte, coUNtA()
Private Sub Command1_Click()
'Me.Hide
Command1.Enabled = False
Text1.Enabled = False
Drive1.Enabled = False
Dir1.Enabled = False
Open Me.CommonDialog1.FileName For Binary As #1
ReDim FJ(LOF(1))
For i = 1 To LOF(1)
Get #1, , FJ(i)
If i Mod 20000 = 0 Then
Text2.Text = "loading " & Mid(i / LOF(1) * 100, 1, 2) & "%"
Text2.Refresh
Me.Refresh
End If
Next i
Dim a1(4)
For i = 4 To 1 Step -1
e = 5 - i
a1(e) = Hex(FJ(i))
asdf1 = a1(e)
For b = Len(a1(e)) To 1
asdf1 = "0" & asdf1
Next b
a1(e) = asdf1
a1(0) = Val("&H" & a1(1) & a1(2) & a1(3) & a1(4) & "&")
Next i
If a1(0) Mod 4 <> 0 Then MsgBox a1(0): End
ReDim coUNtA(a1(0) / 4 + 5)
coUNtA(1) = a1(0)
For i = 2 To (a1(0) / 4)
For k = 4 To 1 Step -1
'e = 5 - k
a1(k) = Hex(FJ(i * 4 - k + 1))
asdf1 = a1(k)
For b = Len(a1(k)) To 1
asdf1 = "0" & asdf1
Next b
a1(k) = asdf1
a1(0) = Val("&H" & a1(1) & a1(2) & a1(3) & a1(4) & "&")
Next k
Debug.Print a1(0)
coUNtA(i) = a1(0)
Next i
coUNtA(0) = i - 1
'For c = 7 To 1 Step -2
'temp1 = temp1 & Mid(asdf1, c, 2)
'Next c
Close #1
For i = 1 To coUNtA(0)
If coUNtA(1) = coUNtA(2) And www <> 1 Then i = i + 1: www = 1: GoTo 10
Open Me.Dir1.Path & "\" & i & Text1.Text For Binary As #2
For w = (coUNtA(i) + 1) To coUNtA(i + 1)
Put #2, , FJ(w)
Next w
Close #2
Text2.Text = "writing " & i & "/" & coUNtA(0)
Text2.Refresh
Me.Refresh
10 Next i
End
End Sub Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub Private Sub Form_Load()
Dim q As Byte
Dim w As Byte Me.CommonDialog1.ShowOpen
If Me.CommonDialog1.FileName = "" Then End
Open Me.CommonDialog1.FileName For Binary As #1
Get #1, , q
Get #1, , w
Close #1
q = Hex(q)
For i = Len(q) To 1
q = "0" & q
Next i
w = Hex(w)
For i = Len(w) To 1
w = "0" & w
Next i
a1 = w & q
a2 = Val("&H" & a1 & "&")
Open Me.CommonDialog1.FileName For Binary As #1
Get #1, a2 + 1, q
Get #1, , w
Close #1 If q = 170 And w = 85 Then
Text1.Text = ".rix"
ElseIf q = 67 And w = 114 Then
Text1.Text = ".voc"
ElseIf q = 82 And w = 73 Then
Text1.Text = ".wav"
ElseIf q = 77 And w = 84 Then
Text1.Text = ".mid"
ElseIf q = 66 And w = 77 Then
Text1.Text = ".bmp"
ElseIf q = 10 And w = 5 Then
Text1.Text = ".pcx"
End If
End Sub
2013年07月11日 03点07分
1
Dim FJ() As Byte, coUNtA()
Private Sub Command1_Click()
'Me.Hide
Command1.Enabled = False
Text1.Enabled = False
Drive1.Enabled = False
Dir1.Enabled = False
Open Me.CommonDialog1.FileName For Binary As #1
ReDim FJ(LOF(1))
For i = 1 To LOF(1)
Get #1, , FJ(i)
If i Mod 20000 = 0 Then
Text2.Text = "loading " & Mid(i / LOF(1) * 100, 1, 2) & "%"
Text2.Refresh
Me.Refresh
End If
Next i
Dim a1(4)
For i = 4 To 1 Step -1
e = 5 - i
a1(e) = Hex(FJ(i))
asdf1 = a1(e)
For b = Len(a1(e)) To 1
asdf1 = "0" & asdf1
Next b
a1(e) = asdf1
a1(0) = Val("&H" & a1(1) & a1(2) & a1(3) & a1(4) & "&")
Next i
If a1(0) Mod 4 <> 0 Then MsgBox a1(0): End
ReDim coUNtA(a1(0) / 4 + 5)
coUNtA(1) = a1(0)
For i = 2 To (a1(0) / 4)
For k = 4 To 1 Step -1
'e = 5 - k
a1(k) = Hex(FJ(i * 4 - k + 1))
asdf1 = a1(k)
For b = Len(a1(k)) To 1
asdf1 = "0" & asdf1
Next b
a1(k) = asdf1
a1(0) = Val("&H" & a1(1) & a1(2) & a1(3) & a1(4) & "&")
Next k
Debug.Print a1(0)
coUNtA(i) = a1(0)
Next i
coUNtA(0) = i - 1
'For c = 7 To 1 Step -2
'temp1 = temp1 & Mid(asdf1, c, 2)
'Next c
Close #1
For i = 1 To coUNtA(0)
If coUNtA(1) = coUNtA(2) And www <> 1 Then i = i + 1: www = 1: GoTo 10
Open Me.Dir1.Path & "\" & i & Text1.Text For Binary As #2
For w = (coUNtA(i) + 1) To coUNtA(i + 1)
Put #2, , FJ(w)
Next w
Close #2
Text2.Text = "writing " & i & "/" & coUNtA(0)
Text2.Refresh
Me.Refresh
10 Next i
End
End Sub Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub Private Sub Form_Load()
Dim q As Byte
Dim w As Byte Me.CommonDialog1.ShowOpen
If Me.CommonDialog1.FileName = "" Then End
Open Me.CommonDialog1.FileName For Binary As #1
Get #1, , q
Get #1, , w
Close #1
q = Hex(q)
For i = Len(q) To 1
q = "0" & q
Next i
w = Hex(w)
For i = Len(w) To 1
w = "0" & w
Next i
a1 = w & q
a2 = Val("&H" & a1 & "&")
Open Me.CommonDialog1.FileName For Binary As #1
Get #1, a2 + 1, q
Get #1, , w
Close #1 If q = 170 And w = 85 Then
Text1.Text = ".rix"
ElseIf q = 67 And w = 114 Then
Text1.Text = ".voc"
ElseIf q = 82 And w = 73 Then
Text1.Text = ".wav"
ElseIf q = 77 And w = 84 Then
Text1.Text = ".mid"
ElseIf q = 66 And w = 77 Then
Text1.Text = ".bmp"
ElseIf q = 10 And w = 5 Then
Text1.Text = ".pcx"
End If
End Sub
