SWF-flash files unpacking

SWF unpacking

There are many commercial soft to extract resources (images and sounds etc) from flash SWF files. There is also a free crossplatform console toolset for compile and decompile SWF: swftools.

In particular, this package includes tools swfextract и swfdump to extract resources from the SWF and decompilation SWF files with getting list of elements with dumps. The disadvantage of these tools is that the first one can't automatically extract all resources from a file and the second can't store hex-dumps to binary files.

To get rid of these disadvantages I wrote a python-script that:

  1. gets a list of all resources for specified swf-file using swfextract
  2. extracts all files for all resources in this list (using swfextract too)
  3. extracts all resources (jpg and mp3 files) from these files using swfdump

All these operations are performed in a single step and as a result from the source SWF produce large amounts of resource files. And some of these files may be duplicates. To remove duplicates, you can use utility such this.


For Linux:

swf-extract.py <filename.swf> [<outdir>]

For Windows:

python swf-extract.py <filename.swf> [<outdir>]

First argument filename.swf defines name of unpacking swf-file, second argument outdir is optional and defines output path for extracted resources, If is isn't specified, the extracted files will be stored to the same directory with source swf-file.

You can download this script by the link bellow.
swftools lives here.
And python - here.


No votes yet