mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-13 13:18:23 +00:00
action deobfuscator improved
This commit is contained in:
@@ -342,17 +342,23 @@ public class ActionList extends ArrayList<Action> {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public Action getContainer(int idx) {
|
||||
public int getContainerIndex(int idx) {
|
||||
Action action = get(idx);
|
||||
int i = idx - 1;
|
||||
while (i >= 0) {
|
||||
if (get(i) instanceof GraphSourceItemContainer) {
|
||||
return get(i);
|
||||
Action a = get(i);
|
||||
if (a instanceof GraphSourceItemContainer) {
|
||||
List<Action> lastActions = getContainerLastActions(a);
|
||||
Action lastAction = lastActions.get(lastActions.size() - 1);
|
||||
if (lastAction.getAddress() >= action.getAddress()) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
i--;
|
||||
}
|
||||
|
||||
return null;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void saveToFile(String fileName) {
|
||||
|
||||
@@ -154,12 +154,9 @@ 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);
|
||||
int containerIndex = actions.getContainerIndex(i);
|
||||
if (containerIndex != -1) {
|
||||
idx = Math.min(idx, containerIndex - 1);
|
||||
}
|
||||
|
||||
ExecutionResult result = new ExecutionResult();
|
||||
|
||||
Reference in New Issue
Block a user