手机
当前位置:查字典教程网 >脚本专栏 >vbs >exe2swf 工具(Adodb.Stream版)
exe2swf 工具(Adodb.Stream版)
摘要:Exe2swf,将exe格式的flash文件转为swf格式。网上有很多这方面的工具,这个是用vbscript写的。用法:将下面代码存为exe...

Exe2swf,将exe格式的flash文件转为swf格式。网上有很多这方面的工具,这个是用vbscript写的。

用法:

将下面代码存为exe2swf.vbs

将exe格式的flash拖放在此文件上,即可生成swf文件,

更新日期:2005-01-2009:30

复制代码 代码如下:

'exe2swf工具,

'用法:将exe格式的flash拖放在此文件上,即可生成swf文件,

'haiwa@http://www.51windows.Net

'感谢jimbob提供帮助.

dimAsoR,FlashFileName

SetArgObj=WScript.Arguments

dimPositionStart,OKed,Tag,EndSize

PositionStart=920000'flash4的播放器的大致字节数

EndSize=8'exe文件结尾字节数,其它版本可以设置为0

FlashFileName=ArgObj(0)'传递路径

setAsoR=CreateObject("Adodb.Stream")

AsoR.Mode=3

AsoR.Type=1

AsoR.Open

setAsoW=CreateObject("Adodb.Stream")

AsoW.Mode=3

AsoW.Type=1

AsoW.Open

AsoR.LoadFromFile(FlashFileName)

OKed=true

dimfilesize

filesize=AsoR.size

iffilesize>PositionStartthen

whileOKed

AsoR.Position=PositionStart

Tag=Bin2Str(AsoR.read(20))

ifinstr(Tag,"0000000")>0then

PositionStart=PositionStart+1

else

PositionStart=PositionStart+20

endif

ifTag="00000000000000000708783"orTag="00000000000000000678783"then

OKed=false

endif

'ifPositionStart>filesizethen

'OKed=false

'endif

wend

else

msgbox"文件错误"

endif

PositionStart=PositionStart+16

'msgboxPositionStart

AsoR.Position=PositionStart

AsoW.writeAsoR.read(filesize-int(PositionStart)-int(EndSize))

'新文件名

dimnewFileName

'newFileName=left(FlashFileName,len(FlashFileName)-4)&".swf"

newFileName=FlashFileName&".swf"

Setfso=CreateObject("Scripting.FileSystemObject")

If(fso.FileExists(newFileName))Then

overwrite=msgbox(newFileName&"已存在"&vbnewline&"要替换它吗?",308,"文件已经存在-exe2swf脚本")

ifoverwrite=6then

AsoW.SaveToFilenewFileName,2

else

msgbox"操作被取消",0,"exe2swf脚本"

endif

else

AsoW.SaveToFilenewFileName,1

endif

AsoR.close

setAsoR=nothing

AsoW.close

setAsoW=nothing

FunctionBin2Str(Bin)

DimI,Str

ForI=1toLenB(Bin)

clow=MidB(Bin,I,1)

ifASCB(clow)<128then

Str=Str&(ASCB(clow))

else

I=I+1

ifI<=LenB(Bin)thenStr=Str&(ASCW(MidB(Bin,I,1)&clow))

endif

Next

Bin2Str=Str

EndFunction

【exe2swf 工具(Adodb.Stream版)】相关文章:

用vbs实现获取电脑硬件信息的脚本_最新版第1/4页

多进程的vbs脚本

VBScript 中的字节数据操作函数

VBS教程:函数-DateDiff 函数

用vbs删除前一天创建的备份文件

VBScript语法速查及实例说明

VBS教程:函数-UBound 函数

用vbs实现返回 IP 配置数据

VBS教程:函数-Timer 函数

VBS教程:方法-MoveFolder 方法

精品推荐
分类导航