SWF file structure
Following the header is a series of tagged data blocks. All tags share a common format, so any
program parsing a SWF file can skip over blocks it does not understand. Data inside the block
can point to offsets within the block, but can never point to an offset in another block. This
ability enables tags to be removed, inserted, or modified by tools that process a SWF file.
The FileAttributes tag is only required for SWF 8 and later.
SWF文件结构
下面的文件头是标签的一系列数据块。所有的标签都有一个共同的格式,所以任何程序在分析一个SWF文件时都可以跳过不解析此数据块。数据块内可以指向这个块中的偏移量,但绝不能指向另外一个块的偏移量。这能够使标签被删除,插入,或用工具处理SWF文件的修改。
该文件属性标签仅支持SWF8或更高版本。
Tag format
Each tag begins with a tag type and a length. The tag-header formats can be either short or
long. Short tag headers are used for tags with 62 bytes of data or less. Long tag headers, with a
signed 32-bit length field, can be used for any tag size up to 2GB, far larger than is presently
practical.
标签格式
每个标签以一个标签类型和长度开始。标签头格式可长可短。短标签头用在标签上的数据不超过62byte。长标签头用32bit标识长度域,可用任何标签尺寸到2GB,远远大于现在实际使用。
TagCodeAndLength UI16 Upper 10 bits: tag type
Lower 6 bits: tag length(高10位是标签类型,低6位是标签长度)
NOTE
The TagCodeAndLength field is a two-byte word, not a bit field of 10 bits followed by a
bit field of 6 bits. The little-endian byte ordering of a SWF file makes these two layouts
different.
注意
TagCodeAndLength域是双字节的字,不是一个10位域后跟一个6位域。这个SWF文件的little-endian字节顺序使这2种布局不同。
The length specified in the TagCodeAndLength field does not include the RECORDHEADER that starts a tag.
If the tag is 63 bytes or longer, it is stored in a long tag header. The long tag header consists of
a short tag header with a length of 0x3f, followed by a 32-bit length.
在TagCodeAndLength域中长度是指不包括标签起始RECORDHEADER。如果这个标签是63byte或更长,它存在一个长标签头里。长标签头由一个短标签头和一个0x3f长度,跟着一个32位的长度。
TagCodeAndLength (UI16 Tag type and length of 0x3F)+ Length SI32 Length of tag
Following the header is a series of tagged data blocks. All tags share a common format, so any
program parsing a SWF file can skip over blocks it does not understand. Data inside the block
can point to offsets within the block, but can never point to an offset in another block. This
ability enables tags to be removed, inserted, or modified by tools that process a SWF file.
The FileAttributes tag is only required for SWF 8 and later.
SWF文件结构
下面的文件头是标签的一系列数据块。所有的标签都有一个共同的格式,所以任何程序在分析一个SWF文件时都可以跳过不解析此数据块。数据块内可以指向这个块中的偏移量,但绝不能指向另外一个块的偏移量。这能够使标签被删除,插入,或用工具处理SWF文件的修改。
该文件属性标签仅支持SWF8或更高版本。
Tag format
Each tag begins with a tag type and a length. The tag-header formats can be either short or
long. Short tag headers are used for tags with 62 bytes of data or less. Long tag headers, with a
signed 32-bit length field, can be used for any tag size up to 2GB, far larger than is presently
practical.
标签格式
每个标签以一个标签类型和长度开始。标签头格式可长可短。短标签头用在标签上的数据不超过62byte。长标签头用32bit标识长度域,可用任何标签尺寸到2GB,远远大于现在实际使用。
TagCodeAndLength UI16 Upper 10 bits: tag type
Lower 6 bits: tag length(高10位是标签类型,低6位是标签长度)
NOTE
The TagCodeAndLength field is a two-byte word, not a bit field of 10 bits followed by a
bit field of 6 bits. The little-endian byte ordering of a SWF file makes these two layouts
different.
注意
TagCodeAndLength域是双字节的字,不是一个10位域后跟一个6位域。这个SWF文件的little-endian字节顺序使这2种布局不同。
The length specified in the TagCodeAndLength field does not include the RECORDHEADER that starts a tag.
If the tag is 63 bytes or longer, it is stored in a long tag header. The long tag header consists of
a short tag header with a length of 0x3f, followed by a 32-bit length.
在TagCodeAndLength域中长度是指不包括标签起始RECORDHEADER。如果这个标签是63byte或更长,它存在一个长标签头里。长标签头由一个短标签头和一个0x3f长度,跟着一个32位的长度。
TagCodeAndLength (UI16 Tag type and length of 0x3F)+ Length SI32 Length of tag