EXE2SWF(SourceCode)

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

由于以前写过个播放器,硬盘里也放着不少Flash文件,不少是EXE格式的.

也下载过一些小程序转换,现在闲着没事,自己也写了一个小程序...但

....

'''''函数功能:输入SWF或EXE格式的Flash文件

Private Sub OutputFlash(InputFile As String, Outputfile As String)

Dim bittmp() As Byte

Dim FileLenth&, I&, J&

Dim FileNum1 As Integer

Dim FileNum2 As Integer

Dim strFwsFlag As String

Dim strHexFlag As String

Dim strVAR As String

Dim bitVAR As Byte

Dim swfSize As Long

Dim swfStartPostion As Long

FileLenth = FileLen(InputFile)

S = "&H"

FileNum1 = FreeFile: Open InputFile For Binary As #FileNum1

FileNum2 = FreeFile: Open Outputfile For Binary As #FileNum2

Dim sss$: sss = Time

For I = FileLenth To FileLenth - 3 Step -1

Seek #FileNum1, I '''文件指针位置

t = AscB(StrConv((Input(1, #FileNum1)), 128)) '''字符串ASCII码

s = s & Hex(Int(t / 16)) & Hex(Int(t Mod 16)) '''双字16进制

Next

sss = sss & ">" & Time '''Record TIME

swfSize = Val(s) '''SWF文件大小

swfStartPostion = FileLenth - swfSize - 7 ''SWF文件开始地址

Seek #FileNum1, swfStartPostion

strVAR = Asc(Input(3, #FileNum1))

If strVAR = 70 Or strVAR = 67 Then '''正确查找到FWS标记

Dim startByte&: startByte = swfStartPostion

sss = sss & ">" & Time

ReDim bittmp(swfSize) As Byte

For I = 1 To swfSize

Get #FileNum1, swfStartPostion + I - 1, bittmp(I)

Next

For I = 1 To swfSize '''输出SWF格式的文件

Put #FileNum2, I, bittmp(I)

Next

sss = sss & ">" & Time ''Record TIME

Close #FileNum2

Skf.Movie = Outputfile

Else

MnuShowText.Caption = "Sorry! Can't Output SWF-Flash File"

tmr = True

End If

Close #FileNum1

sss = sss & ">" & Time ''Show Time

Me.Caption = sss

End Sub

每次写文件,读文件都是一个一个字节读写.所以速度很慢!

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有  導航