Decompling Flex Code
Recently I was playing with the decompiler after reading doug’s post about decompile flex code, and got to say that my inner geek wanted a ABC debugger just to see how it behaves in run time and understand better the ABC code (I don’t know if such thing exist but it would be soooo nice)…
You’ll need some tools, and Sothink Decompiler is a very good one, but it won’t give you the same clean result as decompiling Java code, next there are a couple of air apps that will show you the ABC code and help you fix the error in the decompiled code. These are LibraryManager and Nemo 440, both gives you the ABC but the first one is more organized IMHO although it eats some of the functions header and you’ll need this, so I used both programms.
And last but not least, as Doug point it out in his blog, there are the SWF and AVM 2 Specs docs, I used more the last one just to trying to figure out what the ABC was doing.
So, here are some tips:
- if you see something like var private::_1455875791myVar:Object /* slot_id 0 */, and then a function like [Bindable(event="propertyChange")]
function get myVar():Object /* disp_id 0*/ { //Some ABC Code }
function set myVar(Object):void /* disp_id 0*/ { // More ABC Code }
this mean the there is a Bindable var named myVar so you could just replace this with
[Bindable] private var myVar:Object
- Imagine you have a class named MyClass (pretty creative) and you see another class under a package named MyClass.AS$42 means that the second class is a inner inside MyClass, so don’t try to add that package because you’ll get reference errors.
- I don’t know if this is 100% correct but when you see /* slot_id 0 */ means private function or var and /* disp_id 0*/ is a public one
These are some things that I learned while browsing the ABC, is not much but hope it helps someone…