SWF File Structure

SWF version files are binary files with different types of elements concatenated together in the order shown below:
Header
FileAttributes tag
Definition tag or Control tag
Definition tag or Control tag
Definition tag or Control tag
... 
End tag
Short descriptions of SWF file elements are:
  • Header - The first element in a SWF file that contains the SWF signature, version, and other overall information.
  • FileAttributes tag - The second element in a SWF file that defines characteristics of the SWF file. FileAttributes tag is required for SWF version 8 and later versions and optional for earlier versions.
  • Definition tag - An element in a SWF file that defines one data character like a shape, a text, a bitmap, a sound, etc.
  • Control tag - An element in a SWF file that performs an action on defined data characters and changes execution flow.
  • End tag - The last element in a SWF file that ends the SWF file.

MAGIC NUMBER

Magic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.
For example, a jpeg file starts with ffd8 ffe0 0010 4a46 4946 0001 0101 0047 ......JFIF.....G
ffd8 shows that it's a JPEG file, and ffe0 identify a JFIF type structure. There is an ascii encoding of "JFIF" which comes after a length code, but that is not necessary in order to identify the file. The first 4 bytes do that uniquely.

Unallocated Space

computer operating systems, such as Windows, allocate space on the hard drive as adjacent groups of sectors, known as allocation units, or clusters. When you create a new file, the operating system finds available space and allocates that space to the file. Unallocated space is space that is not allocated to active files within a file system.

The type of object that you can create in unallocated space depends on whether your hard disk is a basic disk, containing primary partitions, extended partitions and logical drives, or a dynamic disk, containing volumes that span multiple disks. In the case of a basic hard disk, you can use unallocated space outside an existing partition, or logical storage unit, to create a primary partition -- typically, the partition used to start the operating system -- or an extended partition. Similarly, you can use unallocated space inside an existing partition to create logical drives, or parts of the same physical disk that are managed as independent units.

SLACK SPACE

What is Slack Space?

Slack space is an area between the end of a file and end of the last cluster or sector used by the file in question. Area is an area that will not be used again to store the information there, so the area is "wasted" useless. Slack space is common in file systems that use a large cluster size, while the file system that uses a small cluster size can organize the storage media more effectively and efficiently. Amount of wasted disk space can be thought is estimated by multiplying the number of files (including the number of directories) with half the size of a cluster. For example, a 10 000 personal computer that stores files in a file system that uses a cluster size of 4 kilobytes will have approximately 10 000 x 2 MB ~ = 20000 KB. On a large file server, slack space and even reached the size of tens of gigabytes.