mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-31 04:35:39 +00:00
removeNullPushes .. optimize call getImportantOffsets - only when instruction removed
This commit is contained in:
@@ -153,9 +153,10 @@ public class AVM2DeobfuscatorSimple extends SWFDecompilerAdapter {
|
||||
|
||||
protected boolean removeNullPushes(AVM2Code code, MethodBody body) throws InterruptedException {
|
||||
boolean result = false;
|
||||
Set<Long> offsets = code.getImportantOffsets(body, true);
|
||||
|
||||
// Deliberately skip over instruction zero
|
||||
for (int i = 1; i < code.code.size(); i++) {
|
||||
Set<Long> 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,9 +209,10 @@ public class AVM2DeobfuscatorSimpleOld extends SWFDecompilerAdapter {
|
||||
|
||||
protected boolean removeNullPushes(AVM2Code code, MethodBody body) throws InterruptedException {
|
||||
boolean result = false;
|
||||
Set<Long> offsets = code.getImportantOffsets(body, true);
|
||||
|
||||
// Deliberately skip over instruction zero
|
||||
for (int i = 1; i < code.code.size(); i++) {
|
||||
Set<Long> 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user