hey there,
every few days-weeks i get pms on the same topic,which is how can a game be well protected.
some are asking on how to avoid decompiling,others on how to avoid thieves using the game on their site.
so it thought it´d be good to have a sticky and sum possible solutions up here.
if you have something to add,please write in the headline if its regarding decompiling or regarding abusage on other websites.
now to get this rolling:
-regarding decompiling:
i won´t name any decompilers as basically which one you use doesn´t matter a lot,most share the same functionality.
generally its always possible to get all your media assets out of your swf file.
on the code side its also always possible to get the code out of an swf file (in one way or the other). some decompilers bring it back in human readable form (the way you see it in the as panel in flash),others return the bytecode which needs a bit more understanding to be able to read it.
there are tools which are meant to help to protect the code of a swf file,they basically obfuscate the code so decompilers crash or can´t read the file.those are normally additions and changes in the code which are ignored by the flash player but not the decompilers,so that they don´t know how to handle those.
those ways of preventing are not ideal though,as once you add such obfuscation,a decompiler developer creates a new version of his app which gets around that crash reason.
better obfuscation is the kind which actually changes all variable and function names so that those don´t make sense to the human reader even if he gets the code.
both of these tool types/tool features are summed up under the common word obfuscator.
most used obfuscators are
aso (
http://www.genable.com/aso/
)
and flashincrypt (
http://www.flashincrypt.com
)
normally you just load a swf in such a tool and it obfuscates the swf in automatically.
there´s also flasm (http://flasm.sourceforge.net/ ) with which you can change the code on byte code level for yourself (which needs some more work though and should only be done once your product is completely finished).
to protect your content against theft,next to using obfuscators i´d suggest splitting your game up into several files
that makes it more painful for thefts to recreate all files.
(and to even understand the structure).
-on abusage of your games on other sites:
one possible solution:
you could load files across servers,meaning you have your game (for example) on server a and some xml files on server b.
if you attempt to load files like xml files from another server,flash will look on the server b if it features a crossdomain.xml which grants server a to load from it. if that isn´t the case,it won´t load on.
-general:
if you want to protect your swfs,that´s a good thing but keep in mind that there´s no 100% protection and therefore you should keep security related data outside of your swf,all we sum up here just makes the life way harder for thieves.
okies,
hope that´s a good start,would be cool if you add something to this so we get a good core base of solutions =)
