{"id":2582,"date":"2009-10-12T14:44:53","date_gmt":"2009-10-12T20:44:53","guid":{"rendered":"http:\/\/www.josuepalma.com\/blog\/?p=2582"},"modified":"2009-10-12T14:45:41","modified_gmt":"2009-10-12T20:45:41","slug":"as3-otra-forma-de-esconder-tu-codigo-de-decompilers","status":"publish","type":"post","link":"https:\/\/www.josuepalma.com\/blog\/as3-otra-forma-de-esconder-tu-codigo-de-decompilers\/","title":{"rendered":"Otra forma de esconder tu codigo AS3 de decompilers&#8230;"},"content":{"rendered":"<pre name=\"code\" class=\"javascript\">\r\npackage \r\n{\r\n\timport flash.display.Loader;\r\n\timport flash.display.Sprite;\r\n \r\n\tpublic class MainShell extends Sprite \r\n\t{\t\t\r\n\t\t[Embed(source=\"ActualSWF.swf\",\r\n                           mimeType=\"application\/octet-stream\")]\r\n\t\tprivate static const bytes:Class;\r\n \r\n\t\tpublic function MainShell()\r\n\t\t{\r\n\t\tLoader(addChild(new Loader())).loadBytes(new bytes());\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<blockquote><p>Instead of embedding the SWF directly, you could run it through some encryption and embed the encrypted SWF \u2013 it is mime type \u201capplication\/octet-stream\u201d, so you can really embed any binary file (even invalid file types). Subsequently, the \u201cshell\u201d SWF will decrypt the ByteArray before feeding it to the loadBytes() method of the Loader instance.<\/p><\/blockquote>\n<p><a href=\"http:\/\/www.ghostwire.com\/blog\/archives\/as3-hiding-assets-and-code-by-embedding-swf-within-another-swf\/\">http:\/\/www.ghostwire.com\/blog\/archives\/as3-hiding-assets-and-code-by-embedding-swf-within-another-swf\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>package { import flash.display.Loader; import flash.display.Sprite; public class MainShell extends Sprite { [Embed(source=&#8221;ActualSWF.swf&#8221;, mimeType=&#8221;application\/octet-stream&#8221;)] private static const bytes:Class; public function MainShell() { Loader(addChild(new Loader())).loadBytes(new bytes());\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-2582","post","type-post","status-publish","format-standard","hentry","category-desarrollo"],"_links":{"self":[{"href":"https:\/\/www.josuepalma.com\/blog\/wp-json\/wp\/v2\/posts\/2582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.josuepalma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.josuepalma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.josuepalma.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.josuepalma.com\/blog\/wp-json\/wp\/v2\/comments?post=2582"}],"version-history":[{"count":8,"href":"https:\/\/www.josuepalma.com\/blog\/wp-json\/wp\/v2\/posts\/2582\/revisions"}],"predecessor-version":[{"id":2590,"href":"https:\/\/www.josuepalma.com\/blog\/wp-json\/wp\/v2\/posts\/2582\/revisions\/2590"}],"wp:attachment":[{"href":"https:\/\/www.josuepalma.com\/blog\/wp-json\/wp\/v2\/media?parent=2582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.josuepalma.com\/blog\/wp-json\/wp\/v2\/categories?post=2582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.josuepalma.com\/blog\/wp-json\/wp\/v2\/tags?post=2582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}