setConstant
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
package net.runelite.deob.attributes.code.instruction.types;
|
package net.runelite.deob.attributes.code.instruction.types;
|
||||||
|
|
||||||
|
import net.runelite.deob.attributes.code.Instruction;
|
||||||
import net.runelite.deob.pool.PoolEntry;
|
import net.runelite.deob.pool.PoolEntry;
|
||||||
|
|
||||||
public interface PushConstantInstruction
|
public interface PushConstantInstruction
|
||||||
{
|
{
|
||||||
public PoolEntry getConstant();
|
public PoolEntry getConstant();
|
||||||
|
|
||||||
public void setConstant(PoolEntry entry);
|
public Instruction setConstant(PoolEntry entry);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class BiPush extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class DConst_0 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class DConst_1 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class FConst_0 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class FConst_1 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class FConst_2 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class IConst_0 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ public class IConst_1 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
return new LDC_W(this.getInstructions(), entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class IConst_2 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class IConst_3 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class IConst_4 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class IConst_5 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class IConst_M1 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class LConst_0 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class LConst_1 extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,8 +55,9 @@ public class LDC2_W extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
value = entry;
|
value = entry;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,8 +105,9 @@ public class LDC_W extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
value = entry;
|
value = entry;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class SiPush extends Instruction implements PushConstantInstruction
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setConstant(PoolEntry entry)
|
public Instruction setConstant(PoolEntry entry)
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -747,7 +747,8 @@ public class ModularArithmeticDeobfuscation implements Deobfuscator
|
|||||||
//assert m.setter == modInverse(m.getter);
|
//assert m.setter == modInverse(m.getter);
|
||||||
int newConstant = constant * m.setter;
|
int newConstant = constant * m.setter;
|
||||||
|
|
||||||
pc.setConstant(new net.runelite.deob.pool.Integer(newConstant));
|
Instruction i2 = pc.setConstant(new net.runelite.deob.pool.Integer(newConstant));
|
||||||
|
assert i2 == (Instruction) pc;
|
||||||
if (newConstant != 1)
|
if (newConstant != 1)
|
||||||
System.out.println("new constant: " + newConstant);
|
System.out.println("new constant: " + newConstant);
|
||||||
else
|
else
|
||||||
@@ -775,7 +776,8 @@ public class ModularArithmeticDeobfuscation implements Deobfuscator
|
|||||||
|
|
||||||
// field = setter * value, solve for value by * modInverse(setter)
|
// field = setter * value, solve for value by * modInverse(setter)
|
||||||
int newConstant = constant * m.getter;
|
int newConstant = constant * m.getter;
|
||||||
pi.setConstant(new net.runelite.deob.pool.Integer(newConstant));
|
Instruction i2 = pi.setConstant(new net.runelite.deob.pool.Integer(newConstant));
|
||||||
|
assert i2 == (Instruction) pi;
|
||||||
++replaced;
|
++replaced;
|
||||||
}
|
}
|
||||||
else if (value.getPushed().getInstruction() instanceof IMul)
|
else if (value.getPushed().getInstruction() instanceof IMul)
|
||||||
@@ -810,7 +812,8 @@ public class ModularArithmeticDeobfuscation implements Deobfuscator
|
|||||||
|
|
||||||
// field = expression * constant
|
// field = expression * constant
|
||||||
int newConstant = constant * m.getter;
|
int newConstant = constant * m.getter;
|
||||||
pc.setConstant(new net.runelite.deob.pool.Integer(newConstant));
|
Instruction i2 = pc.setConstant(new net.runelite.deob.pool.Integer(newConstant));
|
||||||
|
assert i2 == (Instruction) pc;
|
||||||
++replaced;
|
++replaced;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user