SWFUtils is a collection of ActionScript 3 classes for reading SWF files. With SWFUtils you can parse swf files, and read all its tags. Dump actions for AVM1 (ActionAcript1/2) and AVM (ActionAcript3 ABC code). DoABC parsing module is based on code from Tamarin project (utils/abcdump.as).
SWFUtils works with Flash CS3 / Flex / AIR. It uses ByteArray
for reading swf files. In AIR (Desktop), to decrease memory usage, you
can work with FileStream classes instead.
What can You do with SWFUtils
- read compressed and uncompressed swf files
- read swf file basic informations (eq. framerate, document dimesions etc.)
- read all tags defining swf movie
You get an array of al tags so you can read any information you are intrested in - read all exported classes (ActionScript 3 only).
This informations can be later used in applicationDomain.getDefinition('...').
So You can create instances of exported classes without knowing what is exported. - get any information about classes present in file (ActionScript 3 only) (inharitance, implemented interfaces, methods, properies)
- extract information from DoABC blocks (compiled as3
code).
This provides detailed information about exported classes. - decompile ActionScript 1/2 action based code
- decompile DoABC (ActionScript 3) code
- export shapes (vector content) from swf files (under developement)
- decompile (so called) encrypted swf files
creating micoro-vm for as2 code and porting c++ code from swfdb decrypter to AS3
(under developement)
SVN
24.IV.08 : Code preview is now available for download in our repository
svn checkout http://svn.segfaultlabs.com/swfutils local_dir/
Code isn't yet documented but will be, if only I find enough time.
Examples
example I
This is example of using SWFUtils to get information about swf file
content. If loaded SWF file contains as3 code You can dump abc data.
Online flex example is available here. Right click to see source code for this
example.
Dumping ABC code can cause script running long, and Your browser can die!
You can also download this
example.
Recommended literature
- SWF and FLV File Format Specification - Version 9
- ActionScript Virtual Machine 2 (AVM2) Overview
- Tamarin project source code
Contact with author
mateusz@malczak.info