views:

307

answers:

2

How can you know that an swf was written using flash or flex? and is there a way to compile back to flex?

I know sothink's for flash, but any thing for flex?

+1  A: 

A Flex app is fundamentally a Flash SWF - the only difference is that the flex compiler generates a lot of intermediate code (that you can see if you use -keep compiler option) and converts that code (instead of your mxml code) to SWF.

So I guess when you decompile a flex application with whatever tool you use to decompile a flash SWF, you will get only this generated code (and not your mxml) - which may or may not be helpful - it depends on your requirement.

Just googled to find that Sothink SWF Decompiler V5.2 supports SWF to Flex

Amarghosh
A: 

Sothink SWF Decompiler and Eltima FlashDecompiler both reportedly support Flex decompilation. I have used Sothink's solution a few times to help in security audits and hand optimizing the byte code and when decompiled the result was about what you can expect out of any flash decompiler.

Exporting to flex provides a flex project that can not usually be recompiled without hand editing your files. However much of the original project does stay relatively close to the source (stripped variable names, multi stage variable assignment, etc.) and is nothing you can't fix if you're familiar with the source code. Which I assume you are, unless of course you're sneaking peeks at others livelihoods.

With that being said, for those of you who are unaware of flash security issues or have an interest in protecting your assets, Prajakta Jagdale at HP recently did a talk on flash decompilation at ShmooCon this year that is rather engaging. The video is available online if you're interested, but I'll leave finding that one as an exercise for the reader.

godel
http://www.adobe.com/devnet/flashplayer/articles/swfscan.html in case you're interested.
Michael Todd