There are lots of programs I seen that can locate a swf running in memory, capture it and return source code. Usually the AS byte code is generated as well.

What I looking to do is the opposite, I'm trying to match a section of Action Script byte-code to a section of disassembly from a Shockwave Flash program.

Basically match p-code to disassembly.

Is there any good techniques or software that can do this.

2 Answers 2


JPEXS Free Flash Decompiler appears to have this functionality.

From http://www.free-decompiler.com/flash/features.html --

  • Displaying ActionScript code on the left, p-code on the right
  • Clicking AS item hilights position in p-code and vice-versa

enter image description here

  • Thanks Jason, JPEXS looks like a great program, but may I have worded my question incorrectly. I'm trying to match that p-code to the disassembly of a running Shockwave Flash. Oct 14, 2014 at 23:15
  • You mean you're trying to match each p-code instruction to its corresponding SWF bytecode handler in the ActionScript virtual machine? Oct 15, 2014 at 1:40
  • I'm trying to match each p-code instruction to it's corresponding x86 instruction that is generated by the JIT. Oct 15, 2014 at 3:41
  • @user1887120: that's not clear from your question, though.
    – 0xC0000022L
    Oct 15, 2014 at 7:28
  • 2
    I've edit my question back to original and mark your answer as correct. You answer was accurate, from the beginning, to the question I was asking. I'll post a new question rather than continuing to edit this. Oct 16, 2014 at 1:00

This is how it works at .NET. When the method is compiled a table is generated that contains the information (including offset, length) to match MSIL code to their machine code counterparts. However not all MSIL instructions have meaningful machine code counterpart, instead the table contains the info to match a sequence of MSIL instructions (block) to the machine counterparts.

You can access the table via Debugging or Profiler interface, or as I did, you can reverse engineer.

I'm not sure if such table exists in Flash, and if so is there a way to get it via documented function calls. But this should be one technique to consider.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.