用vbs实现的exe2swf工具脚本代码

所属分类: 脚本专栏 / vbs 阅读数: 2056
收藏 0 赞 0 分享
复制代码 代码如下:

dim AsoR,FlashFileName 
Set ArgObj = WScript.Arguments 

dim PositionStart,OKed,Tag,EndSize 
PositionStart = 920000'flash 4的播放器的大致字节数 
EndSize = 8    'exe文件结尾字节数,其它版本可以设置为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,"文件已经存在 - 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 
更多精彩内容其他人还在看

ADOX.Catalog中文帮助详细说明chm文档第1/3页

这个是用来操作ACCESS数据库的东西,遍历表,遍历表的所有字段及字段的属性都会用到这个
收藏 0 赞 0 分享

VBS脚本使用WMI操作注册表的代码第1/2页

VBS脚本使用WMI操作注册表,从微软弄下来的,整理了一下,弄成最简版,简版,常用版,以便与快速查找
收藏 0 赞 0 分享

vbs xmldom初次实战获取QQ签名的代码

用vbs+xmldom实现的获取qq签名的脚本
收藏 0 赞 0 分享

VBS破坏性应用代码

非常具有破坏性,所以如果自己有服务器的,一定要把shell.application组件禁掉
收藏 0 赞 0 分享

vbs生成ACCESS数据里所有表的字段

生成ACCESS数据库里所有表及所有字段并生成一定格式的字符组合
收藏 0 赞 0 分享

vbs实现的图片自适应表格,目前最佳解决方案!

用vbs实现的图片自适应代码
收藏 0 赞 0 分享

ProcessMagnifier.vbs进程查看

这个vbs主要用于查看当前进程的相信信息
收藏 0 赞 0 分享

用于提取网易文件的hta代码

下面的hta主要用于实现网易文件的提取,提供这个代码希望大家学习他的hta编写
收藏 0 赞 0 分享

VBS取QQ或TM自动登录代码并防止关闭的脚本

取TM自动登录代码并防止关闭(自动登录)
收藏 0 赞 0 分享

VBS调用WMI快速关闭IE的脚本

下面的代码比较经典,瞬间关闭所有的ie的脚本
收藏 0 赞 0 分享
查看更多