The Dump tool is now able to export an inheritance graph for a given ABC/SWC/SWF file. This is a very easy and nice way to look at the classes and their relationships. The small image shows the graph for one ABC file of the AudioTool. I think this it is pretty neat.
You will need a program like Graphviz to visualize the exported DOT file. If you want to export the inheritance graph you basically writejava -jar dump.jar -input file.swf -ig. I think this shows a really cool feature of Apparat. It is also very easy to reverse engineer a UML diagram. I am not interested in such a feature but maybe someone else.
Update: Here is a full-size example for the inheritance graph of the unfinished ImageProcessing library I am currently working on.


Could you link to a full size example?
Just added the complete graph of the new imageprocessing library.
Hey Joa! This looks mighty interesting, but I can’t get it to work. I get the following exception:
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)
I noticed the comments in your earlier post:
http://blog.joa-ebert.com/2009/08/17/dump-disassembler/
I am indeed running this on a Mac and I’ll give this a shot to see if I can get it running!
So I tried the suggestions in the other post, but I still can’t get it to work. Now it complains about being OutOfMemory. While my swf is rather complex I’d imagine, I don’t think it’d warrant being out of memory when I have 1.5GB+ free memory. Is there some Java setting I must change in order to get this working?
Here’s the callstack:
[i] Running tool “Dump” …
[i] Exporting inheritance graph to “frame1.dot”.
Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
at com.joa_ebert.apparat.abc.bytecode.OperationFactory.create(Unknown Source)
at com.joa_ebert.apparat.abc.bytecode.BytecodeDecoder.decode(Unknown Source)
at com.joa_ebert.apparat.abc.bytecode.BytecodeDecoder.decode(Unknown Source)
at com.joa_ebert.apparat.abc.bytecode.BytecodeDecoder.decode(Unknown Source)
at com.joa_ebert.apparat.abc.Abc.readMethodBodies(Unknown Source)
at com.joa_ebert.apparat.abc.Abc.read(Unknown Source)
at com.joa_ebert.apparat.abc.Abc.read(Unknown Source)
at com.joa_ebert.apparat.abc.Abc.read(Unknown Source)
at com.joa_ebert.apparat.tools.dump.Dump.run(Unknown Source)
at com.joa_ebert.apparat.tools.ToolRunner.run(Unknown Source)
at com.joa_ebert.apparat.tools.dump.Dump.main(Unknown Source)
Adding -Xmx1024m did the trick!
Well yes, Java is a little bit annoying when it comes to configuration. I think I will have to write some binaries that launch the tools and do the configuration part automatically.