夜月琉璃Lv46
迅雷XV文件转换成FLV文件
////// XVE For Vista/Win7 Update 5 Beta 1 //////
////// Visual Studio 2008 + VB.NET + .NET Framework 2.0 //////
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim fb(&H200010), peek(4) As Byte
Dim mn, type, l, rl, c, fail As Integer
Dim ts As String
Dim fin, fout As System.IO.FileStream
If MsgBox("请注意,本程序仅供学习之用,请将生成文件立刻删除。" + vbCrLf + "对于使用本程序造成的任何后果,由使用者自行承担法律责任!谢绝跨省。" + vbCrLf + "点击[是],表示您同意自行承担所有责任!", MsgBoxStyle.YesNo) <> MsgBoxResult.Yes Then Exit Sub
Button2.Enabled = False
For i = 0 To ListView1.Items.Count - 1
c = 0
ListView1.Items(i).SubItems(0).Text = "开始转换"
Application.DoEvents()
fin = New System.IO.FileStream(ListView1.Items(i).SubItems(1).Text, IO.FileMode.OpenOrCreate)
l = fin.Length
fin.Read(fb, 0, &H200000)
fin.Read(peek, 0, 4)
mn = (Asc("R") - peek(1) + &H100) And &HFF
If (((peek(2) + mn) And &HFF) = Asc("M") And ((peek(3) + mn) And &HFF) = Asc("F")) Then
type = 1
GoTo ok
End If
mn = (&H26 - peek(1) + &H100) And &HFF
If (((peek(2) + mn) And &HFF) = &HB2 And ((peek(3) + mn) And &HFF) = &H75) Then
type = 2
GoTo ok
End If
mn = (Asc("L") - peek(1) + &H100) And &HFF
If (((peek(2) + mn) And &HFF) = Asc("V")) Then
type = 3
GoTo ok
End If
mn = (Asc("I") - peek(1) + &H100) And &HFF
If (((peek(2) + mn) And &HFF) = Asc("F") And ((peek(3) + mn) And &HFF) = Asc("F")) Then
type = 4
GoTo ok
End If
mn = (-peek(1) + &H100) And &HFF
If (((peek(2) + mn) And &HFF) = 0) Then
type = 5
GoTo ok
End If
mn = (-peek(1) + &H100) And &HFF
If (((peek(2) + mn) And &HFF) = 1 And ((peek(3) + mn) And &HFF) = &HBA) Then
type = 6
GoTo ok
End If
mn = (&H45 - peek(1) + &H100) And &HFF
If (((peek(2) + mn) And &HFF) = &HDF And ((peek(3) + mn) And &HFF) = &HA3) Then
type = 7
GoTo ok
End If
fout = New System.IO.FileStream(ListView1.Items(i).SubItems(1).Text + "1", IO.FileMode.OpenOrCreate)
fout.Write(fb, 0, &H200000)
fout.Write(fb, 0, 4)
fin.Read(fb, 0, &H100000)
fout.Write(fb, 0, &H100000)
ListView1.Items(i).SubItems(0).Text = "失败"
Application.DoEvents()
fail += 1
GoTo nxt
ok:
ts = Split("rmvb wmv flv avi mp4 mpg mkv")(type - 1)
fout = New System.IO.FileStream(ListView1.Items(i).SubItems(1).Text + "." + ts, IO.FileMode.OpenOrCreate)
peek(0) = CByte(Val(Split("46 48 70 82 0 0 26")(type - 1)))
For j = 1 To 3
peek(j) = CByte((CInt(peek(j)) + mn) And &HFF)
Next
fout.Write(peek, 0, 4)
fin.Read(fb, 0, &H3FC)
For j = 1 To &H3FC
fb(j - 1) = CByte((CInt(fb(j - 1)) + mn) And &HFF)
Next
fout.Write(fb, 0, &H3FC)
While fin.Position <= l
rl = fin.Read(fb, 0, &H40000)
If rl = 0 Then Exit While
fout.Write(fb, 0, rl)
c = c + 1
If c = 10 Then
ListView1.Items(i).SubItems(0).Text = "转换" + Trim(Str(Format(fout.Position / (l - &H200000) * 100, "0"))) + "%"
Application.DoEvents()
ProgressBar1.Value = Int(Math.Round(fout.Position / (l - &H200000) * 100))
c = 0
End If
End While
ListView1.Items(i).SubItems(0).Text = "完成转换"
Application.DoEvents()
nxt:
fin.Close()
fout.Close()
Next
MsgBox("转换结束" + vbCrLf + Trim(Str(ListView1.Items.Count - fail)) + "成功," + Trim(Str(fail)) + "失败" + IIf(fail <> 0, "请将目标文件下生成的错误信息文件%s发给作者,以便及时解决问题。" + vbCrLf + "注:该文件为xv文件的前3MB内容,不含有任何涉及您的隐私的信息。" + vbCrLf + "作者的电子邮件:692827763@qq.com", ""))
ProgressBar1.Value = 0
Button2.Enabled = True
End Sub
程序文件:xv转换器
0 已被阅读了6005次 楼主 2017-03-30 23:02:48
