Reverse Loom?

2 views
Skip to first unread message

James Ward

unread,
Sep 9, 2009, 7:17:00 PM9/9/09
to loom-as3
Hi all,

Quick question... Would it be feasible to use some of the Loom stuff
to read the loaded bytecode of a SWF and do stuff like get a list of
all the classes in a SWF? That would be a potential workaround for
this feature request:
https://bugs.adobe.com/jira/browse/ASC-3045

That would be very cool. Thanks.

-James

Maxim Porges

unread,
Sep 9, 2009, 7:46:08 PM9/9/09
to loom...@googlegroups.com
Yes. Loom is capable of parsing that info right now, and doing deeper
introspection than is available through decribeType(). The API would
need to be improved to support this for somebody unfamiliar with the
ABC spec, but it's all in there and would be pretty easy to implement.

- max

Christophe Herreman

unread,
Sep 10, 2009, 2:03:04 AM9/10/09
to loom...@googlegroups.com
Hi James,

the code found at http://etcs.ru/pre/getDefinitionNamesSource/ also enables you to do that.

Here's how you use it:

// in creationcomplete handler of the main application file for instance
var info:LoaderInfo = systemManager.loaderInfo;
var classes:Array = getDefinitionNames(info);

cheers,
Christophe

2009/9/10 Maxim Porges <maxim....@gmail.com>



--
Christophe Herreman
http://www.herrodius.com
http://www.springactionscript.org
http://www.as3commons.org

James Ward

unread,
Sep 10, 2009, 7:42:20 PM9/10/09
to loom...@googlegroups.com
Thanks Christophe! I'll have to look into that. Next step will be to
also find the classes with specific metadata on them. :)

Maxim: I tried the AmfDeserializer and ran into some exceptions. I need
to dig further into them to see if it was just user error (highly
likely). I'll let you know what I discover.

Thanks guys.

-James

Maxim Porges

unread,
Sep 10, 2009, 10:34:00 PM9/10/09
to loom...@googlegroups.com, loom...@googlegroups.com
Thanks James - let me know if I can help. Not all the opcodes are
implemented in Loom yet so it's quite possible that is why it failed.

- max

Christophe Herreman

unread,
Sep 11, 2009, 2:07:56 AM9/11/09
to loom...@googlegroups.com
AS3Commons-Reflect provides you with all the logic to introspect the classes.

Just use Type.forName(fqcn) and then use the metadata methods to look for specific metadata.

API: http://www.as3commons.org/as3-commons-reflect/asdoc/index.html

Have fun ;-)

2009/9/11 James Ward <jaw...@adobe.com>
Reply all
Reply to author
Forward
0 new messages