A very important tool for SWF manipulation is a way to debug them and to have a look at the bytecode. Dump is a tool that does nothing else but listing all SWF Tags and ABC files the way Apparat represents them internally.
I know that there are a lot of other tools out there. swfdump and abcdump are great already. I have used swfdump from the Flex SDK before. But I dislike how they represent namespaces and the fact that not all properties are always shown. Dump is simple. It lists everything and uses the naming form the avm2overview.pdf.
Thanks, I was already wondering where those nice listings of yours came from.
On a sidenote: Could you some time share your knowledge on size optimisation with us? For example, I’ve been working on a 40KB AS3 banner, but for some reason I can’t figure out it’s about 9KB of Actionscript, while it’s really almost nothing! I’ve managed to scrape some bytes of here and there, but I suspect the compiler adds a whole bunch of stuff I can’t influence. Maybe your dump tool can give me some insight to it , let’s see :)
Do you mind a little nudge in the right direction…
Admittedly, I barely know what the f* I’m doing. :) Just stabbing in the dark more or less.
I’m trying to execute this via Ant:
—–
Also, when I check my java version via the console I get:
java version “1.6.0_13″
Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode)
but my ant diagnostics tells me:
java.vm.version : 1.5.0_19-137
Is this a problem?
——-
my errors:
analyze:
Exception in thread “main” java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
hmm, looks like your comment submission cleaned my xml code, how’s this:
http://www.alanklement.com/img/ant_ddump_task.gif
Alan, are you running Ant from command line or from within Eclipse? Some of my colleagues had a lot of trouble switching the Java VM for Eclipse on a Mac. Are you using a Mac? If you can not manage to do so (I know it was a pain!) you have another option. You can set fork to true specify the jvm attribute of the java task which points to the location of your 1.6 JVM.
The location is probably “/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/bin/java”.
I am on a Mac and I am running Ant via Eclipse.
Well I’m glad that it’s just not me having problems :) Thanks for the ideas. I’m gonna research your comments and give it a stab.
Im also running into issues with the Bad Version Number. In debugging it, I noticed that the 1.6.0 Java install on my Mac:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/
doesnt include a bin directory, and thus no executable. Anyways, I am trying to figure out what the issue is, but wanted to post it here in case it was useful to anyone else.
mike chambers
fyi, I got this working.
When you install Java 1.6 for mac (from Apple), it does not link to the new version, but instead keep the link to Java 1.5.
You can to explicitly update this link if you want to use java 1.6. You can find instructions here:
http://blogs.sun.com/cmar/entry/java_1_6_finally_available
If you dont want to change the default for the system, then you should be able to link directly to the java 1.6 binary :
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java /usr/bin/java
This fixed the Bad Version Number error for me.
Hope that helps…
mike chambers
Thank you for the explanation Mike!
On Windows XP, I needed to update the jre under C:\Program Files\Adobe\Flex Builder 3 to the 1.6 version.
Sun keeps my default Java installation up to date, so what I did was copy the jre over from C:\Program Files\Java\jdk1.6.0_12.
That is only the case when you install FlexBuilder standalone version.
Do we run this from the command line? I’m running this on Windows XP with JRE 1.6 0_15, it seems to run without error, but I have no idea if/where it’s creating an output file?
Yes, command line.
This will output ABC data:
java -jar dump.jar -input yourswf.swf -abc
This will generate a UML diagram:
java -jar dump.jar -input yourswf.swf -uml
Are you making the source available for your dump.jar? :) Have checked around on the site and not seeing the contents– just a much larger download.