diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java index e5c96ad04..65b06ab3a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java @@ -153,9 +153,10 @@ public class AVM2DeobfuscatorSimple extends SWFDecompilerAdapter { protected boolean removeNullPushes(AVM2Code code, MethodBody body) throws InterruptedException { boolean result = false; + Set offsets = code.getImportantOffsets(body, true); + // Deliberately skip over instruction zero for (int i = 1; i < code.code.size(); i++) { - Set offsets = code.getImportantOffsets(body, true); AVM2Instruction ins1 = code.code.get(i - 1); AVM2Instruction ins2 = code.code.get(i); if (ins2.definition instanceof PopIns @@ -179,6 +180,7 @@ public class AVM2DeobfuscatorSimple extends SWFDecompilerAdapter { i--; code.removeInstruction(i, body); i--; + offsets = code.getImportantOffsets(body, true); //update offsets, they changed because of removing instruction result = true; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimpleOld.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimpleOld.java index 23c135d87..3166d1ed2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimpleOld.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimpleOld.java @@ -209,9 +209,10 @@ public class AVM2DeobfuscatorSimpleOld extends SWFDecompilerAdapter { protected boolean removeNullPushes(AVM2Code code, MethodBody body) throws InterruptedException { boolean result = false; + Set offsets = code.getImportantOffsets(body, true); + // Deliberately skip over instruction zero for (int i = 1; i < code.code.size(); i++) { - Set offsets = code.getImportantOffsets(body, true); AVM2Instruction ins1 = code.code.get(i - 1); AVM2Instruction ins2 = code.code.get(i); if (ins2.definition instanceof PopIns @@ -235,6 +236,7 @@ public class AVM2DeobfuscatorSimpleOld extends SWFDecompilerAdapter { i--; code.removeInstruction(i, body); i--; + offsets = code.getImportantOffsets(body, true); //update offsets, they changed because of removing instruction result = true; } }