Fix putfield pop order, runs on all fields it detects now. Don't know if it works.
This commit is contained in:
@@ -50,7 +50,7 @@ public class PutField extends Instruction implements SetFieldInstruction
|
|||||||
|
|
||||||
StackContext value = stack.pop();
|
StackContext value = stack.pop();
|
||||||
StackContext object = stack.pop();
|
StackContext object = stack.pop();
|
||||||
ins.pop(object, value);
|
ins.pop(value, object);
|
||||||
|
|
||||||
Encryption encryption = frame.getExecution().getEncryption();
|
Encryption encryption = frame.getExecution().getEncryption();
|
||||||
net.runelite.deob.Field myField = getMyField();
|
net.runelite.deob.Field myField = getMyField();
|
||||||
|
|||||||
@@ -66,13 +66,16 @@ public class ModArith implements Deobfuscator
|
|||||||
|
|
||||||
int value = (int) pc.getConstant().getObject();
|
int value = (int) pc.getConstant().getObject();
|
||||||
|
|
||||||
|
if (value == 1 || value == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
constantGetters.put(field, value);
|
constantGetters.put(field, value);
|
||||||
}
|
}
|
||||||
else if (ctx.getInstruction() instanceof SetFieldInstruction)
|
else if (ctx.getInstruction() instanceof SetFieldInstruction)
|
||||||
{
|
{
|
||||||
SetFieldInstruction sf = (SetFieldInstruction) ctx.getInstruction();
|
SetFieldInstruction sf = (SetFieldInstruction) ctx.getInstruction();
|
||||||
|
|
||||||
StackContext value = ctx.getPops().get(0); // what setfield pops as value
|
StackContext value = ctx.getPops().get(0); // the first thing poppe from both putfield and putstatic is the value
|
||||||
if (!(value.getPushed().getInstruction() instanceof IMul))
|
if (!(value.getPushed().getInstruction() instanceof IMul))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -101,6 +104,9 @@ public class ModArith implements Deobfuscator
|
|||||||
|
|
||||||
int value2 = (int) pc.getConstant().getObject();
|
int value2 = (int) pc.getConstant().getObject();
|
||||||
|
|
||||||
|
if (value2 == 1 || value2 == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
constantSetters.put(field, value2);
|
constantSetters.put(field, value2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -263,8 +269,17 @@ public class ModArith implements Deobfuscator
|
|||||||
public void run(ClassGroup group)
|
public void run(ClassGroup group)
|
||||||
{
|
{
|
||||||
this.group = group;
|
this.group = group;
|
||||||
|
while (runOnce() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int runOnce()
|
||||||
|
{
|
||||||
group.buildClassGraph();
|
group.buildClassGraph();
|
||||||
|
|
||||||
|
pairs.clear();
|
||||||
|
constantGetters.clear();;
|
||||||
|
constantSetters.clear();
|
||||||
|
|
||||||
execution = new Execution(group);
|
execution = new Execution(group);
|
||||||
execution.populateInitialMethods();
|
execution.populateInitialMethods();
|
||||||
execution.run();
|
execution.run();
|
||||||
@@ -273,7 +288,7 @@ public class ModArith implements Deobfuscator
|
|||||||
reduce();
|
reduce();
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int start = 0, end = 32; // 24 32 ok
|
int start = 0, end = pairs.size(); // 0-64 ok
|
||||||
for (int j = start; j < end; ++j)
|
for (int j = start; j < end; ++j)
|
||||||
//for (Pair pair : pairs)
|
//for (Pair pair : pairs)
|
||||||
{
|
{
|
||||||
@@ -322,6 +337,7 @@ public class ModArith implements Deobfuscator
|
|||||||
//
|
//
|
||||||
// Field f = group.findClass("class41").findField("field1170");
|
// Field f = group.findClass("class41").findField("field1170");
|
||||||
// calculate(f);
|
// calculate(f);
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user