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 11e5ec578..711a701fc 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 @@ -2088,9 +2088,9 @@ public class AVM2Code implements Cloneable { @Override public int updateOperandOffset(long insAddr, long targetAddress, int offset) { - if (insAddr == -1) { //do not check exceptions - return offset; - } + /*if (insAddr == -1) { + return offset; + }*/ adr2pos(targetAddress); return offset; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegisters.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegisters.java index cd9830597..a5a34ea26 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegisters.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegisters.java @@ -148,9 +148,9 @@ public class AVM2DeobfuscatorRegisters extends AVM2DeobfuscatorSimple { listedLastBodies.add(bodybefore); } + body.getCode().removeDeadCode(body); originalBody.exceptions = body.exceptions; originalBody.setCode(body.getCode()); - body.getCode().removeDeadCode(body); //System.err.println("/deo"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java index ef24d9dad..13cdd1bb1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java @@ -146,37 +146,11 @@ public class AVM2DeobfuscatorRegistersOld extends AVM2DeobfuscatorSimpleOld { listedLastBodies.add(bodybefore); } + body.getCode().removeDeadCode(body); + originalBody.exceptions = body.exceptions; originalBody.setCode(body.getCode()); - body.getCode().removeDeadCode(body); - //System.err.println("/deo"); - } - private void replaceSingleUseRegisters(Map singleRegisters, List setInss, int classIndex, boolean isStatic, int scriptIndex, ABC abc, AVM2ConstantPool cpool, Trait trait, MethodInfo minfo, MethodBody body) throws InterruptedException { - AVM2Code code = body.getCode(); - - for (int i = 0; i < code.code.size(); i++) { - if (Thread.currentThread().isInterrupted()) { - throw new InterruptedException(); - } - - AVM2Instruction ins = code.code.get(i); - if (((setInss == null) || setInss.contains(ins)) && (ins.definition instanceof SetLocalTypeIns)) { - SetLocalTypeIns slt = (SetLocalTypeIns) ins.definition; - int regId = slt.getRegisterId(ins); - if (singleRegisters.containsKey(regId)) { - code.replaceInstruction(i, new AVM2Instruction(ins.offset, DeobfuscatePopIns.getInstance(), null), body); - } - } - - if (ins.definition instanceof GetLocalTypeIns) { - GetLocalTypeIns glt = (GetLocalTypeIns) ins.definition; - int regId = glt.getRegisterId(ins); - if (singleRegisters.containsKey(regId)) { - code.replaceInstruction(i, cpool.makePush(singleRegisters.get(regId).getResult()), body); - } - } - } } private int getFirstRegisterSetter(Reference assignment, int classIndex, boolean isStatic, int scriptIndex, ABC abc, MethodBody body, Set ignoredRegisters, Set ignoredGets) throws InterruptedException { diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index dabb36861..642500109 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -789,24 +789,31 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener