SWF Tag (swf_tag, swf_long_tag)

SWF Structure Info
Tag Flash Version: 
1
SWF Structure: 
struct swf_tag {
	unsigned short		f_tag_and_size;
	f_tag = f_tag_and_size >> 6;
	f_tag_data_size = f_tag_and_size & 0x3F;
	if(f_tag_data_size == 63) {
		unsigned long	f_tag_data_real_size;
	}
	else {
		f_tag_data_real_size = f_tag_data_size;
	}
};

struct swf_long_tag { /* i.e. the last 6 bits of f_tag_and_size = 0x3F */
	unsigned short		f_tag_and_size;
	f_tag = f_tag_and_size >> 6;
	unsigned long	f_tag_data_real_size;
};

The tag and size are saved in a 16 bits little endian unsigned integer. The tag is always aligned to a byte (not a bit). The size is defined in the lower 6 bits. And the short value is in a little endian format as expected by the declaration. If the size is 63 (0x3F), then another 4 bytes are read for the size. This is used for really large tags such as fonts with many characters, audio, video, or images.

WARNING: The following tags only support the long format (i.e. f_tag_and_size & 0x3F == 0x3F even if the size is less than 63.) These are: