views:

154

answers:

2

I'm looking for a way, preferably a command-line utility, to pump out an .abc file for a compiled swf. I've looked into asc.jar, but so far it seems like it can only accept classes, not compiled swfs. Anybody know of a good way to do this?

The end-goal of this process is to use Zwetan's RedTamarin project to run describeType on some specific classes inside a loaded swf, but there are complications with SecurityDomain preventing me from using Loader.loadBytes. If there's another good way to describe classes in the loaded swf via command-line, I'd be interested in that solution as well.

Cheers,

J

+2  A: 

I'm not sure what you're trying to accomplish, but nemo440 might be useful.

grapefrukt
Thanks, grapefrukt, but that's not *quite* it. It looks like nemo, as well as swfdump and flasm, just kicks out a human-readable representation of the bytecode, not the actual .abc file. In nemo's listed input formats, it lists .swf (both compressed and uncompressed) AND .abc, but provides the same text dump for both. I'm looking to convert from .swf to .abc, no need to be able to read it :P
Jeremy Ruppel
@Jeremy: SWF is just a container format. The ABC is embedded unaltered, as far as I know. Just grab the SWF specs and find how ABC is embedded. Alternatively you can use `swfdump` or `swfutils` from the flex sdk in `/lib/` with `-abc source.swf > out.abc`.
back2dos
@back2dos: doesn't look like that's quite right either. The sabc file generated by swfdump is going to be the same as previously mentioned, meant to be human-readable. I'm talking about a legitimate .abc file, as described in these two posts:http://coderhump.com/archives/104http://coderhump.com/archives/105The .abc file he's using can be generated from a class via asc, then loaded into the Tamarin runtime. Take an .abc file created this way and compare it to the text dump from swfdump, nero, or flasm, and you'll see the difference.
Jeremy Ruppel
Also, I forgot to reiterate a couple things: First is that I'm hoping to produce the .abc file from a swf, not a class, so it doesn't appear that I can use the asc.jar tool. Second is that I'm attempting to do exactly what the second post describes, and that is to load class definitions at Tamarin's runtime. If there are other ways to do this (besides Loader.loadBytes) I'd be equally interested in other approaches. The .swf-.abc conversion is a middle step that I'm settling for and if it can be avoided I'd be cool with that too.
Jeremy Ruppel
A: 

if you look at a recent abcdump.as there is the options to dump the *.abc file(s) http://hg.mozilla.org/tamarin-redux/file/ec60d0d30d67/utils/abcdump.as

Option -a Extract the ABC blocks from the SWF/SWC but do not otherwise display their contents.

zwetan