From 3258ec4f0716fb4cfdc30cad65c439c79dd8700f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sat, 13 Jul 2013 12:13:08 +0200 Subject: [PATCH] AS3: alchemy separated AS3: new undocumented opcodes AS3: Switch fix Error log blinking icon, locales --- .../decompiler/flash/abc/avm2/AVM2Code.java | 86 ++++++++++------- .../flash/abc/avm2/graph/AVM2Graph.java | 15 +-- .../avm2/instructions/alchemy/Lf32Ins.java | 56 +++++++++++ .../avm2/instructions/alchemy/Lf64Ins.java | 56 +++++++++++ .../avm2/instructions/alchemy/Li16Ins.java | 56 +++++++++++ .../avm2/instructions/alchemy/Li32Ins.java | 56 +++++++++++ .../abc/avm2/instructions/alchemy/Li8Ins.java | 56 +++++++++++ .../avm2/instructions/alchemy/Sf32Ins.java | 57 ++++++++++++ .../avm2/instructions/alchemy/Sf64Ins.java | 57 ++++++++++++ .../avm2/instructions/alchemy/Si16Ins.java | 57 ++++++++++++ .../avm2/instructions/alchemy/Si32Ins.java | 57 ++++++++++++ .../abc/avm2/instructions/alchemy/Si8Ins.java | 57 ++++++++++++ .../avm2/instructions/alchemy/Sxi16Ins.java | 56 +++++++++++ .../avm2/instructions/alchemy/Sxi1Ins.java | 56 +++++++++++ .../avm2/instructions/alchemy/Sxi8Ins.java | 56 +++++++++++ .../avm2/treemodel/AlchemyLoadTreeItem.java | 44 +++++++++ .../treemodel/AlchemySignExtendTreeItem.java | 43 +++++++++ .../avm2/treemodel/AlchemyStoreTreeItem.java | 45 +++++++++ .../flash/abc/types/MethodBody.java | 2 +- .../jpexs/decompiler/flash/graph/Graph.java | 12 ++- .../decompiler/flash/gui/ErrorLogFrame.java | 87 ++++++++++++------ .../jpexs/decompiler/flash/gui/MainFrame.java | 26 +++++- .../decompiler/flash/gui/graphics/copy16.png | Bin 0 -> 663 bytes .../gui/locales/ErrorLogFrame.properties | 3 + .../gui/locales/ErrorLogFrame_cs.properties | 18 ++++ .../flash/gui/locales/MainFrame.properties | 5 +- .../flash/gui/locales/MainFrame_cs.properties | 5 +- .../jpexs/decompiler/flash/ABCStreamTest.java | 14 +-- 28 files changed, 1049 insertions(+), 89 deletions(-) create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemyLoadTreeItem.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemySignExtendTreeItem.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemyStoreTreeItem.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/graphics/copy16.png create mode 100644 trunk/src/com/jpexs/decompiler/flash/gui/locales/ErrorLogFrame_cs.properties diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index dfda6c23b..076088a69 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -24,6 +24,19 @@ import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphSource; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Lf32Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Lf64Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Li16Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Li32Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Li8Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Sf32Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Sf64Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Si16Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Si32Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Si8Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Sxi16Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Sxi1Ins; +import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Sxi8Ins; import com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic.*; import com.jpexs.decompiler.flash.abc.avm2.instructions.bitwise.*; import com.jpexs.decompiler.flash.abc.avm2.instructions.comparison.EqualsIns; @@ -96,6 +109,7 @@ public class AVM2Code implements Serializable { public static final int DAT_DOUBLE_INDEX = OPT_U30 + 0x10; public static final int DAT_DECIMAL_INDEX = OPT_U30 + 0x11; public static final int DAT_CASE_BASEOFFSET = OPT_S24 + 0x12; + public static final int DAT_DECIMAL_PARAMS = OPT_U30 + 0x13; public static InstructionDefinition instructionSet[] = new InstructionDefinition[]{ new AddIns(), new InstructionDefinition(0x9b, "add_d", new int[]{}) { @@ -105,7 +119,7 @@ public class AVM2Code implements Serializable { } }, new AddIIns(), - new InstructionDefinition(0xb5, "add_p", new int[]{AVM2Code.OPT_U30}), + new InstructionDefinition(0xb5, "add_p", new int[]{AVM2Code.DAT_DECIMAL_PARAMS}), new ApplyTypeIns(), new AsTypeIns(), new AsTypeLateIns(), @@ -150,7 +164,7 @@ public class AVM2Code implements Serializable { new ConvertUIns(), new ConvertSIns(), new InstructionDefinition(0x79, "convert_m", new int[]{}), //-1 +1 - new InstructionDefinition(0x7a, "convert_m_p", new int[]{AVM2Code.OPT_U30 /*param (?)*/}) { + new InstructionDefinition(0x7a, "convert_m_p", new int[]{AVM2Code.DAT_DECIMAL_PARAMS}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -177,7 +191,7 @@ public class AVM2Code implements Serializable { } }, new DivideIns(), - new InstructionDefinition(0xb8, "divide_p", new int[]{AVM2Code.OPT_U30}) { + new InstructionDefinition(0xb8, "divide_p", new int[]{AVM2Code.DAT_DECIMAL_PARAMS}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -2 + 1; //? @@ -264,10 +278,10 @@ public class AVM2Code implements Serializable { new IncLocalIIns(), new IncrementIns(), new IncrementIIns(), - new InstructionDefinition(0x9c, "increment_p", new int[]{AVM2Code.OPT_U30 /*param*/}), - new InstructionDefinition(0x9d, "inclocal_p", new int[]{AVM2Code.OPT_U30 /*param*/, AVM2Code.DAT_REGISTER_INDEX}), - new InstructionDefinition(0x9e, "decrement_p", new int[]{AVM2Code.OPT_U30 /*param*/}), - new InstructionDefinition(0x9f, "declocal_p", new int[]{AVM2Code.OPT_U30 /*param*/, AVM2Code.DAT_REGISTER_INDEX}), + new InstructionDefinition(0x9c, "increment_p", new int[]{AVM2Code.DAT_DECIMAL_PARAMS}), + new InstructionDefinition(0x9d, "inclocal_p", new int[]{AVM2Code.DAT_DECIMAL_PARAMS, AVM2Code.DAT_REGISTER_INDEX}), + new InstructionDefinition(0x9e, "decrement_p", new int[]{AVM2Code.DAT_DECIMAL_PARAMS}), + new InstructionDefinition(0x9f, "declocal_p", new int[]{AVM2Code.DAT_DECIMAL_PARAMS, AVM2Code.DAT_REGISTER_INDEX}), new InitPropertyIns(), new InstanceOfIns(), new IsTypeIns(), @@ -280,7 +294,7 @@ public class AVM2Code implements Serializable { new LookupSwitchIns(), new LShiftIns(), new ModuloIns(), - new InstructionDefinition(0xb9, "modulo_p", new int[]{AVM2Code.OPT_U30}) { + new InstructionDefinition(0xb9, "modulo_p", new int[]{AVM2Code.DAT_DECIMAL_PARAMS}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -2 + 1; //? @@ -288,7 +302,7 @@ public class AVM2Code implements Serializable { }, new MultiplyIns(), new MultiplyIIns(), - new InstructionDefinition(0xb7, "multiply_p", new int[]{AVM2Code.OPT_U30}) { + new InstructionDefinition(0xb7, "multiply_p", new int[]{AVM2Code.DAT_DECIMAL_PARAMS}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -2 + 1; //? @@ -296,7 +310,7 @@ public class AVM2Code implements Serializable { }, new NegateIns(), new NegateIIns(), - new InstructionDefinition(0x8f, "negate_p", new int[]{AVM2Code.OPT_U30 /* param */}) { + new InstructionDefinition(0x8f, "negate_p", new int[]{AVM2Code.DAT_DECIMAL_PARAMS}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -377,7 +391,7 @@ public class AVM2Code implements Serializable { new StrictEqualsIns(), new SubtractIns(), new SubtractIIns(), - new InstructionDefinition(0xb6, "subtract_p", new int[]{AVM2Code.OPT_U30}) { + new InstructionDefinition(0xb6, "subtract_p", new int[]{AVM2Code.DAT_DECIMAL_PARAMS}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -393,7 +407,20 @@ public class AVM2Code implements Serializable { new InstructionDefinition(0xf3, "timestamp", new int[]{}), new TypeOfIns(), new URShiftIns(), - new InstructionDefinition(0x35, "li8", new int[]{}) { + new Li8Ins(), + new Li16Ins(), + new Li32Ins(), + new Lf32Ins(), + new Lf64Ins(), + new Si8Ins(), + new Si16Ins(), + new Si32Ins(), + new Sf32Ins(), + new Sf64Ins(), + new Sxi1Ins(), + new Sxi8Ins(), + new Sxi16Ins(), + new InstructionDefinition(0xf5, "verifypass", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -404,7 +431,7 @@ public class AVM2Code implements Serializable { throw new UnsupportedOperationException(); } }, - new InstructionDefinition(0x36, "li16", new int[]{}) { + new InstructionDefinition(0xf6, "alloc", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -415,7 +442,7 @@ public class AVM2Code implements Serializable { throw new UnsupportedOperationException(); } }, - new InstructionDefinition(0x37, "li32", new int[]{}) { + new InstructionDefinition(0xf7, "mark", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -426,7 +453,7 @@ public class AVM2Code implements Serializable { throw new UnsupportedOperationException(); } }, - new InstructionDefinition(0x38, "lf32", new int[]{}) { + new InstructionDefinition(0xf8, "wb", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -437,7 +464,7 @@ public class AVM2Code implements Serializable { throw new UnsupportedOperationException(); } }, - new InstructionDefinition(0x39, "lf64", new int[]{}) { + new InstructionDefinition(0xf9, "prologue", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -448,7 +475,7 @@ public class AVM2Code implements Serializable { throw new UnsupportedOperationException(); } }, - new InstructionDefinition(0x3A, "si8", new int[]{}) { + new InstructionDefinition(0xfa, "sendenter", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -459,7 +486,7 @@ public class AVM2Code implements Serializable { throw new UnsupportedOperationException(); } }, - new InstructionDefinition(0x3B, "si16", new int[]{}) { + new InstructionDefinition(0xfb, "doubletoatom", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -470,7 +497,7 @@ public class AVM2Code implements Serializable { throw new UnsupportedOperationException(); } }, - new InstructionDefinition(0x3C, "si32", new int[]{}) { + new InstructionDefinition(0xfc, "sweep", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -481,7 +508,7 @@ public class AVM2Code implements Serializable { throw new UnsupportedOperationException(); } }, - new InstructionDefinition(0x3D, "sf32", new int[]{}) { + new InstructionDefinition(0xfd, "codegenop", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -492,7 +519,7 @@ public class AVM2Code implements Serializable { throw new UnsupportedOperationException(); } }, - new InstructionDefinition(0x3E, "sf64", new int[]{}) { + new InstructionDefinition(0xfe, "verifyop", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -503,7 +530,7 @@ public class AVM2Code implements Serializable { throw new UnsupportedOperationException(); } }, - new InstructionDefinition(0x50, "sxi1", new int[]{}) { + new InstructionDefinition(0xff, "decode", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -514,18 +541,7 @@ public class AVM2Code implements Serializable { throw new UnsupportedOperationException(); } }, - new InstructionDefinition(0x51, "sxi8", new int[]{}) { - @Override - public int getStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } - }, - new InstructionDefinition(0x52, "sxi16", new int[]{}) { + new InstructionDefinition(0xee, "abs_jump", new int[]{}) { @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); @@ -545,7 +561,7 @@ public class AVM2Code implements Serializable { InstructionDefinition result[] = new InstructionDefinition[256]; for (InstructionDefinition id : instructionSet) { if (result[id.instructionCode] != null) { - System.out.println("Warning: Duplicate OPCODE for instruction " + result[id.instructionCode] + " " + id); + Logger.getLogger(AVM2Code.class.getName()).log(Level.WARNING, "Duplicate OPCODE for instruction {0} {1}", new Object[]{result[id.instructionCode], id}); } result[id.instructionCode] = id; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java index 7df3a743f..0e8b60e1a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java @@ -389,12 +389,14 @@ public class AVM2Graph extends Graph { && (stack.peek() instanceof StrictEqTreeItem) && (part.nextParts.get(0).getHeight() >= 2) && (this.code.code.get(this.code.fixIPAfterDebugLine(part.nextParts.get(0).start)).definition instanceof PushIntegerTypeIns) + && (!part.nextParts.get(0).nextParts.isEmpty()) && (this.code.code.get(part.nextParts.get(0).nextParts.get(0).end).definition instanceof LookupSwitchIns)) || ((part.nextParts.size() == 2) && (!stack.isEmpty()) && (stack.peek() instanceof StrictNeqTreeItem) && (part.nextParts.get(1).getHeight() >= 2) && (this.code.code.get(this.code.fixIPAfterDebugLine(part.nextParts.get(1).start)).definition instanceof PushIntegerTypeIns) + && (!part.nextParts.get(1).nextParts.isEmpty()) && (this.code.code.get(part.nextParts.get(1).nextParts.get(0).end).definition instanceof LookupSwitchIns))) { if (stack.peek() instanceof StrictEqTreeItem) { @@ -479,14 +481,7 @@ public class AVM2Graph extends Graph { List> caseCommands = new ArrayList<>(); GraphPart next = null; - List loopContinues = getLoopsContinues(loops); - - next = switchLoc.getNextPartPath(loopContinues); - if (next == null) { - next = switchLoc.getNextSuperPartPath(loopContinues); - } - - GraphTargetItem ti = checkLoop(next, stopPart, loops); + next = getMostCommonPart(switchLoc.nextParts, loops);//getNextPartPath(loopContinues); currentLoop = new Loop(loops.size(), null, next); currentLoop.phase = 1; loops.add(currentLoop); @@ -526,8 +521,8 @@ public class AVM2Graph extends Graph { List cc = new ArrayList<>(); List stopPart2 = new ArrayList<>(stopPart); for (int j = 0; j < caseBodies.size(); j++) { - if (j != i) { - stopPart2.add(caseBodies.get(i)); + if (caseBodies.get(j) != caseBodies.get(i)) { + stopPart2.add(caseBodies.get(j)); } } if (hasDefault) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java new file mode 100644 index 000000000..7db878e55 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemyLoadTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Lf32Ins extends InstructionDefinition { + + public Lf32Ins() { + super(0x38, "lf32", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return 1 - 1; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem ofs = stack.pop(); + stack.push(new AlchemyLoadTreeItem(ins, ofs, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java new file mode 100644 index 000000000..f7834e2b3 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemyLoadTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Lf64Ins extends InstructionDefinition { + + public Lf64Ins() { + super(0x39, "lf64", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return 1 - 1; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem ofs = stack.pop(); + stack.push(new AlchemyLoadTreeItem(ins, ofs, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java new file mode 100644 index 000000000..546916cab --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemyLoadTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Li16Ins extends InstructionDefinition { + + public Li16Ins() { + super(0x36, "li16", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return 1 - 1; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem ofs = stack.pop(); + stack.push(new AlchemyLoadTreeItem(ins, ofs, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java new file mode 100644 index 000000000..3a3ab30bd --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemyLoadTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Li32Ins extends InstructionDefinition { + + public Li32Ins() { + super(0x37, "li32", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return 1 - 1; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem ofs = stack.pop(); + stack.push(new AlchemyLoadTreeItem(ins, ofs, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java new file mode 100644 index 000000000..1c26162ce --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemyLoadTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Li8Ins extends InstructionDefinition { + + public Li8Ins() { + super(0x35, "li8", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return 1 - 1; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem ofs = stack.pop(); + stack.push(new AlchemyLoadTreeItem(ins, ofs, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java new file mode 100644 index 000000000..40d79a1f4 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemyStoreTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Sf32Ins extends InstructionDefinition { + + public Sf32Ins() { + super(0x3D, "sf32", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return -2; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem ofs = stack.pop(); + GraphTargetItem value = stack.pop(); + stack.push(new AlchemyStoreTreeItem(ins, value, ofs, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java new file mode 100644 index 000000000..3f7a3c5bf --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemyStoreTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Sf64Ins extends InstructionDefinition { + + public Sf64Ins() { + super(0x3E, "sf64", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return -2; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem ofs = stack.pop(); + GraphTargetItem value = stack.pop(); + stack.push(new AlchemyStoreTreeItem(ins, value, ofs, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java new file mode 100644 index 000000000..550792583 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemyStoreTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Si16Ins extends InstructionDefinition { + + public Si16Ins() { + super(0x3B, "si16", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return -2; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem ofs = stack.pop(); + GraphTargetItem value = stack.pop(); + stack.push(new AlchemyStoreTreeItem(ins, value, ofs, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java new file mode 100644 index 000000000..81602848b --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemyStoreTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Si32Ins extends InstructionDefinition { + + public Si32Ins() { + super(0x3C, "si32", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return -2; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem ofs = stack.pop(); + GraphTargetItem value = stack.pop(); + stack.push(new AlchemyStoreTreeItem(ins, value, ofs, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java new file mode 100644 index 000000000..42c3d5bae --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemyStoreTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Si8Ins extends InstructionDefinition { + + public Si8Ins() { + super(0x3A, "si8", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return -2; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem ofs = stack.pop(); + GraphTargetItem value = stack.pop(); + stack.push(new AlchemyStoreTreeItem(ins, value, ofs, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java new file mode 100644 index 000000000..4aa7284bd --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemySignExtendTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Sxi16Ins extends InstructionDefinition { + + public Sxi16Ins() { + super(0x52, "sxi_16", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return 1 - 1; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem value = stack.pop(); + stack.push(new AlchemySignExtendTreeItem(ins, value, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java new file mode 100644 index 000000000..69aa33b83 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemySignExtendTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Sxi1Ins extends InstructionDefinition { + + public Sxi1Ins() { + super(0x50, "sxi_1", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return 1 - 1; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem value = stack.pop(); + stack.push(new AlchemySignExtendTreeItem(ins, value, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java new file mode 100644 index 000000000..7b21259d6 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; + +import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.AlchemySignExtendTreeItem; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class Sxi8Ins extends InstructionDefinition { + + public Sxi8Ins() { + super(0x51, "sxi_8", new int[]{}); + } + + @Override + public int getStackDelta(AVM2Instruction ins, ABC abc) { + return 1 - 1; + } + + @Override + public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { + return 0; + } + + @Override + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path) { + GraphTargetItem value = stack.pop(); + stack.push(new AlchemySignExtendTreeItem(ins, value, instructionName)); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemyLoadTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemyLoadTreeItem.java new file mode 100644 index 000000000..4fb2e6257 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemyLoadTreeItem.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.treemodel; + +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.graph.GraphSourceItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class AlchemyLoadTreeItem extends TreeItem { + + private String name; + private GraphTargetItem ofs; + + public AlchemyLoadTreeItem(GraphSourceItem instruction, GraphTargetItem ofs, String name) { + super(instruction, PRECEDENCE_PRIMARY); + this.name = name; + this.ofs = ofs; + } + + @Override + public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("op_" + name + "(") + ofs.toString(constants, localRegNames, fullyQualifiedNames) + hilight(") /*Alchemy*/"); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemySignExtendTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemySignExtendTreeItem.java new file mode 100644 index 000000000..fb42b1f86 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemySignExtendTreeItem.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.treemodel; + +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.graph.GraphSourceItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class AlchemySignExtendTreeItem extends TreeItem { + + private String name; + + public AlchemySignExtendTreeItem(GraphSourceItem instruction, GraphTargetItem value, String name) { + super(instruction, PRECEDENCE_PRIMARY); + this.name = name; + this.value = value; + } + + @Override + public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("op_" + name + "(") + value.toString(constants, localRegNames, fullyQualifiedNames) + hilight(") /*Alchemy*/"); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemyStoreTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemyStoreTreeItem.java new file mode 100644 index 000000000..72e51aa26 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/AlchemyStoreTreeItem.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.abc.avm2.treemodel; + +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.graph.GraphSourceItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import java.util.HashMap; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class AlchemyStoreTreeItem extends TreeItem { + + private String name; + private GraphTargetItem ofs; + + public AlchemyStoreTreeItem(GraphSourceItem instruction, GraphTargetItem value, GraphTargetItem ofs, String name) { + super(instruction, PRECEDENCE_PRIMARY); + this.name = name; + this.ofs = ofs; + this.value = value; + } + + @Override + public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + return hilight("op_" + name + "(") + ofs.toString(constants, localRegNames, fullyQualifiedNames) + hilight(",") + value.toString(constants, localRegNames, fullyQualifiedNames) + hilight(") /*Alchemy*/"); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index 414bf2269..27b0f5c9a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -36,7 +36,7 @@ import java.util.logging.Logger; public class MethodBody implements Cloneable, Serializable { - boolean debugMode = true; + boolean debugMode = false; public int method_info; public int max_stack; public int max_regs; diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java index 244fb920d..88266278a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java @@ -1366,6 +1366,9 @@ public class Graph { if (currentLoop != null) { currentLoop.phase = 0; } + if (debugMode) { + System.err.println("Adding break"); + } ret.add(new BreakItem(null, el.id)); return ret; } @@ -1373,6 +1376,9 @@ public class Graph { if (currentLoop != null) { currentLoop.phase = 0; } + if (debugMode) { + System.err.println("Adding precontinue"); + } ret.add(new ContinueItem(null, el.id)); return ret; } @@ -1380,6 +1386,9 @@ public class Graph { if (currentLoop != null) { currentLoop.phase = 0; } + if (debugMode) { + System.err.println("Adding continue"); + } ret.add(new ContinueItem(null, el.id)); return ret; } @@ -1704,9 +1713,6 @@ public class Graph { LoopItem li = loopItem; boolean loopTypeFound = false; - - - boolean hasContinue = false; processIfs(loopItem.commands); checkContinueAtTheEnd(loopItem.commands, currentLoop); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/ErrorLogFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/ErrorLogFrame.java index b993b0f10..cc23572cf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/ErrorLogFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/ErrorLogFrame.java @@ -17,10 +17,14 @@ package com.jpexs.decompiler.flash.gui; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Container; import java.awt.Cursor; import java.awt.Dimension; import java.awt.Insets; +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.PrintWriter; @@ -54,15 +58,17 @@ public class ErrorLogFrame extends AppFrame { } public ErrorLogFrame() { - setTitle("Log"); - setSize(500, 400); + setTitle(translate("dialog.title")); + setSize(700, 400); + setBackground(Color.white); View.centerScreen(this); View.setWindowIcon(this); setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); Container cnt = getContentPane(); cnt.setLayout(new BorderLayout()); - + logView.setBackground(Color.white); logView.setLayout(new ListLayout()); + cnt.setBackground(Color.white); cnt.add(new JScrollPane(logView)); handler = new Handler() { @@ -79,44 +85,68 @@ public class ErrorLogFrame extends AppFrame { public void close() throws SecurityException { } }; - //setAlwaysOnTop(true); } - public void log(Level level, String msg, String detail) { - if (detail == null) { - log(level, msg, (JComponent) null); - return; - } - final JTextArea detailTextArea = new JTextArea(detail); - detailTextArea.setEditable(false); - detailTextArea.setOpaque(false); - detailTextArea.setFont(new JLabel().getFont()); - log(level, msg, detailTextArea); - } - - private void log(Level level, String msg, final JComponent detail) { + private void log(final Level level, final String msg, final String detail) { JPanel pan = new JPanel(); + pan.setBackground(Color.white); pan.setLayout(new ListLayout()); + JComponent detailComponent; + if (detail == null) { + detailComponent = null; + } else { + final JTextArea detailTextArea = new JTextArea(detail); + detailTextArea.setEditable(false); + detailTextArea.setOpaque(false); + detailTextArea.setFont(new JLabel().getFont()); + detailTextArea.setBackground(Color.white); + detailComponent = detailTextArea; + } JPanel header = new JPanel(); header.setLayout(new BoxLayout(header, BoxLayout.X_AXIS)); + header.setBackground(Color.white); + + SimpleDateFormat format = new SimpleDateFormat("dd/MM/YYYY HH:mm:ss"); + final String dateStr = format.format(new Date()); + + JToggleButton copyButton = new JToggleButton(View.getIcon("copy16")); + copyButton.setFocusPainted(false); + copyButton.setBorderPainted(false); + copyButton.setFocusable(false); + copyButton.setContentAreaFilled(false); + copyButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + copyButton.setMargin(new Insets(2, 2, 2, 2)); + copyButton.setToolTipText(translate("copy")); + copyButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + StringSelection stringSelection = new StringSelection(dateStr + " " + level.toString() + " " + msg + "\r\n" + detail); + clipboard.setContents(stringSelection, null); + } + }); + final JToggleButton expandButton = new JToggleButton(View.getIcon("expand16")); expandButton.setFocusPainted(false); expandButton.setBorderPainted(false); expandButton.setFocusable(false); expandButton.setContentAreaFilled(false); + expandButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + expandButton.setMargin(new Insets(2, 2, 2, 2)); + expandButton.setToolTipText(translate("details")); + final JScrollPane scrollPane; - if (detail != null) { - scrollPane = new JScrollPane(detail); + if (detailComponent != null) { + scrollPane = new JScrollPane(detailComponent); scrollPane.setAlignmentX(0f); scrollPane.setMinimumSize(new Dimension(getWidth(), 500)); } else { scrollPane = null; } - expandButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - if (detail != null) { - expandButton.setMargin(new Insets(2, 2, 2, 2)); + + if (detailComponent != null) { expandButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -127,10 +157,10 @@ public class ErrorLogFrame extends AppFrame { }); } - SimpleDateFormat format = new SimpleDateFormat("dd/MM/YYYY HH:mm:ss"); - JLabel dateLabel = new JLabel(format.format(new Date())); - dateLabel.setPreferredSize(new Dimension(130, 25)); + + JLabel dateLabel = new JLabel(dateStr); + dateLabel.setPreferredSize(new Dimension(140, 25)); dateLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); header.add(dateLabel); @@ -148,17 +178,16 @@ public class ErrorLogFrame extends AppFrame { msgLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); header.add(msgLabel); header.setAlignmentX(0f); - if (detail != null) { + if (detailComponent != null) { header.add(expandButton); } + header.add(copyButton); pan.add(header); - if (detail != null) { + if (detailComponent != null) { pan.add(scrollPane); scrollPane.setVisible(false); } - //pan.setPreferredSize(new Dimension(getWidth(), 30)); pan.setAlignmentX(0f); - //curGBConstraints.weighty = 1; logView.add(pan); revalidate(); repaint(); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java index 7e0bd86d4..4fd1241b1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java @@ -767,7 +767,7 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection errorNotificationButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); errorNotificationButton.setActionCommand("SHOWERRORLOG"); errorNotificationButton.addActionListener(this); - errorNotificationButton.setToolTipText("There are no errors in the log"); + errorNotificationButton.setToolTipText(translate("errors.none")); statusPanel.add(errorNotificationButton, BorderLayout.EAST); @@ -1051,11 +1051,33 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection Logger logger = Logger.getLogger(""); logger.addHandler(errorLogFrame.getHandler()); logger.addHandler(new Handler() { + private Timer timer = null; + private int pos = 0; + @Override public void publish(LogRecord record) { if (record.getLevel() == Level.SEVERE) { errorNotificationButton.setIcon(View.getIcon("error16")); - errorNotificationButton.setToolTipText("There are ERRORS in the log"); + errorNotificationButton.setToolTipText(translate("errors.present")); + if (timer != null) { + timer.cancel(); + } + timer = new Timer(); + timer.schedule(new TimerTask() { + @Override + public void run() { + pos++; + if ((pos % 2) == 0) { + errorNotificationButton.setIcon(View.getIcon("error16")); + } else { + errorNotificationButton.setIcon(null); + errorNotificationButton.setSize(16, 16); + } + if (pos == 4) { + cancel(); + } + } + }, 500, 500); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/graphics/copy16.png b/trunk/src/com/jpexs/decompiler/flash/gui/graphics/copy16.png new file mode 100644 index 0000000000000000000000000000000000000000..195dc6d6c365d298e466026b37c1959d96119ea7 GIT binary patch literal 663 zcmV;I0%-k-P)^@R5;6Z z(>-WZK@^7J_sq=QY_e{46@P+~LNG}sRzZsxQHvCsN*h5ir6^j7pq-$xu$N#V1gx}9 zClV7;5)7zih-s3DB)G=7|99>ji@So7-P24n=VQ(@GctDX!^_@$bj%oviY6e4Dh;od zooe%Wvs8LEKQ&&bL&@bwi=STIAI@!-gB2jC5+?y?VR~VkrNxam-`6*8&po|RZ5LpS zNKdJ%c4bTX`XjKsnecf%W>1%6WT?pKNdLLq{=(f(Col?P1+oq@R>)W(n=x!|*BIIh z6DJGw_w`)u6yN|vAhMteYK5#b%r5^v+VCFl1IGssaclZZMS{vs-LJ2$)n7DAr6==K z<29#%AXsBsDoO}SBaXR#_Ap!JKx)(1)3O2pj0_dYWz5By*X74fRT01$Fk%P_RzOMDtV?GU{nsYq#K8iy zb6qzLYDj`_f5$BwC*WE(t0m#xYJ*=jC2|HQYHh=pf#QG7oowi`h!L!{DB$8|qY{~X zu8@sU1tWq;n$XThR0%;45mdqXM892|{CJ@0DS*}>?ami06Q_^tvM~Y3K(_-`#m!8f z8f!QIrH4y#61;0Ym0cCoLl8{IPombPHtnn7%SbTdI&G-d>ZQo!_wBMF9nzX!g8HVY xYTJPGciz9XMh3w2fmZ(7v{)r*QZD48?mrio{~Iaoq. +copy = Copy to clipboard +details = View details +dialog.title = Log \ No newline at end of file diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/ErrorLogFrame_cs.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/ErrorLogFrame_cs.properties new file mode 100644 index 000000000..7510c2065 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/ErrorLogFrame_cs.properties @@ -0,0 +1,18 @@ +# Copyright (C) 2013 JPEXS +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +copy = Zkop\u00edrovat do schr\u00e1nky +details = Zobrazit detaily +dialog.title = Log \ No newline at end of file diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index f8324fe1a..c3d32b899 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -230,4 +230,7 @@ font.characters.add = Add characters: value.unknown = ? yes = yes -no = no \ No newline at end of file +no = no + +errors.present = There are ERRORS in the log. Click to view. +errors.none = There are no errors in the log \ No newline at end of file diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties index 1f58dd0eb..edc75caae 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties @@ -230,4 +230,7 @@ font.characters.add = P\u0159idat znaky: value.unknown = ? yes = ano -no = ne \ No newline at end of file +no = ne + +errors.present = V logu jsou CHYBY. Klikn\u011bte pro zobrazen\u00ed. +errors.none = V logu nejsou \u017e\u00e1dn\u00e9 chyby \ No newline at end of file diff --git a/trunk/test/com/jpexs/decompiler/flash/ABCStreamTest.java b/trunk/test/com/jpexs/decompiler/flash/ABCStreamTest.java index 5ce8a835a..807f3bb93 100644 --- a/trunk/test/com/jpexs/decompiler/flash/ABCStreamTest.java +++ b/trunk/test/com/jpexs/decompiler/flash/ABCStreamTest.java @@ -16,16 +16,16 @@ public class ABCStreamTest { @Test public void testU30() { - try(ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ABCOutputStream aos = new ABCOutputStream(baos)) { + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ABCOutputStream aos = new ABCOutputStream(baos);) { long number = 1531; aos.writeU30(number); aos.close(); - ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); - ABCInputStream ais = new ABCInputStream(bais); - assertEquals(number, ais.readU30()); - assertEquals(0, bais.available()); - ais.close(); + try (ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + ABCInputStream ais = new ABCInputStream(bais);) { + assertEquals(number, ais.readU30()); + assertEquals(0, bais.available()); + } } catch (IOException ex) { fail(); }