diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/EndOfStreamException.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/EndOfStreamException.java index 1dd428d75..a412cf47f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/EndOfStreamException.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/EndOfStreamException.java @@ -12,14 +12,17 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash; +import java.io.IOException; + /** * * @author JPEXS */ -public class EndOfStreamException extends RuntimeException { +public class EndOfStreamException extends IOException { public EndOfStreamException() { super("Premature end of the stream reached"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java index 3212a910c..b4c26c121 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -983,7 +983,7 @@ public class SWFInputStream implements AutoCloseable { dumpInfo.name = t.getName(); } return t; - } catch (EndOfStreamException ex) { + } catch (Exception ex) { tag.getDataStream().endDumpLevelUntil(di); logger.log(Level.SEVERE, null, ex); return tag; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java index 52a37cc9f..58ec233f2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc; +import com.jpexs.decompiler.flash.EndOfStreamException; import com.jpexs.decompiler.flash.abc.types.Decimal; import com.jpexs.decompiler.flash.abc.types.InstanceInfo; import com.jpexs.decompiler.flash.abc.types.MethodInfo; @@ -103,6 +105,9 @@ public class ABCInputStream implements AutoCloseable { private int readInternal() throws IOException { bytesRead++; int i = is.read(); + if (i == -1) { + throw new EndOfStreamException(); + } if (DEBUG_READ) { System.out.println("Read:0x" + Integer.toHexString(i)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index d0b81fbc8..2e5a6f6ed 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.abc.avm2; +import com.jpexs.decompiler.flash.EndOfStreamException; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.ABCInputStream; import com.jpexs.decompiler.flash.abc.AVM2LocalData; @@ -234,10 +235,7 @@ import com.jpexs.helpers.Helper; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; import java.io.OutputStream; -import java.io.Serializable; import java.io.StringReader; import java.util.ArrayList; import java.util.HashMap; @@ -248,9 +246,8 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; -public class AVM2Code implements Serializable { +public class AVM2Code implements Cloneable { - public static final long serialVersionUID = 1L; private static final Logger logger = Logger.getLogger(AVM2Code.class.getName()); private static final boolean DEBUG_MODE = false; public static int toSourceLimit = -1; @@ -787,54 +784,58 @@ public class AVM2Code implements Serializable { } public AVM2Code(ABCInputStream ais) throws IOException { - while (ais.available() > 0) { - DumpInfo di = ais.newDumpLevel("instruction", "instruction"); - long startOffset = ais.getPosition(); - int instructionCode = ais.read("instructionCode"); - InstructionDefinition instr = instructionSetByCode[instructionCode]; - if (di != null) { - di.name = instr.instructionName; - } - if (instr != null) { - int[] actualOperands = null; - if (instructionCode == 0x1b) { //switch - int firstOperand = ais.readS24("firstOperand"); - int case_count = ais.readU30("case_count"); - actualOperands = new int[case_count + 3]; - actualOperands[0] = firstOperand; - actualOperands[1] = case_count; - for (int c = 0; c < case_count + 1; c++) { - actualOperands[2 + c] = ais.readS24("actualOperand"); - } - } else { - if (instr.operands.length > 0) { - actualOperands = new int[instr.operands.length]; - for (int op = 0; op < instr.operands.length; op++) { - switch (instr.operands[op] & 0xff00) { - case OPT_U30: - actualOperands[op] = ais.readU30("operand"); - break; - case OPT_U8: - actualOperands[op] = ais.read("operand"); - break; - case OPT_BYTE: - actualOperands[op] = (byte) ais.read("operand"); - break; - case OPT_S24: - actualOperands[op] = ais.readS24("operand"); - break; + try { + while (ais.available() > 0) { + DumpInfo di = ais.newDumpLevel("instruction", "instruction"); + long startOffset = ais.getPosition(); + int instructionCode = ais.read("instructionCode"); + InstructionDefinition instr = instructionSetByCode[instructionCode]; + if (di != null) { + di.name = instr.instructionName; + } + if (instr != null) { + int[] actualOperands = null; + if (instructionCode == 0x1b) { //switch + int firstOperand = ais.readS24("default_offset"); + int case_count = ais.readU30("case_count"); + actualOperands = new int[case_count + 3]; + actualOperands[0] = firstOperand; + actualOperands[1] = case_count; + for (int c = 0; c < case_count + 1; c++) { + actualOperands[2 + c] = ais.readS24("actualOperand"); + } + } else { + if (instr.operands.length > 0) { + actualOperands = new int[instr.operands.length]; + for (int op = 0; op < instr.operands.length; op++) { + switch (instr.operands[op] & 0xff00) { + case OPT_U30: + actualOperands[op] = ais.readU30("operand"); + break; + case OPT_U8: + actualOperands[op] = ais.read("operand"); + break; + case OPT_BYTE: + actualOperands[op] = (byte) ais.read("operand"); + break; + case OPT_S24: + actualOperands[op] = ais.readS24("operand"); + break; + } } } } - } - code.add(new AVM2Instruction(startOffset, instr, actualOperands)); - ais.endDumpLevel(instr.instructionCode); - } else { - ais.endDumpLevel(); - break; // Unknown instructions are ignored (Some of the obfuscators add unknown instructions) - //throw new UnknownInstructionCode(instructionCode); + code.add(new AVM2Instruction(startOffset, instr, actualOperands)); + ais.endDumpLevel(instr.instructionCode); + } else { + ais.endDumpLevel(); + break; // Unknown instructions are ignored (Some of the obfuscators add unknown instructions) + //throw new UnknownInstructionCode(instructionCode); + } } + } catch (EndOfStreamException ex) { + // lookupswitch obfuscation, ignore } } @@ -2433,24 +2434,6 @@ public class AVM2Code implements Serializable { } } - public AVM2Code deepCopy() { - try { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try (ObjectOutputStream oos = new ObjectOutputStream(baos)) { - oos.writeObject(this); - oos.flush(); - } - AVM2Code copy; - try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) { - copy = (AVM2Code) ois.readObject(); - } - return copy; - } catch (IOException | ClassNotFoundException ex) { - logger.log(Level.SEVERE, "Error during deepCopy", ex); - return null; - } - } - private static class Decision { public boolean jumpUsed = false; @@ -2890,4 +2873,18 @@ public class AVM2Code implements Serializable { AVM2Graph.translateViaGraph(localData, "", code, new ArrayList(), Graph.SOP_REMOVE_STATIC); return 1; }*/ + + @SuppressWarnings("unchecked") + @Override + public Object clone() throws CloneNotSupportedException { + AVM2Code ret = (AVM2Code) super.clone(); + if (code != null) { + List codeCopy = new ArrayList<>(code.size()); + for (AVM2Instruction ins : code) { + codeCopy.add((AVM2Instruction) ins.clone()); + } + ret.code = codeCopy; + } + return ret; + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java index 6e1ef30f7..8514cb705 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java @@ -35,13 +35,12 @@ import com.jpexs.decompiler.graph.model.LocalData; import com.jpexs.helpers.Helper; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.Serializable; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -public class AVM2Instruction implements Serializable, GraphSourceItem { +public class AVM2Instruction implements Cloneable, GraphSourceItem { - public static final long serialVersionUID = 1L; public InstructionDefinition definition; public int[] operands; public long offset; @@ -360,4 +359,13 @@ public class AVM2Instruction implements Serializable, GraphSourceItem { public boolean isDeobfuscatePop() { return definition instanceof DeobfuscatePopIns; } + + @Override + public Object clone() throws CloneNotSupportedException { + AVM2Instruction ret = (AVM2Instruction) super.clone(); + if (operands != null) { + ret.operands = Arrays.copyOf(operands, operands.length); + } + return ret; + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AssignableAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AssignableAVM2Item.java index 727c64aab..44d7aa6e8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AssignableAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AssignableAVM2Item.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -100,7 +101,7 @@ public abstract class AssignableAVM2Item extends AVM2Item { ret.add(ins(new KillIns(), register.getVal())); return ret; }*/ - //@SuppressWarnings("unchecked") + public static List killTemp(SourceGeneratorLocalData localData, SourceGenerator generator, List> registers) { List ret = new ArrayList<>(); for (Reference register : registers) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index 9aa208356..565269dc6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -35,7 +35,6 @@ import com.jpexs.helpers.CancellableWorker; import com.jpexs.helpers.Helper; import com.jpexs.helpers.MemoryInputStream; import java.io.IOException; -import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -46,7 +45,7 @@ import java.util.concurrent.TimeoutException; import java.util.logging.Level; import java.util.logging.Logger; -public class MethodBody implements Cloneable, Serializable { +public class MethodBody implements Cloneable { public boolean deleted; boolean debugMode = false; @@ -221,7 +220,7 @@ public class MethodBody implements Cloneable, Serializable { } public MethodBody convertMethodBody(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, Trait trait, AVM2ConstantPool constants, List method_info, ScopeStack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits) throws InterruptedException { - MethodBody b = Helper.deepCopy(this); + MethodBody b = (MethodBody) clone(); AVM2Code deobfuscated = b.getCode(); deobfuscated.markMappedOffsets(); if (Configuration.autoDeobfuscate.get()) { @@ -237,18 +236,25 @@ public class MethodBody implements Cloneable, Serializable { } @Override - public Object clone() throws CloneNotSupportedException { - MethodBody ret = new MethodBody(); - ret.code = code; - ret.codeBytes = codeBytes; - ret.exceptions = exceptions; - ret.max_regs = max_regs; - ret.max_scope_depth = max_scope_depth; - ret.max_stack = max_stack; - ret.method_info = method_info; - ret.init_scope_depth = init_scope_depth; - ret.traits = traits; //maybe deep clone - return ret; + public Object clone() { + try { + MethodBody ret = (MethodBody) super.clone(); + if (code != null) { + ret.code = (AVM2Code) code.clone(); + } + ret.codeBytes = codeBytes; + ret.exceptions = exceptions; + ret.max_regs = max_regs; + ret.max_scope_depth = max_scope_depth; + ret.max_stack = max_stack; + ret.method_info = method_info; + ret.init_scope_depth = init_scope_depth; + ret.traits = traits; //maybe deep clone + return ret; + } catch (CloneNotSupportedException ex) { + Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, null, ex); + } + return null; } public boolean autoFillStats(ABC abc, int initScope, boolean hasThis) { diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 2acd9f7f6..ac80a7661 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -602,17 +602,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec dumpTree.setModel(new DumpTreeModel(swfs)); if (swf.isAS3) { - if (abcPanel == null) { - abcPanel = new ABCPanel(this); - displayPanel.add(abcPanel, CARDACTIONSCRIPT3PANEL); - detailPanel.add(abcPanel.tabbedPane, DETAILCARDAS3NAVIGATOR); - } - abcPanel.setSwf(swf); - } else { - if (actionPanel == null) { - actionPanel = new ActionPanel(this); - displayPanel.add(actionPanel, CARDACTIONSCRIPTPANEL); - } + getABCPanel().setSwf(swf); } expandSwfNodes(); @@ -648,6 +638,23 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } } + private ABCPanel getABCPanel() { + if (abcPanel == null) { + abcPanel = new ABCPanel(this); + displayPanel.add(abcPanel, CARDACTIONSCRIPT3PANEL); + detailPanel.add(abcPanel.tabbedPane, DETAILCARDAS3NAVIGATOR); + } + return abcPanel; + } + + private ActionPanel getActionPanel() { + if (actionPanel == null) { + actionPanel = new ActionPanel(this); + displayPanel.add(actionPanel, CARDACTIONSCRIPTPANEL); + } + return actionPanel; + } + private void updateUi(final SWF swf) { mainFrame.setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + swf.getFileTitle() : "")); @@ -657,7 +664,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec boolean hasAbc = !abcList.isEmpty(); if (hasAbc) { - abcPanel.setSwf(swf); + getABCPanel().setSwf(swf); } if (isWelcomeScreen) { @@ -914,8 +921,8 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec public void renameMultiname(List abcList, int multiNameIndex) { String oldName = ""; - if (abcPanel.abc.constants.getMultiname(multiNameIndex).name_index > 0) { - oldName = abcPanel.abc.constants.getString(abcPanel.abc.constants.getMultiname(multiNameIndex).name_index); + if (getABCPanel().abc.constants.getMultiname(multiNameIndex).name_index > 0) { + oldName = getABCPanel().abc.constants.getString(getABCPanel().abc.constants.getMultiname(multiNameIndex).name_index); } String newName = View.showInputDialog(translate("rename.enternew"), oldName); if (newName != null) { @@ -941,7 +948,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } updateClassesList(); reload(true); - abcPanel.hilightScript(abcPanel.swf, abcPanel.decompiledTextArea.getScriptLeaf().getPath().toString()); + getABCPanel().hilightScript(getABCPanel().swf, getABCPanel().decompiledTextArea.getScriptLeaf().getPath().toString()); } } } @@ -1187,8 +1194,8 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec if (documentClass != null && !Configuration.dumpView.get()) { showDetail(DETAILCARDAS3NAVIGATOR); showCard(CARDACTIONSCRIPT3PANEL); - abcPanel.setSwf(swf); - abcPanel.hilightScript(swf, documentClass); + getABCPanel().setSwf(swf); + getABCPanel().hilightScript(swf, documentClass); } } @@ -1228,7 +1235,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec }); } } else { - if (actionPanel.search(txt, searchDialog.ignoreCaseCheckBox.isSelected(), searchDialog.regexpCheckBox.isSelected())) { + if (getActionPanel().search(txt, searchDialog.ignoreCaseCheckBox.isSelected(), searchDialog.regexpCheckBox.isSelected())) { found = true; View.execInEventDispatch(new Runnable() { @Override @@ -1322,7 +1329,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec return; } if (swf.fileAttributes != null && swf.fileAttributes.actionScript3) { - final int multiName = abcPanel.decompiledTextArea.getMultinameUnderCursor(); + final int multiName = getABCPanel().decompiledTextArea.getMultinameUnderCursor(); final List abcList = swf.abcList; if (multiName > 0) { new CancellableWorker() { @@ -1343,7 +1350,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec View.showMessageDialog(null, translate("message.rename.notfound.multiname"), translate("message.rename.notfound.title"), JOptionPane.INFORMATION_MESSAGE); } } else { - final String identifier = actionPanel.getStringUnderCursor(); + final String identifier = getActionPanel().getStringUnderCursor(); if (identifier != null) { new CancellableWorker() { @Override @@ -1720,15 +1727,15 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec protected Object doInBackground() throws Exception { int cnt = 0; if (all) { - for (ABCContainerTag tag : abcPanel.swf.abcList) { + for (ABCContainerTag tag : getABCPanel().swf.abcList) { tag.getABC().restoreControlFlow(); } } else { - int bi = abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex(); + int bi = getABCPanel().detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex(); if (bi != -1) { - abcPanel.abc.bodies.get(bi).restoreControlFlow(abcPanel.abc.constants, abcPanel.decompiledTextArea.getCurrentTrait(), abcPanel.abc.method_info.get(abcPanel.abc.bodies.get(bi).method_info)); + getABCPanel().abc.bodies.get(bi).restoreControlFlow(getABCPanel().abc.constants, getABCPanel().decompiledTextArea.getCurrentTrait(), getABCPanel().abc.method_info.get(getABCPanel().abc.bodies.get(bi).method_info)); } - abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi, abcPanel.abc, abcPanel.decompiledTextArea.getCurrentTrait()); + getABCPanel().detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi, getABCPanel().abc, getABCPanel().decompiledTextArea.getCurrentTrait()); } return true; } @@ -1742,7 +1749,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec @Override public void run() { - abcPanel.reload(); + getABCPanel().reload(); updateClassesList(); } }); @@ -1808,7 +1815,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec protected Object doInBackground() throws Exception { try { if (deobfuscationDialog.processAllCheckbox.isSelected()) { - for (ABCContainerTag tag : abcPanel.swf.abcList) { + for (ABCContainerTag tag : getABCPanel().swf.abcList) { if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_DEAD_CODE) { tag.getABC().removeDeadCode(); } else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_TRAPS) { @@ -1819,19 +1826,19 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } } } else { - int bi = abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex(); - Trait t = abcPanel.decompiledTextArea.getCurrentTrait(); + int bi = getABCPanel().detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex(); + Trait t = getABCPanel().decompiledTextArea.getCurrentTrait(); if (bi != -1) { if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_DEAD_CODE) { - abcPanel.abc.bodies.get(bi).removeDeadCode(abcPanel.abc.constants, t, abcPanel.abc.method_info.get(abcPanel.abc.bodies.get(bi).method_info)); + getABCPanel().abc.bodies.get(bi).removeDeadCode(getABCPanel().abc.constants, t, getABCPanel().abc.method_info.get(getABCPanel().abc.bodies.get(bi).method_info)); } else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_TRAPS) { - abcPanel.abc.bodies.get(bi).removeTraps(abcPanel.abc.constants, abcPanel.abc, t, abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex, abcPanel.decompiledTextArea.getClassIndex(), abcPanel.decompiledTextArea.getIsStatic(), ""/*FIXME*/); + getABCPanel().abc.bodies.get(bi).removeTraps(getABCPanel().abc.constants, getABCPanel().abc, t, getABCPanel().decompiledTextArea.getScriptLeaf().scriptIndex, getABCPanel().decompiledTextArea.getClassIndex(), getABCPanel().decompiledTextArea.getIsStatic(), ""/*FIXME*/); } else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_RESTORE_CONTROL_FLOW) { - abcPanel.abc.bodies.get(bi).removeTraps(abcPanel.abc.constants, abcPanel.abc, t, abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex, abcPanel.decompiledTextArea.getClassIndex(), abcPanel.decompiledTextArea.getIsStatic(), ""/*FIXME*/); - abcPanel.abc.bodies.get(bi).restoreControlFlow(abcPanel.abc.constants, t, abcPanel.abc.method_info.get(abcPanel.abc.bodies.get(bi).method_info)); + getABCPanel().abc.bodies.get(bi).removeTraps(getABCPanel().abc.constants, getABCPanel().abc, t, getABCPanel().decompiledTextArea.getScriptLeaf().scriptIndex, getABCPanel().decompiledTextArea.getClassIndex(), getABCPanel().decompiledTextArea.getIsStatic(), ""/*FIXME*/); + getABCPanel().abc.bodies.get(bi).restoreControlFlow(getABCPanel().abc.constants, t, getABCPanel().abc.method_info.get(getABCPanel().abc.bodies.get(bi).method_info)); } } - abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi, abcPanel.abc, t); + getABCPanel().detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi, getABCPanel().abc, t); } } catch (Exception ex) { logger.log(Level.SEVERE, "Deobfuscation error", ex); @@ -1849,7 +1856,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec @Override public void run() { clearCache(); - abcPanel.reload(); + getABCPanel().reload(); updateClassesList(); } }); @@ -2257,13 +2264,13 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec break; } } - abcPanel.detailPanel.methodTraitPanel.methodCodePanel.clear(); - abcPanel.navigator.setABC(abcList, scriptLeaf.abc); - abcPanel.navigator.setClassIndex(classIndex, scriptLeaf.scriptIndex); - abcPanel.setAbc(scriptLeaf.abc); - abcPanel.decompiledTextArea.setScript(scriptLeaf, abcList); - abcPanel.decompiledTextArea.setClassIndex(classIndex); - abcPanel.decompiledTextArea.setNoTrait(); + getABCPanel().detailPanel.methodTraitPanel.methodCodePanel.clear(); + getABCPanel().navigator.setABC(abcList, scriptLeaf.abc); + getABCPanel().navigator.setClassIndex(classIndex, scriptLeaf.scriptIndex); + getABCPanel().setAbc(scriptLeaf.abc); + getABCPanel().decompiledTextArea.setScript(scriptLeaf, abcList); + getABCPanel().decompiledTextArea.setClassIndex(classIndex); + getABCPanel().decompiledTextArea.setNoTrait(); return null; } @@ -2278,9 +2285,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec try { get(); } catch (CancellationException ex) { - abcPanel.decompiledTextArea.setText("//" + AppStrings.translate("work.canceled")); + getABCPanel().decompiledTextArea.setText("//" + AppStrings.translate("work.canceled")); } catch (Exception ex) { - abcPanel.decompiledTextArea.setText("//" + AppStrings.translate("decompilationError") + ": " + ex); + getABCPanel().decompiledTextArea.setText("//" + AppStrings.translate("decompilationError") + ": " + ex); } } }); @@ -2325,7 +2332,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec previewPanel.showBinaryPanel(binaryTag.binaryData); } else if (tagObj instanceof ASMSource) { showCard(CARDACTIONSCRIPTPANEL); - actionPanel.setSource((ASMSource) tagObj, !forceReload); + getActionPanel().setSource((ASMSource) tagObj, !forceReload); } else if (tagObj instanceof ImageTag) { ImageTag imageTag = (ImageTag) tagObj; previewPanel.setImageReplaceButtonVisible(imageTag.importSupported());