国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

用vbs實現(xiàn)的exe2swf工具腳本代碼

2020-07-26 11:58:24
字體:
供稿:網(wǎng)友
復制代碼 代碼如下:

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 "文件錯誤" 
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 
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 霞浦县| 元朗区| 兰坪| 许昌县| 富民县| 汉阴县| 松溪县| 凌海市| 荣成市| 宿松县| 彭泽县| 宁河县| 龙口市| 嘉祥县| 旬邑县| 五家渠市| 东城区| 亳州市| 隆化县| 许昌市| 敦煌市| 二手房| 社会| 三门峡市| 巨鹿县| 秦安县| 鄂托克前旗| 五家渠市| 棋牌| 黑山县| 泾源县| 拉萨市| 民勤县| 张家界市| 南召县| 荆州市| 仁寿县| 长春市| 紫云| 奇台县| 汉沽区|