EXE2SWF(SourceCode)

由于以前写过个播放器,硬盘里也放着不少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

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值