ActionScript Protect .swf/.swc Files From Decompilation? - apache-flex

it is possible to protect a .swf file from decompilation?
i've been reading about compiling class libraries in a .swc file for distribution without revealing the code - possibly selling it. however, there are .swf decompilers you can use to expose the code, and a .swc file is simply a .zip archive, so changing myswc.swc to myswc.zip will reveal the .swf files of the library.
just curious, mostly.

You can't. Don't believe those swf protector/encryptors. Both the content of a swf and a swc need to be readable by the AVM2 so it can't be compressed or encrypted or anything. Bottom line is that you can't really protect your as3 code from being reverse engineered.

I am flash game developer i use Flash Secure Optimizer from http://www.eramsoft.com

Related

Flex swf file taking time to load at client side

In my project we have swf file that is 4 mb in size. When we open the application in browser it is taking 3-5 seconds to load the swf file at client side. Is there any way to compress the swf file and send so that it will take less time? Or is there any other options to minimise the load time?
Thanks
Sachin
By default swf files are already compressed when compiled. Try zipping an swf file for example it will hardly change in size.
If you find a compression method to do decrease the size of the swf and this compression method is supported by flash, you can compress the swf file for download and decompress it at runtime and then load it.
Read "Reducing SWF file sizes"
Use the bytecode optimizer
Disable debugging
Use strict mode
Avoid initializing unused classes
Externalize assets
Use character ranges for embedded fonts
Read "Reducing module size"
Change the application that a module is optimized for in Flash Builder
Create and use a linker report with the command-line compiler
Modularize your module
Compress your assets (higher jpg compression, lower color depth, etc)

Does Flash Builder 4.6 create LZMA compressed SWFs?

Does Flash Builder 4.6 create LZMA compressed SWFs and also are the RSL framework LZMA compressed?
No. Falcon may add support for this. There are supposed to be programs out there that can compress the file after the fact. Though I don't know what those are.
The entire SWF file is not compressed, though elements within the file - images, ActionScript bytecode, sounds etc - are individually compressed in blocks (I believe zlib is used). This is important for the flash player to be able to decompress parts of the swf as it loads, in order to get it playing quickly.
Usually you won't get a lot of extra compression by compressing the entire SWF file, since most of the data inside is already compressed.

Drupal 6 Using SWF Tools to display an .swf files

I'm trying to display an .swf file (with an accompanying .flv file) using SWF Tools, which I understand is possible.
So far, I have:
Created the field "video".
Enabled the SWF Tools module (version 6.25).
At this point, I'm really stuck. I created a block in Views, but it only displays an anchor link to the .swf file. I've read "Installing SWF Tools" (http://drupal.org/node/303203) but don't really understand it.
I'm hoping for some simple directions so I can get this finished and move on.
You need to enable the swf tools filter for your input format.

Optimize loading an XAP file with an asp.net website

I've been developing a game using Silverlight 4 and silversprite (http://silversprite.codeplex.com/)
This game is HEAVILY content dependent, using a lot of audio and images. My content folder is around 90 mbs worth of stuff.
And because of that, my XAP file is around 60 MB, and takes 5 minutes to download from the website before any user can start playing.
I am using Visual Web Developer 2010 to create my site and load the XAP. Is there a way where I can take content out of my XAP and put it in my ASP.net site project? Or perhaps upload my content files to the site's storage?
This would make my XAP file much quicker to download.
Anyone have suggestions?
Thanks!
Yes, include in your XAP only content you need for the initial screen. Place other content you need in other XAPs (if you need to and understand the manifest xml) or just plain zip files would do. Perhaps a Zip for each "Level" or whatever.
You can download the Zip with WebClient and then use StreamResourceInfo and Application.GetResourceStream to access content in the zip file.
This blog although aging a little now still carries the basic idea and is still fundementally the current technique to use.
Absolutley its called Application Library Caching. Ive used it very successfully its now a standard operating procedure, particularly nice is its application with resource assemblies.
straight from msdn ...
Resource files are typically any non-executable data file used by your application, such as image, audio, and video files. A resource file can also have specific meanings in certain contexts. For example, in the context of application localization, resource files refer to .resx files, which you can deploy in localized satellite assemblies.
it continues with some really useful info
With Silverlight, you can deploy
resource files in the following ways:
•As individual files in the
application package.
•As individual files that you retrieve
on demand.
•As files embedded in an assembly in
the application package.
•As files embedded in an assembly in
an external library package.
•As files embedded in an assembly that
you retrieve on demand.
which is what is suggested in the other answer(s)

Why does Adobe Flex strip ActionScript from Flash embed symbols when compiling?

I wanted an animation to dispatch custom events as it cycled. It became apparent that not even trace() was running. After some searching, I found the following at Adobe:
http://livedocs.adobe.com/flex/3/html/help.html?content=embed_4.html
"If the SWF file contains any ActionScript code, Flex prints a warning during compilation and then strips out the ActionScript from the embed symbol. This means that you can only embed the symbol itself."
I also found a work-around by Grant Skinner at:
http://gskinner.com/blog/archives/2007/03/using_flash_sym.html
So, I can proceed, but I'm still wondering. Why does mxmlc strip ActionScript from Flash compiled resources when embedding their symbols into Flex apps using metatags?
Sorry for the very late response, but since I wrote that code, I can answer. :-)
Basically, there are two answers.
For old SWF assets that contain AS2 bytecode, it was far too much work to try to convert the bytecode to AS3. I'm assuming this isn't theuse case you care about anyway.
For SWF assets linked to AS3 bytecode, the basic problem is that there is no dependency information any more, so when we clone the asset, we have no idea what else we would need to pull. Because Flash can export a SWC, I decided that this was a far more robust workflow for getting assets with code from Flash to Flex. (Take a peek inside a SWC file, and you'll see an XML file that describes the dependencies used by the linker.)
It's probably a performance issue. To load a swf resource without stripping it, load it dynamically using SWFLoader or Loader instead of embedding it.

Resources