mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-30 10:01:30 +00:00
AS1/2 chained assignments decompilation
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -47,6 +47,16 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta
|
||||
public List<String> constantPool;
|
||||
private long hdrSize;
|
||||
|
||||
public ActionDefineFunction(String functionName, List<String> 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;
|
||||
|
||||
Reference in New Issue
Block a user