Hi, I might be wrong but like Bart said, I think SWFEncrypt does all this already. At least I haven't had any problems with this andits fast too AND usable from a build file. But I'm sure some of you will be able to crack it.
What I do have problems with is the attitude displayed towards Jimbo by some of the responders for trying to come up with a nice and easy solution, even it isn't foolproof. Putting a donkey sign over someones head is less than motivating. He offered us a challenge, some of us took it and won. No need to get all nasty about it imo. greetz JC On 7/18/07, Costello, Rob R <[EMAIL PROTECTED]> wrote:
> 2006/5/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Is there any good way or method for obfuscation a Flash file so that > swf works fine after obfuscation and also prevent any one to > understand the code easily . Few common softwares for obfuscation are > just not that good as swf stops working after using them . Of if not > obfuscation is there any other method to prevent swf to be decompiled > to fla . help will be really appreciate . > > Thx > > Max My understanding is that encryption is unreliable - since the player has to be able to decrypt it anyway, and the swf format is known - so any trick that fools the decompiler is vulnerable to being corrected in the next release of the decompiler I've written a home grown obfuscator of sorts (for AS2). It's a bit slow and clunky - and not AS3 compatible - but does what I need. (It can parse AS2 source code for variable and functions names using VB, and then obfuscate the byte code using FLASM.) > Few common softwares for obfuscation are just not that good as swf stops working after using them . depending on coding style, you need to avoid changing names of variables that correspond to other constants (eg names of nodes in an XML file that are matched in your code - won't match if you rename the coded version) Also array syntax (AS2) that does things like ["prop" + x] - don't want to rename prop0, prop1 etc elsewhere So you typically need some sort of exclusion list. I don't know that you can ask the software to reliably work out which variables must be excluded in some of these contexts. (In some cases I could observe if functionality was impaired and look in that region of code for array syntax etc.) I had a look at ASO lite a while ago and at the time it took the approach of not renaming any functions or classes - just simple variables, and it also allows a custom exclusion list. I was naïve enough to try my own (using Flasm and VB) that also did function names etc. The current ASO version now seems to rename functions and class names etc (still allowing a custom exclusion list). Its pretty fast - but I've had your issue - my code stops working and I can't work out which additional variables to exclude. For example it seemed to kill the V2 mx components - and it was finding thousands of variables from those components. It seemed to me that I only wanted to obfuscate my own code (eg I don't mind if people decompile the mx components etc). So I revisited the one I'd tinkered with. Its slow - uses VBA and Flasm. (I tested it as compiled VB6 and almost identical speed. VBA allows me to use Excel for data storage. I now get it to parse my AS2 files first and locate all of the variables and functions names I have introduced. (I don't get it to scan the mx source files so it will leave them in swf). I do have a list of excluded native functions - onRollOver etc. Anyway, then VBA uses FLASM to search for those variables in the byte code (flm file). (not all of them make it into the byte code) Then, when there is a common list (my variables / functions / class names that do appear in the swf - it does text a text / replace with an "illegal" name - eg an integer - which works at byte code level, but not if decompiled). This is all horribly slow (10 minutes - for say 75 classes - 400 k of AS2 files - 200 k of swf - 2 MB flm file - on slowish machine) Not sure it would qualify as a "good solution" for other contexts But it does work well for my AS2 based development and I have full control over obfuscation and I know it works. I don't know what method ASO uses though I saw on the Flasm website that one of ASO's people helped them optimise Flasm - so maybe a similar (more optimised) approach. Was too aggressive for me though - couldn't get it to work. Any interest in this? Cheers Rob Important - This email and any attachments may be confidential. If received in error, please contact us and delete all copies. Before opening or using attachments check them for viruses and defects. Regardless of any loss, damage or consequence, whether caused by the negligence of the sender or not, resulting directly or indirectly from the use of any attached files our liability is limited to resupplying any affected attachments. Any representations or opinions expressed are those of the individual sender, and not necessarily those of the Department of Education. _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com