用vbs實(shí)現(xiàn)的exe2swf工具腳本代碼
更新時(shí)間:2008年05月20日 22:16:50 作者:
幾個(gè)超據(jù)學(xué)習(xí)價(jià)值的VBS腳本用法:將exe格式的flash拖放在此vbs文件上,即可生成swf文件
復(fù)制代碼 代碼如下:
dim AsoR,FlashFileName
Set ArgObj = WScript.Arguments
dim PositionStart,OKed,Tag,EndSize
PositionStart = 920000'flash 4的播放器的大致字節(jié)數(shù)
EndSize = 8 'exe文件結(jié)尾字節(jié)數(shù),其它版本可以設(shè)置為0
FlashFileName = ArgObj(0)'傳遞路徑
set AsoR=CreateObject("Adodb.Stream")
AsoR.Mode=3
AsoR.Type=1
AsoR.Open
set AsoW=CreateObject("Adodb.Stream")
AsoW.Mode=3
AsoW.Type=1
AsoW.Open
AsoR.LoadFromFile(FlashFileName)
OKed = true
dim filesize
filesize = AsoR.size
if filesize>PositionStart then
while OKed
AsoR.Position = PositionStart
Tag = Bin2Str(AsoR.read(20))
if instr(Tag,"0000000") >0 then
PositionStart = PositionStart + 1
else
PositionStart = PositionStart + 20
end if
if Tag = "00000000000000000708783" or Tag = "00000000000000000678783" then
OKed = false
end if
'if PositionStart > filesize then
' OKed = false
'end if
wend
else
msgbox "文件錯(cuò)誤"
end if
PositionStart = PositionStart + 16
'msgbox PositionStart
AsoR.Position = PositionStart
AsoW.write AsoR.read(filesize-int(PositionStart)-int(EndSize))
'新文件名
dim newFileName
'newFileName = left(FlashFileName,len(FlashFileName)-4) & ".swf"
newFileName = FlashFileName & ".swf"
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(newFileName)) Then
overwrite = msgbox(newFileName&" 已存在"& vbnewline &"要替換它嗎?",308,"文件已經(jīng)存在 - exe2swf腳本")
if overwrite=6 then
AsoW.SaveToFile newFileName, 2
else
msgbox "操作被取消",0,"exe2swf腳本"
end if
else
AsoW.SaveToFile newFileName, 1
end if
AsoR.close
set AsoR=nothing
AsoW.close
set AsoW=nothing
Function Bin2Str(Bin)
Dim I, Str
For I=1 to LenB(Bin)
clow=MidB(Bin,I,1)
if ASCB(clow)<128 then
Str = Str & (ASCB(clow))
else
I=I+1
if I <= LenB(Bin) then Str = Str & (ASCW(MidB(Bin,I,1)&clow))
end if
Next
Bin2Str = Str
End Function
相關(guān)文章
bookfind 通過ISBN序號(hào)獲取圖書連接的書名與作者的vbs代碼
bookfind 通過ISBN序號(hào)獲取圖書連接的書名與作者的vbs代碼,類似小偷程序,通過正則匹配,雖然現(xiàn)在已經(jīng)無法使用,但代碼不錯(cuò),原理都有2011-12-12
reg2vbs.vbs 將Reg文件轉(zhuǎn)換為VBS文件保存 腳本之家修正版本
可以將Reg文件轉(zhuǎn)換為VBS文件保存的代碼,網(wǎng)上的好多都有問題,本地特給修正了一下,有問題,請(qǐng)回復(fù)。2009-05-05
在vbscript中判斷COM類是否存在的實(shí)現(xiàn)代碼
在VBS中,我們有時(shí)需要判斷一個(gè)COM類是否存在,以便執(zhí)行不同的操作,需要的朋友可以參考下2018-06-06
VBS教程:函數(shù)-IsObject 函數(shù)
VBS教程:函數(shù)-IsObject 函數(shù)...2006-11-11
使用 Iisftp.vbs 創(chuàng)建FTP站點(diǎn)的方法
Iisftp.vbs 使用的默認(rèn)屬性與 IIS 管理器在建立新的 FTP 站點(diǎn)時(shí)使用的屬性相同,并且它遵循相同的繼承屬性規(guī)則。要配置 FTP 站點(diǎn)的更多高級(jí)屬性,請(qǐng)使用 IIS 管理器2014-07-07
將WMI中的DateTime類型轉(zhuǎn)換成VBS時(shí)間的函數(shù)代碼
WMI中的DateTime數(shù)據(jù)類型保存的時(shí)間格式是UTC,與VBS中的時(shí)間類型不同。2011-02-02

