JPEXS Free Flash Decompiler Issue Tracker

If you are looking for the decompiler itself, visit

List of issuesList of issues

#32 ParseException
Date created:
Type: bug
Visibility: Everybody
Assigned to:
Labels: AS1/2Google CodeP-code
State: closed Help

There is a problem while parsing an SWF that contains a function which has a jump or if to the next instruction after it. When function is read from the byte stream a new 'ActionDefineFunction' object created. All sub-actions are placed into 'code' field. But when you try to retreive raw byte code of such function by calling method 'getBytes' you get an extra byte FF in the end attached. That's because it's actually doesn't give you an original code but rather assembles a new stream from these sub-actions. Thus branch instructions count the instruction next after function (only if they go there) to its boby length leading to wrong value for 'codeSize' field in the function's byte code. 100 byte codeBytes[] = Action.actionsToBytes(code, false, version); 101 sos.writeUI16(codeBytes.length); Here it goes to be +1 due to the wrong translation of the list of actions to bytes. <b>What steps will reproduce the problem?</b> 1. Parse an SWF that contains such a function. Sometimes it goes ok, but you still can see an exception in the log and a wrong &quot;255&quot; instruction in the P-code. <b>What is the expected output? What do you see instead?</b> From log: ??? 21, 2013 10:48:02 AM com.jpexs.decompiler.flash.SWFInputStream readActionList SEVERE: parsing error com.jpexs.decompiler.flash.action.parser.ParseException: ParseException:Unknown instruction name :action255 on line 69 at com.jpexs.decompiler.flash.action.parser.ASMParser.parse( at com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2.&lt;init&gt;(ActionDefineFunc at com.jpexs.decompiler.flash.action.parser.ASMParser.parse( at com.jpexs.decompiler.flash.action.parser.ASMParser.parse( at com.jpexs.decompiler.flash.SWFInputStream.readActionList( at com.jpexs.decompiler.flash.tags.DoActionTag.getActions( at com.jpexs.decompiler.flash.action.gui.ActionPanel$ <b>What version of the product are you using? On what operating system?</b> Ffdec 1.3 Windows 7 64-bit <b>Could you provide the SWF file you have problem with?</b> <b>If the answer is yes, then please attach it here or send me it via email.</b> <b>Could you at least attach PCode source?</b> Here what you get in ASdec 1.2: Jump loc02a6 loc0291:Push 0.0 &quot;checkPressedButtom&quot; CallFunction Pop Jump loc02a6 loc02a6: } loc02a6:SetMember Push &quot;eventListener&quot; GetVariable Push 1 &quot;Key&quot; GetVariable Push &quot;addListener&quot; CallMethod Pop And now the same chunk in the FFdec 1.3: Jump loc02a6 loc0291:Push 0.0 &quot;checkPressedButtom&quot; CallFunction Pop Jump loc02a6 loc02a6:Action255 } SetMember Push &quot;eventListener&quot; GetVariable Push 1 &quot;Key&quot; GetVariable Push &quot;addListener&quot; CallMethod <b>Do you have the original source code which produced the wrong</b> <b>decompilation? If yes, then please attach it.</b> <b>Please provide any additional information below.</b>
Hi, it is fixed in version 1.3.1, try it again.
State: →closed
Title: ParseException→ParseException
Type: →bug
Visibility: →Everybody