mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 14:20:43 +00:00
AS2 deobfuscator fix
This commit is contained in:
@@ -342,6 +342,19 @@ public class ActionList extends ArrayList<Action> {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public Action getContainer(int idx) {
|
||||
int i = idx - 1;
|
||||
while (i >= 0) {
|
||||
if (get(i) instanceof GraphSourceItemContainer) {
|
||||
return get(i);
|
||||
}
|
||||
|
||||
i--;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void saveToFile(String fileName) {
|
||||
File file = new File(fileName);
|
||||
try (FileTextWriter writer = new FileTextWriter(Configuration.getCodeFormatting(), new FileOutputStream(file))) {
|
||||
|
||||
+10
-1
@@ -153,8 +153,17 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
|
||||
ActionConstantPool cPool = getConstantPool(actions);
|
||||
for (int i = 0; i < actions.size(); i++) {
|
||||
int idx = actions.size() - 1;
|
||||
Action container = actions.getContainer(i);
|
||||
if (container != null) {
|
||||
List<Action> lastActions = actions.getContainerLastActions(container);
|
||||
Action lastAction = lastActions.get(lastActions.size() - 1);
|
||||
int idx2 = actions.getIndexByAddress(lastAction.getAddress()) - 1;
|
||||
idx = Math.min(idx, idx2);
|
||||
}
|
||||
|
||||
ExecutionResult result = new ExecutionResult();
|
||||
executeActions(actions, i, actions.size() - 1, cPool, result, fakeFunctions);
|
||||
executeActions(actions, i, idx, cPool, result, fakeFunctions);
|
||||
|
||||
if (result.idx != -1 && result.resultValue == null) {
|
||||
int newIstructionCount = 1; // jump
|
||||
|
||||
Reference in New Issue
Block a user