“Investigating the SWF file format” -or- “What I did in my summer holidays” Deconstructing Flash
Introduction Simon Wistow –Computing BEng Ian Harries –Supervisor Iain Phillips –Second Marker
Flash? A little bit of History –FutureSplash was originally created by FutureWave –FutureWave bought by MacroMedia, FutureSplash renamed “Flash” –Current version is 4. –Flash file format (SWF) was open-sourced in 1998
Flash? Vector animation format –Shapes and Lines –Bitmaps (JPEGs, PNGs) –Sounds (ADPCMs, MP3s) These are known as objects –analogous to actors, scenery and soundtrack
Flash Keeping with the film analogy –SWF format is a script to describe and control the ‘actors’. –Divided into frames –frames divided into tags these define and control objects –34 different tags, using 17 data-types
Flash? Web Oriented –Highly compressed –Plug-in –Pseudo-Streaming
Flash? Scriptable –Control Events, within movie –Reactive not truly dynamic
The idea I needed –A tool for manipulating Flash files –A way of creating Flash files from scratch –Some way of converting between formats Abstract Representation
Why? Can’t create totally dynamic content –prevents uses on database applications Because it’s complicated –it can’t be used within other applications, the facilities don’t exist –You can't do some things with the existing interface Storing SWF binary is not always appropriate
The Competition Macromedia Generator –Limited Modification not creation –Expensive(very) And you still need Flash Authoring tool –Slow –Resource Intensive
The Competition Ming –Enemy of flash –PHP based –Unfinished, only generates
The Competition XML-FLASH –Java Based –Limited to conversion into and out of XML –Unfinished
The Competition Middlesoft SDK –Finished near project end –Limited to C++ on Windows –Complicated –Restrictive Licensing –Creation Only
How File::Binary –Perl module for binary manipulation of files de-compilation/ reverse engineering –Finding errors in the released specification
How creation of abstract Flash library –Object Structure creation of SWF generation library –XS wrapping of libswf
Achievements SWF Parser Flash Object SWF Writer File::Binary
Problems Specification was wrong –Required experimentation Very few knowledgeable people –NDAs –Lack of community Text representation libswf very unstable –Author unavailable
Future Work Text replacement Interface Object with SWF generation library More Input/Output filters –XML –SVG
Design Evaluation Structure is sound Perl was appropriate –good support from user base –hundreds of pre-built libraries –performance issues
Applications Broadband access: richer interfaces Database driven flash websites batch generation library for flash authoring application
Conclusions A lot has been achieved –but things still to do Interest from industry and community Many real-world applications Development will continue