mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-31 19:54:37 +00:00
@@ -38,6 +38,7 @@ public class FixItemCounterTranslateStack extends TranslateStack {
|
||||
*/
|
||||
public FixItemCounterTranslateStack(String path) {
|
||||
super(null); //null path => do not add PushItems
|
||||
doNoPushItemsToOutput = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -201,7 +201,11 @@ public class AVM2DeobfuscatorRegistersOld extends AVM2DeobfuscatorSimpleOld {
|
||||
}
|
||||
|
||||
Set<Integer> visited = new HashSet<>();
|
||||
return visitCode(assignment, visited, new TranslateStack("deo"), classIndex, isStatic, body, scriptIndex, abc, code, 0, code.code.size() - 1, ignoredRegisters, ignoredGets);
|
||||
|
||||
TranslateStack stack = new TranslateStack("deo");
|
||||
stack.doNoPushItemsToOutput = true;
|
||||
|
||||
return visitCode(assignment, visited, stack, classIndex, isStatic, body, scriptIndex, abc, code, 0, code.code.size() - 1, ignoredRegisters, ignoredGets);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -296,7 +300,7 @@ public class AVM2DeobfuscatorRegistersOld extends AVM2DeobfuscatorSimpleOld {
|
||||
}
|
||||
|
||||
idx = toVisit.remove(0);
|
||||
stack = toVisitStacks.remove(0);
|
||||
stack = toVisitStacks.remove(0);
|
||||
|
||||
while (true) {
|
||||
if (idx > endIdx) {
|
||||
@@ -325,9 +329,21 @@ public class AVM2DeobfuscatorRegistersOld extends AVM2DeobfuscatorSimpleOld {
|
||||
if (stack.size() < requiredStackSize) {
|
||||
continue outer;
|
||||
}
|
||||
|
||||
if (ins.definition instanceof ReturnValueIns) {
|
||||
break;
|
||||
}
|
||||
|
||||
stack.setConnectedOutput(0, output, localData);
|
||||
ins.translate(localData, stack, output, 0, "");
|
||||
if (ins.definition instanceof ThrowIns) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (ins.definition instanceof ReturnVoidIns) {
|
||||
break;
|
||||
}
|
||||
|
||||
stack.setConnectedOutput(0, output, localData);
|
||||
ins.translate(localData, stack, output, 0, "");
|
||||
if (def instanceof SetLocalTypeIns) {
|
||||
int regId = ((SetLocalTypeIns) def).getRegisterId(ins);
|
||||
if (!ignored.contains(regId)) {
|
||||
@@ -431,19 +447,7 @@ public class AVM2DeobfuscatorRegistersOld extends AVM2DeobfuscatorSimpleOld {
|
||||
throw new TranslateException("If target not found: " + address);
|
||||
}
|
||||
visitCode(visited, (TranslateStack) stack.clone(), classIndex, isStatic, body, scriptIndex, abc, code, newIdx, endIdx, result);
|
||||
}*/
|
||||
|
||||
if (ins.definition instanceof ReturnValueIns) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (ins.definition instanceof ThrowIns) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (ins.definition instanceof ReturnVoidIns) {
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
||||
@@ -67,6 +67,9 @@ public class TranslateStack extends Stack<GraphTargetItem> {
|
||||
|
||||
public int emptyPopCount = 0;
|
||||
|
||||
//Used by deobfuscation
|
||||
public boolean doNoPushItemsToOutput = false;
|
||||
|
||||
@Override
|
||||
public synchronized Object clone() {
|
||||
TranslateStack st = (TranslateStack) super.clone();
|
||||
@@ -363,25 +366,12 @@ public class TranslateStack extends Stack<GraphTargetItem> {
|
||||
if (connectedOutput == null) {
|
||||
return;
|
||||
}
|
||||
/*int pos = output.size();
|
||||
|
||||
for (int i = size() - 1; i >= 0; i--) {
|
||||
GraphTargetItem item = get(i);
|
||||
if (item instanceof BranchStackResistant) {
|
||||
continue;
|
||||
}
|
||||
if (item instanceof NewActivationAVM2Item) {
|
||||
break;
|
||||
}
|
||||
if (item instanceof ExceptionAVM2Item) {
|
||||
break;
|
||||
}
|
||||
remove(i);
|
||||
if (item instanceof PopItem) {
|
||||
continue;
|
||||
}
|
||||
output.add(pos, beforeExit ? item : new PushItem(item));
|
||||
}*/
|
||||
if (doNoPushItemsToOutput) {
|
||||
output.addAll(outputQueue);
|
||||
outputQueue.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
int clen = output.size();
|
||||
boolean isExit = false;
|
||||
|
||||
Reference in New Issue
Block a user