title: what happens to a swf when its embedded?
body: <p>I have some AS3 code that embeds a SWF (which itself contains AS3):</p>
  
  <pre><code>[Embed(source="/assets/myas3libswf.swf", mimeType="application/octet-stream")]
  protected static const MyAs3LibSwfClass : Class;  
  ...
  var loader:Loader= new Loader();
  loader.loadBytes(new MySwfClass() as ByteArray);
  ...
  </code></pre>
  
  <p>In looking at how flash decompilers (Trillix, So-Think, etc) see this, they just show:</p>
  
  <pre><code>//MyClass_MyAs3LibSwfClass
  package mypackage 
  {
      import mx.core.*;
  
      public class MyClass_MyAs3LibSwfClass extends mx.core.ByteArrayAsset
      {
          public function MyClass_MyAs3LibSwfClass()
          {
              super();
              return;
          }
      }
  }
  </code></pre>
  
  <p>They also don't seem to offer any way to extract the ByteArray.</p>
  
  <p>Surely it can't be that easy to obfuscate AS3 code.  But where did the SWF go?  Looking at it with a hex editor, I can't even find the start header ("CWS") of the embedded SWF.</p>
  
  <p>My question is: what happens to a SWF when its embedded as a ByteArray?  And do any decompilers support extracting an embedded ByteArray?</p>
  
  <p>Note: I'm not embedding this SWF in order to obfuscate (there are other reasons). I'm just interested in the decompilation ramifications of embedding.</p>