diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java index c024ae4a7..3b7f1a55a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java @@ -23,6 +23,8 @@ import com.jpexs.decompiler.flash.action.parser.ParseException; import com.jpexs.decompiler.flash.action.parser.pcode.ASMParsedSymbol; import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.flash.action.treemodel.DirectValueTreeItem; +import com.jpexs.decompiler.flash.action.treemodel.SetTypeTreeItem; +import com.jpexs.decompiler.flash.action.treemodel.StoreRegisterTreeItem; import com.jpexs.decompiler.flash.graph.GraphSourceItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.helpers.Helper; @@ -249,7 +251,21 @@ public class ActionPush extends Action { } if (o instanceof RegisterNumber) { if (regNames.containsKey(((RegisterNumber) o).number)) { - ((RegisterNumber) o).name = regNames.get(((RegisterNumber) o).number); + ((RegisterNumber) o).name = regNames.get(((RegisterNumber) o).number); + }else if(output.size()>=2){ //chained assignments: + GraphTargetItem last=output.get(output.size()-1); + GraphTargetItem prev=output.get(output.size()-2); + if(last instanceof SetTypeTreeItem ){ + if(prev instanceof StoreRegisterTreeItem){ + StoreRegisterTreeItem str=(StoreRegisterTreeItem)prev; + if(str.register.number==((RegisterNumber) o).number){ + stack.push(output.remove(output.size()-1)); + output.remove(output.size()-1); + pos++; + continue; + } + } + } } } DirectValueTreeItem dvt = new DirectValueTreeItem(this, pos, o, constantPool); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java b/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java index ef551b86e..9a2392bab 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java @@ -47,6 +47,16 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta public List constantPool; private long hdrSize; + public ActionDefineFunction(String functionName, List paramNames, int codeSize, int version) { + super(0x9B, 0); + this.functionName = functionName; + this.codeSize = codeSize; + this.version = version; + this.paramNames=paramNames; + } + + + public ActionDefineFunction(int actionLength, SWFInputStream sis, ReReadableInputStream rri, int version) throws IOException { super(0x9B, actionLength); this.version = version;