mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-09 15:40:33 +00:00
Issue #137 AS3 deobfuscation fix
This commit is contained in:
@@ -1468,7 +1468,7 @@ public class AVM2Code implements Serializable {
|
||||
code.add(pos, instruction);
|
||||
}
|
||||
|
||||
public int removeTraps(ConstantPool constants, MethodBody body, ABC abc, int scriptIndex, int classIndex, boolean isStatic, String path, HashMap<Integer, List<Integer>> refs) {
|
||||
public int removeTraps(ConstantPool constants, MethodBody body, ABC abc, int scriptIndex, int classIndex, boolean isStatic, String path) {
|
||||
removeDeadCode(constants, body);
|
||||
List<Object> localData = new ArrayList<>();
|
||||
localData.add((Boolean) isStatic); //isStatic
|
||||
@@ -1487,6 +1487,7 @@ public class AVM2Code implements Serializable {
|
||||
localData.add((Integer) (scriptIndex));
|
||||
localData.add(new HashMap<Integer, Integer>()); //localRegAssignmentIps
|
||||
localData.add(Integer.valueOf(0));
|
||||
HashMap<Integer, List<Integer>> refs = visitCode(body);
|
||||
localData.add(refs);
|
||||
localData.add(this);
|
||||
int ret = 0;
|
||||
@@ -2109,7 +2110,7 @@ public class AVM2Code implements Serializable {
|
||||
return true;
|
||||
}
|
||||
if (visited.contains(currentIp)) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
visited.add(currentIp);
|
||||
if (refs.containsKey(currentIp)) {
|
||||
|
||||
@@ -51,7 +51,7 @@ public abstract class SetLocalTypeIns extends InstructionDefinition implements S
|
||||
int regId = getRegisterId(ins);
|
||||
GraphTargetItem value = (GraphTargetItem) stack.pop();
|
||||
if (localRegs.containsKey(regId)) {
|
||||
localRegs.put(regId, new NotCompileTimeAVM2Item(ins, value));
|
||||
localRegs.put(regId, new NotCompileTimeAVM2Item(ins, value));
|
||||
} else {
|
||||
localRegs.put(regId, value);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
}
|
||||
|
||||
public int removeTraps(ConstantPool constants, ABC abc, int scriptIndex, int classIndex, boolean isStatic, String path) {
|
||||
return code.removeTraps(constants, this, abc, scriptIndex, classIndex, isStatic, path, code.visitCode(this));
|
||||
return code.removeTraps(constants, this, abc, scriptIndex, classIndex, isStatic, path);
|
||||
}
|
||||
|
||||
public HashMap<Integer, String> getLocalRegNames(ABC abc) {
|
||||
@@ -124,7 +124,7 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
deobfuscated.markMappedOffsets();
|
||||
if ((Boolean) Configuration.getConfig("autoDeobfuscate", true)) {
|
||||
try {
|
||||
deobfuscated.removeTraps(constants, b, abc, scriptIndex, classIndex, isStatic, path, deobfuscated.visitCode(b));
|
||||
deobfuscated.removeTraps(constants, b, abc, scriptIndex, classIndex, isStatic, path);
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Error during remove traps", ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user