mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-04 15:14:49 +00:00
Correct deobfuscation for labels
The deobfuscator will no longer incorrectly remove the following code: pushtrue label1:pop
This commit is contained in:
@@ -155,9 +155,11 @@ public class AVM2DeobfuscatorSimple extends SWFDecompilerAdapter {
|
||||
boolean result = false;
|
||||
// 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 &&
|
||||
!offsets.contains(ins2.getAddress()) &&
|
||||
(ins1.definition instanceof PushByteIns ||
|
||||
ins1.definition instanceof PushDoubleIns ||
|
||||
ins1.definition instanceof PushFalseIns ||
|
||||
|
||||
@@ -105,6 +105,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -210,9 +211,11 @@ public class AVM2DeobfuscatorSimpleOld extends SWFDecompilerAdapter {
|
||||
boolean result = false;
|
||||
// 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 &&
|
||||
!offsets.contains(ins2.getAddress()) &&
|
||||
(ins1.definition instanceof PushByteIns ||
|
||||
ins1.definition instanceof PushDoubleIns ||
|
||||
ins1.definition instanceof PushFalseIns ||
|
||||
|
||||
Reference in New Issue
Block a user