swf文件的大致结构介绍(参考Macromedia Flash File Format (SWF))
.swf文件是一类二进制文件,文件本身包括header和tags。
1.Header包括了六个部分:
Header 总是以一个三个字节的Signature开始0x46, 0x57, 0x53 (“FWS”),紧跟其后的是一个Version numbe(如0x04)。接下来是FileLength(描述包括Head在内的整个文件大小以byte为单位)自身有四个字节,FrameSize(描述flash主框架大小)是一个RECT结构体(9字节). The FrameRate(两个字节) is the desired playback rate in frames per second. The FrameCount (两个字节)is the total number of frames in this SWF movie.
2.Tags Fomat
Each tag begins with a tag type and a length.
a. short tags 2个字节,前10位表示tagID,后六位表示length(tagID=code>>6;length=code&0x3f),如果blocks<62用short tags
b. long tags 6个字节,前两个字节存储tagIFD,后4个字节表示length。如果bloks>63用long tags。