Blog

SWF Trivia

Friday, September 3rd, 2010 | Blog, Notes | No Comments

While working on my own SWF decompiler (Flashbug 1.7) I’ve learned a lot of interesting things about SWFs that I wanted to jot down.

1. PNGs can be compressed : When embedding PNG images into a SWF you have the option of compressing them. This actually converts them to a JPEG with an alpha channel. It’s non-standard but definitely a neat trick. This almost negates any reason why you shouldn’t always embed a PNG into your FLA.

2. Text character codes aren’t embedded : When you have any text fields in your SWF, the character codes aren’t embedded into the SWF. Instead it embeds the glyph codes for the specific font used. It then checks the font to match the glyph code to a character code. I suppose this helps ensure your text is displayed correctly.

3. Streamed sounds are combined into one sound : In timeline animation, you may embed 1 or more sounds into the timeline to be streamed. What actually happens is that all the sounds in a given timeline are combined into a single blob of sound data. Then that data is split over each frame, this insures that it’s synced to the frame animation. Which explains why when you decompile a SWF you can’t really extract streamed sounds.

4. SWF Encrypters are pretty useless : I’ve only tested a few, but they really don’t do much. Each SWF is composed of a series of tags. Each tag contains a specific kind of data. So there are for instance shape tags, and image tags, etc. Well there is also an End tag, which means you’ve gotten to the End of the SWF. Well one of the encrypters just puts a fake End tag at the beginning for decompilers to get tripped up on. It’s pretty easy to avoid and most decompilers skip over it. Others try to add custom tags to hide data. But again, most of these work to hide the ActionScript. All of the media is still easily extracted as shown by Flashbug.

Flashbug 1.7 now in Mozilla Beta channel

Friday, September 3rd, 2010 | Blog | No Comments

Flashbug 1.7 has turned into a major update and I hope you guys find it as useful as I think it will be. First off among the changes are quite a few bug fixes. This fixes Ubuntu support and some mm.cfg bugs that have cropped up since Flash 10.1. One of the changes in Flash Player 10.1 was that instead of targeting ‘C:\Documents and Settings\username\mm.cfg’ (a hard coded path) it now uses the global variables ‘%HOMEDRIVE%%HOMEPATH%\mm.cfg’ path (which can change). There is now a checkbox in the preferences to use either path if you run into problems.

Since prior versions of Flashbug have supported Firefox 2 and Firebug 1.05 I decided it was a good time to start fresh and cut away from the legacy code. Flashbug 1.7 now targets Firefox 4 and Firebug 1.6. While it might work with Firebug 1.5 or Firefox 3.6 it might not be perfect nor will I make any attempt to fix those issues.

With that out of the away here are some of the new features to look forward to (and test if you want).

The AMF tab now uses web workers and is asynchronous. Another feature is that you can now export your AMF data from the AMF tabs. .minerva has also been updated in 3.2.4 to read these exported AMF files. I’ve also gone ahead and split the AMF into a response and post tabs much like the HTTP data is.

The Shared Object panel has also been broken off into it’s own panel. This way you can enable or disable each part of Flashbug to use only the features you want. Also like the AMF tab, the Shared Object panel uses web workers. At the request of ksumitus a clear all button has been added. This will delete all SOL files detected for a specific page.

Finally, the crown jewel of 1.7 is the new SWF tab. I’ve always wanted to be able to inspect a SWF just as easily as you can with HTML and Firebug. Now you can, with Flashbug 1.7. It has a pretty robust decompiler (does not handle ActionScript right now) that allows you to export and view all the assets embedded in a SWF. This includes videos, fonts, text, even shapes (exported as SVG)! You can also view all the metadata for each swf, when it was published and a lot of fun information. So please give it a whirl and let me know if you find any bugs.

Blog Hacked!

Monday, July 19th, 2010 | Blog | No Comments

Sorry for those of you that visited the site and got some nasty errors or spam. Apparently it was a fairly large scale attack on WordPress blogs in general and mine just happened to get hit. I’ve removed all of the malicious code. But from what I’ve learned it wasn’t really anything I could have prevented.

http://weblog.mediatemple.net/weblog/category/system-incidents/1378-information-about-compromised-sites/

Flashbug 1.7 feature requests

Friday, July 16th, 2010 | Blog | 5 Comments

I’ve been hard at work building Flashbug 1.7. It’s targeting Firefox 3.6+ and the latest Firebug so I get to remove a lot of legacy code and add some neat features. While a lot of the code is different and completely re-organized it’ll look almost the same except for a few new features. I’ve added a SWF info tab that will tell you the metadata (version, size, color, etc) of any swf. You can also export AMF data from remoting. Are there any other features that you would like to see in a Flash developer extension? Hit me up in the comments or add an official request to the issue tracker http://code.google.com/p/flashbug/issues/list

Flash / HTML Comparison

Friday, June 18th, 2010 | Blog | 2 Comments

This comparison is very similar to the Flash/Canvas comparison with a minor change. The first Flash demo utilizes BitmapData to render the particles. Much like Canvas renders directly to a bitmap array. But I wanted to compare the speed versus HTML (animating with elements) and a Bitmap demo isn’t a fair comparison. So I have a second Flash demo that animated with Sprites. As with the previous demos, the particles are 1x1px white boxes to keep the look the same.

Another small change in these demos is that they increment by 10s instead of 100s. This is because it’s much more intensive to animate a sprite over a single pixel that really only exists when it’s finally drawn on the bitmap.

Also in an effort to let you see what the you can do with each, I’ve added controls to manipulate the minimum FPS. This will affect when the demos actually begin to throttle back.

Browser Particles Particles Added Per Render
HTML – Firefox 3.6.4 400 20
HTML – Chrome 6.0.437.1 800 30
HTML – Opera 10.60 Beta 800 30
Flash 10.0.45.2 6,000 220
Flash 10.0.45.2 Debugger 5,000 180
Flash 10.1.53.64 7,500 270
Flash 10.1.53.64 Debugger 6,500 230

* All results tested with a minimum FPS of 29

HTML Particle Speed Test

Flash (Sprite) Particle Speed Test

Search