Start tracking values places if possible. Interesting changes to iinc where vctx now has no stack contextt (as it shouldn't?). Not sure what else that will break.
This commit is contained in:
@@ -27,7 +27,7 @@ public class AALoad extends Instruction implements ArrayLoad
|
||||
|
||||
ins.pop(index, array);
|
||||
|
||||
StackContext ctx = new StackContext(ins, array.getType().getSubtype());
|
||||
StackContext ctx = new StackContext(ins, array.getType().getSubtype(), array.getValue().arrayGet(index.getValue()));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -28,6 +28,8 @@ public class AAStore extends Instruction implements ArrayStore
|
||||
|
||||
ins.pop(value, index, array);
|
||||
|
||||
array.getValue().arraySet(index.getValue(), value.getValue());
|
||||
|
||||
frame.addInstructionContext(ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class AConstNull extends Instruction
|
||||
{
|
||||
@@ -23,7 +24,7 @@ public class AConstNull extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, Object.class);
|
||||
StackContext ctx = new StackContext(ins, Object.class, Value.NULL);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -71,7 +71,7 @@ public class ALoad extends Instruction implements LVTInstruction, WideInstructio
|
||||
VariableContext vctx = var.get(index);
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ALoad_0 extends Instruction implements LVTInstruction
|
||||
VariableContext vctx = var.get(0);
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ALoad_1 extends Instruction implements LVTInstruction
|
||||
VariableContext vctx = var.get(1);
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ALoad_2 extends Instruction implements LVTInstruction
|
||||
VariableContext vctx = var.get(2);
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ALoad_3 extends Instruction implements LVTInstruction
|
||||
VariableContext vctx = var.get(3);
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.ClassGroup;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class ANewArray extends Instruction
|
||||
{
|
||||
@@ -53,7 +54,7 @@ public class ANewArray extends Instruction
|
||||
ins.pop(count);
|
||||
|
||||
Type t = new Type(new net.runelite.deob.signature.Type("[" + clazz.getName()));
|
||||
StackContext ctx = new StackContext(ins, t);
|
||||
StackContext ctx = new StackContext(ins, t, Value.newArray(count.getValue()));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ArrayLength extends Instruction
|
||||
|
||||
ins.pop(array);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, array.getValue().arrayLength());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class BALoad extends Instruction implements ArrayLoad
|
||||
|
||||
ins.pop(index, array);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class); // sign extend
|
||||
StackContext ctx = new StackContext(ins, int.class, array.getValue().arrayGet(index.getValue()).cast(int.class)); // sign extend
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -28,6 +28,8 @@ public class BAStore extends Instruction implements ArrayStore
|
||||
|
||||
ins.pop(value, index, array);
|
||||
|
||||
array.getValue().arraySet(index.getValue(), value.getValue());
|
||||
|
||||
frame.addInstructionContext(ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.runelite.deob.pool.PoolEntry;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class BiPush extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -43,7 +44,7 @@ public class BiPush extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class); // bipush sign extends the value to an int
|
||||
StackContext ctx = new StackContext(ins, int.class, new Value((int) b)); // bipush sign extends the value to an int
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class CALoad extends Instruction implements ArrayLoad
|
||||
|
||||
ins.pop(index, array);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class); // zero extended to int
|
||||
StackContext ctx = new StackContext(ins, int.class, array.getValue().arrayGet(index.getValue()).cast(int.class)); // zero extended to int
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -28,6 +28,8 @@ public class CAStore extends Instruction implements ArrayStore
|
||||
|
||||
ins.pop(value, index, array);
|
||||
|
||||
array.getValue().arraySet(index.getValue(), value.getValue());
|
||||
|
||||
frame.addInstructionContext(ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.ClassGroup;
|
||||
import net.runelite.deob.execution.Type;
|
||||
|
||||
public class CheckCast extends Instruction
|
||||
{
|
||||
@@ -49,7 +50,10 @@ public class CheckCast extends Instruction
|
||||
|
||||
ins.pop(value);
|
||||
|
||||
StackContext ctx = new StackContext(ins, value.getType());
|
||||
StackContext ctx = new StackContext(ins,
|
||||
new Type(new net.runelite.deob.signature.Type(clazz.getName())),
|
||||
value.getValue()
|
||||
);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class D2F extends Instruction
|
||||
|
||||
ins.pop(value);
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
StackContext ctx = new StackContext(ins, float.class, value.getValue().cast(float.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class D2I extends Instruction
|
||||
|
||||
ins.pop(value);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, value.getValue().cast(int.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class D2L extends Instruction
|
||||
|
||||
ins.pop(value);
|
||||
|
||||
StackContext ctx = new StackContext(ins, long.class);
|
||||
StackContext ctx = new StackContext(ins, long.class, value.getValue().cast(long.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class DALoad extends Instruction implements ArrayLoad
|
||||
|
||||
ins.pop(index, array);
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
StackContext ctx = new StackContext(ins, double.class, array.getValue().arrayGet(index.getValue()).cast(double.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -28,6 +28,8 @@ public class DAStore extends Instruction implements ArrayStore
|
||||
|
||||
ins.pop(value, index, array);
|
||||
|
||||
array.getValue().arraySet(index.getValue(), value.getValue());
|
||||
|
||||
frame.addInstructionContext(ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class DAdd extends Instruction
|
||||
{
|
||||
@@ -26,7 +27,16 @@ public class DAdd extends Instruction
|
||||
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
double d2 = (double) two.getValue().getValue(),
|
||||
d1 = (double) one.getValue().getValue();
|
||||
|
||||
result = new Value(d1 + d2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class DCmpG extends Instruction
|
||||
{
|
||||
@@ -23,12 +24,26 @@ public class DCmpG extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
double d2 = (double) two.getValue().getValue(),
|
||||
d1 = (double) one.getValue().getValue();
|
||||
|
||||
if (d1 > d2)
|
||||
result = new Value(1);
|
||||
else if (d1 == d2)
|
||||
result = new Value(0);
|
||||
else if (d1 < d2)
|
||||
result = new Value(-1);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class DCmpL extends Instruction
|
||||
{
|
||||
@@ -23,12 +24,26 @@ public class DCmpL extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
double d2 = (double) two.getValue().getValue(),
|
||||
d1 = (double) one.getValue().getValue();
|
||||
|
||||
if (d1 > d2)
|
||||
result = new Value(1);
|
||||
else if (d1 == d2)
|
||||
result = new Value(0);
|
||||
else if (d1 < d2)
|
||||
result = new Value(-1);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class DConst_0 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -25,7 +26,7 @@ public class DConst_0 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
StackContext ctx = new StackContext(ins, double.class, new Value(0d));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class DConst_1 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -25,7 +26,7 @@ public class DConst_1 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
StackContext ctx = new StackContext(ins, double.class, new Value(1d));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class DDiv extends Instruction
|
||||
{
|
||||
@@ -21,12 +22,21 @@ public class DDiv extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
double d2 = (double) two.getValue().getValue(),
|
||||
d1 = (double) one.getValue().getValue();
|
||||
|
||||
result = new Value(d1 / d2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -73,7 +73,7 @@ public class DLoad extends Instruction implements LVTInstruction, WideInstructio
|
||||
assert vctx.getType().equals(new Type(double.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DLoad_0 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(double.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DLoad_1 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(double.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DLoad_2 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(double.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DLoad_3 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(double.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class DMul extends Instruction
|
||||
{
|
||||
@@ -21,12 +22,21 @@ public class DMul extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
double d2 = (double) two.getValue().getValue(),
|
||||
d1 = (double) one.getValue().getValue();
|
||||
|
||||
result = new Value(d1 * d2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class DNeg extends Instruction
|
||||
{
|
||||
@@ -24,7 +25,15 @@ public class DNeg extends Instruction
|
||||
StackContext value = stack.pop();
|
||||
ins.pop(value);
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
Value result = Value.NULL;
|
||||
if (!value.getValue().isNull())
|
||||
{
|
||||
double d = (double) value.getValue().getValue();
|
||||
|
||||
result = new Value(-d);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class DRem extends Instruction
|
||||
{
|
||||
@@ -21,12 +22,21 @@ public class DRem extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
double d2 = (double) two.getValue().getValue(),
|
||||
d1 = (double) one.getValue().getValue();
|
||||
|
||||
result = new Value(d1 % d2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class DSub extends Instruction
|
||||
{
|
||||
@@ -26,7 +27,16 @@ public class DSub extends Instruction
|
||||
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
double d2 = (double) two.getValue().getValue(),
|
||||
d1 = (double) one.getValue().getValue();
|
||||
|
||||
result = new Value(d1 - d2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -27,12 +27,12 @@ public class Dup extends Instruction implements DupInstruction
|
||||
StackContext obj = stack.pop();
|
||||
ins.pop(obj);
|
||||
|
||||
StackContext ctx = new StackContext(ins, obj.getType());
|
||||
StackContext ctx = new StackContext(ins, obj.getType(), obj.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
ctx = new StackContext(ins, obj.getType());
|
||||
ctx = new StackContext(ins, obj.getType(), obj.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -35,26 +35,26 @@ public class Dup2 extends Instruction implements DupInstruction
|
||||
|
||||
if (two != null)
|
||||
{
|
||||
StackContext ctx = new StackContext(ins, two.getType());
|
||||
StackContext ctx = new StackContext(ins, two.getType(), two.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, one.getType());
|
||||
StackContext ctx = new StackContext(ins, one.getType(), one.getValue());
|
||||
stack.push(one);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
if (two != null)
|
||||
{
|
||||
ctx = new StackContext(ins, two.getType());
|
||||
ctx = new StackContext(ins, two.getType(), two.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
}
|
||||
|
||||
ctx = new StackContext(ins, one.getType());
|
||||
ctx = new StackContext(ins, one.getType(), one.getValue());
|
||||
stack.push(one);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -42,31 +42,31 @@ public class Dup2_X1 extends Instruction implements DupInstruction
|
||||
|
||||
if (two != null)
|
||||
{
|
||||
StackContext ctx = new StackContext(ins, two.getType());
|
||||
StackContext ctx = new StackContext(ins, two.getType(), two.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, one.getType());
|
||||
StackContext ctx = new StackContext(ins, one.getType(), one.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
ctx = new StackContext(ins, three.getType());
|
||||
ctx = new StackContext(ins, three.getType(), three.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
if (two != null)
|
||||
{
|
||||
ctx = new StackContext(ins, two.getType());
|
||||
ctx = new StackContext(ins, two.getType(), two.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
}
|
||||
|
||||
ctx = new StackContext(ins, one.getType());
|
||||
ctx = new StackContext(ins, one.getType(), one.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -42,39 +42,39 @@ public class Dup2_X2 extends Instruction implements DupInstruction
|
||||
|
||||
if (two != null)
|
||||
{
|
||||
StackContext ctx = new StackContext(ins, two.getType());
|
||||
StackContext ctx = new StackContext(ins, two.getType(), two.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, one.getType());
|
||||
StackContext ctx = new StackContext(ins, one.getType(), one.getValue());
|
||||
stack.push(one);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
if (four != null)
|
||||
{
|
||||
ctx = new StackContext(ins, four.getType());
|
||||
ctx = new StackContext(ins, four.getType(), four.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
}
|
||||
|
||||
ctx = new StackContext(ins, three.getType());
|
||||
ctx = new StackContext(ins, three.getType(), three.getValue());
|
||||
stack.push(one);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
if (two != null)
|
||||
{
|
||||
ctx = new StackContext(ins, two.getType());
|
||||
ctx = new StackContext(ins, two.getType(), two.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
}
|
||||
|
||||
ctx = new StackContext(ins, one.getType());
|
||||
ctx = new StackContext(ins, one.getType(), one.getValue());
|
||||
stack.push(one);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -33,17 +33,17 @@ public class Dup_X1 extends Instruction implements DupInstruction
|
||||
|
||||
ins.pop(one, two);
|
||||
|
||||
StackContext ctx = new StackContext(ins, one.getType());
|
||||
StackContext ctx = new StackContext(ins, one.getType(), one.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
ctx = new StackContext(ins, two.getType());
|
||||
ctx = new StackContext(ins, two.getType(), two.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
ctx = new StackContext(ins, one.getType());
|
||||
ctx = new StackContext(ins, one.getType(), one.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -34,25 +34,25 @@ public class Dup_X2 extends Instruction implements DupInstruction
|
||||
if (three != null)
|
||||
ins.pop(three);
|
||||
|
||||
StackContext ctx = new StackContext(ins, one.getType());
|
||||
StackContext ctx = new StackContext(ins, one.getType(), one.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
if (three != null)
|
||||
{
|
||||
ctx = new StackContext(ins, three.getType());
|
||||
ctx = new StackContext(ins, three.getType(), three.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
}
|
||||
|
||||
ctx = new StackContext(ins, two.getType());
|
||||
ctx = new StackContext(ins, two.getType(), two.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
ctx = new StackContext(ins, one.getType());
|
||||
ctx = new StackContext(ins, one.getType(), one.getValue());
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class F2D extends Instruction
|
||||
StackContext object = stack.pop();
|
||||
ins.pop(object);
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
StackContext ctx = new StackContext(ins, double.class, object.getValue().cast(double.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class F2I extends Instruction
|
||||
StackContext object = stack.pop();
|
||||
ins.pop(object);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, object.getValue().cast(int.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class F2L extends Instruction
|
||||
StackContext object = stack.pop();
|
||||
ins.pop(object);
|
||||
|
||||
StackContext ctx = new StackContext(ins, long.class);
|
||||
StackContext ctx = new StackContext(ins, long.class, object.getValue().cast(long.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class FALoad extends Instruction implements ArrayLoad
|
||||
|
||||
ins.pop(index, array);
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
StackContext ctx = new StackContext(ins, float.class, array.getValue().arrayGet(index.getValue()).cast(float.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -28,6 +28,8 @@ public class FAStore extends Instruction implements ArrayStore
|
||||
|
||||
ins.pop(value, index, array);
|
||||
|
||||
array.getValue().arraySet(index.getValue(), value.getValue());
|
||||
|
||||
frame.addInstructionContext(ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class FAdd extends Instruction
|
||||
{
|
||||
@@ -26,7 +27,16 @@ public class FAdd extends Instruction
|
||||
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
float f2 = (float) two.getValue().getValue(),
|
||||
f1 = (float) one.getValue().getValue();
|
||||
|
||||
result = new Value(f1 + f2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class FCmpG extends Instruction
|
||||
{
|
||||
@@ -23,12 +24,26 @@ public class FCmpG extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
float f2 = (float) two.getValue().getValue(),
|
||||
f1 = (float) one.getValue().getValue();
|
||||
|
||||
if (f1 > f2)
|
||||
result = new Value(1);
|
||||
else if (f1 == f2)
|
||||
result = new Value(0);
|
||||
else if (f1 < f2)
|
||||
result = new Value(-1);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class FCmpL extends Instruction
|
||||
{
|
||||
@@ -23,12 +24,26 @@ public class FCmpL extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
float f2 = (float) two.getValue().getValue(),
|
||||
f1 = (float) one.getValue().getValue();
|
||||
|
||||
if (f1 > f2)
|
||||
result = new Value(1);
|
||||
else if (f1 == f2)
|
||||
result = new Value(0);
|
||||
else if (f1 < f2)
|
||||
result = new Value(-1);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class FConst_0 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -25,7 +26,7 @@ public class FConst_0 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
StackContext ctx = new StackContext(ins, float.class, new Value(0f));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class FConst_1 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -25,7 +26,7 @@ public class FConst_1 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
StackContext ctx = new StackContext(ins, float.class, new Value(1f));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class FConst_2 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -25,7 +26,7 @@ public class FConst_2 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
StackContext ctx = new StackContext(ins, float.class, new Value(2f));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class FDiv extends Instruction
|
||||
{
|
||||
@@ -21,12 +22,21 @@ public class FDiv extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
float f2 = (float) two.getValue().getValue(),
|
||||
f1 = (float) one.getValue().getValue();
|
||||
|
||||
result = new Value(f1 / f2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -73,7 +73,7 @@ public class FLoad extends Instruction implements LVTInstruction, WideInstructio
|
||||
assert vctx.getType().equals(new Type(float.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class FLoad_0 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(float.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class FLoad_1 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(float.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class FLoad_2 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(float.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class FLoad_3 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(float.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class FMul extends Instruction
|
||||
{
|
||||
@@ -21,12 +22,21 @@ public class FMul extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
float f2 = (float) two.getValue().getValue(),
|
||||
f1 = (float) one.getValue().getValue();
|
||||
|
||||
result = new Value(f1 * f2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class FNeg extends Instruction
|
||||
{
|
||||
@@ -24,7 +25,15 @@ public class FNeg extends Instruction
|
||||
StackContext value = stack.pop();
|
||||
ins.pop(value);
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
Value result = Value.NULL;
|
||||
if (!value.getValue().isNull())
|
||||
{
|
||||
float f = (float) value.getValue().getValue();
|
||||
|
||||
result = new Value(-f);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class FRem extends Instruction
|
||||
{
|
||||
@@ -21,12 +22,21 @@ public class FRem extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
float d2 = (float) two.getValue().getValue(),
|
||||
d1 = (float) one.getValue().getValue();
|
||||
|
||||
result = new Value(d1 % d2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class FSub extends Instruction
|
||||
{
|
||||
@@ -26,7 +27,16 @@ public class FSub extends Instruction
|
||||
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
float f2 = (float) two.getValue().getValue(),
|
||||
f1 = (float) one.getValue().getValue();
|
||||
|
||||
result = new Value(f1 - f2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.runelite.deob.pool.NameAndType;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class GetField extends Instruction implements GetFieldInstruction
|
||||
{
|
||||
@@ -51,7 +52,7 @@ public class GetField extends Instruction implements GetFieldInstruction
|
||||
StackContext object = stack.pop();
|
||||
ins.pop(object);
|
||||
|
||||
StackContext ctx = new StackContext(ins, new Type(field.getNameAndType().getDescriptorType()).toStackType());
|
||||
StackContext ctx = new StackContext(ins, new Type(field.getNameAndType().getDescriptorType()).toStackType(), Value.NULL);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.runelite.deob.pool.NameAndType;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class GetStatic extends Instruction implements GetFieldInstruction
|
||||
{
|
||||
@@ -55,7 +56,7 @@ public class GetStatic extends Instruction implements GetFieldInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, new Type(field.getNameAndType().getDescriptorType()).toStackType());
|
||||
StackContext ctx = new StackContext(ins, new Type(field.getNameAndType().getDescriptorType()).toStackType(), Value.NULL);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class I2B extends Instruction
|
||||
StackContext object = stack.pop();
|
||||
ins.pop(object);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class); // sign extneded
|
||||
StackContext ctx = new StackContext(ins, int.class, object.getValue().cast(int.class)); // sign extneded
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class I2C extends Instruction
|
||||
StackContext object = stack.pop();
|
||||
ins.pop(object);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class); // sign extended
|
||||
StackContext ctx = new StackContext(ins, int.class, object.getValue().cast(int.class)); // sign extended
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class I2D extends Instruction
|
||||
StackContext object = stack.pop();
|
||||
ins.pop(object);
|
||||
|
||||
StackContext ctx = new StackContext(ins, double.class);
|
||||
StackContext ctx = new StackContext(ins, double.class, object.getValue().cast(double.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class I2F extends Instruction
|
||||
StackContext object = stack.pop();
|
||||
ins.pop(object);
|
||||
|
||||
StackContext ctx = new StackContext(ins, float.class);
|
||||
StackContext ctx = new StackContext(ins, float.class, object.getValue().cast(float.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class I2L extends Instruction
|
||||
StackContext object = stack.pop();
|
||||
ins.pop(object);
|
||||
|
||||
StackContext ctx = new StackContext(ins, long.class);
|
||||
StackContext ctx = new StackContext(ins, long.class, object.getValue().cast(long.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class I2S extends Instruction
|
||||
StackContext object = stack.pop();
|
||||
ins.pop(object);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class); // sign extended
|
||||
StackContext ctx = new StackContext(ins, int.class, object.getValue().cast(int.class)); // sign extended
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class IALoad extends Instruction implements ArrayLoad
|
||||
|
||||
ins.pop(index, array);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, array.getValue().arrayGet(index.getValue()).cast(int.class));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -28,6 +28,8 @@ public class IAStore extends Instruction implements ArrayStore
|
||||
|
||||
ins.pop(value, index, array);
|
||||
|
||||
array.getValue().arraySet(index.getValue(), value.getValue());
|
||||
|
||||
frame.addInstructionContext(ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IAdd extends Instruction
|
||||
{
|
||||
@@ -34,7 +35,16 @@ public class IAdd extends Instruction
|
||||
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
int i2 = (int) two.getValue().getValue(),
|
||||
i1 = (int) one.getValue().getValue();
|
||||
|
||||
result = new Value(i1 + i2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IAnd extends Instruction
|
||||
{
|
||||
@@ -26,7 +27,16 @@ public class IAnd extends Instruction
|
||||
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
int i2 = (int) two.getValue().getValue(),
|
||||
i1 = (int) one.getValue().getValue();
|
||||
|
||||
result = new Value(i1 & i2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IConst_0 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -30,7 +31,7 @@ public class IConst_0 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, new Value(0));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IConst_1 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -30,7 +31,7 @@ public class IConst_1 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, new Value(1));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IConst_2 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -30,7 +31,7 @@ public class IConst_2 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, new Value(2));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IConst_3 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -30,7 +31,7 @@ public class IConst_3 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, new Value(3));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IConst_4 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -30,7 +31,7 @@ public class IConst_4 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, new Value(4));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IConst_5 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -30,7 +31,7 @@ public class IConst_5 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, new Value(5));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.pool.PoolEntry;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IConst_M1 extends Instruction implements PushConstantInstruction
|
||||
{
|
||||
@@ -30,7 +31,7 @@ public class IConst_M1 extends Instruction implements PushConstantInstruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, new Value(-1));
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IDiv extends Instruction
|
||||
{
|
||||
@@ -26,12 +27,22 @@ public class IDiv extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
int i2 = (int) two.getValue().getValue(),
|
||||
i1 = (int) one.getValue().getValue();
|
||||
|
||||
if (i2 != 0)
|
||||
result = new Value(i1 / i2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.runelite.deob.execution.Variables;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IInc extends Instruction implements LVTInstruction, WideInstruction
|
||||
{
|
||||
@@ -67,7 +68,15 @@ public class IInc extends Instruction implements LVTInstruction, WideInstruction
|
||||
assert vctx.getType().equals(new Type(int.class.getCanonicalName()));
|
||||
ins.read(vctx);
|
||||
|
||||
vctx = new VariableContext(ins, vctx);
|
||||
Value value = vctx.getValue();
|
||||
if (!vctx.getValue().isNull())
|
||||
{
|
||||
int i = (int) vctx.getValue().getValue();
|
||||
i += inc;
|
||||
value = new Value(i);
|
||||
}
|
||||
|
||||
vctx = new VariableContext(ins, new Type(int.class.getCanonicalName()), value);
|
||||
var.set(index, vctx);
|
||||
|
||||
frame.addInstructionContext(ins);
|
||||
|
||||
@@ -73,7 +73,7 @@ public class ILoad extends Instruction implements LVTInstruction, WideInstructio
|
||||
assert vctx.getType().equals(new Type(int.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ILoad_0 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(int.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ILoad_1 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(int.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ILoad_2 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(int.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ILoad_3 extends Instruction implements LVTInstruction
|
||||
assert vctx.getType().equals(new Type(int.class.getName()));
|
||||
ins.read(vctx);
|
||||
|
||||
StackContext ctx = new StackContext(ins, vctx.getType());
|
||||
StackContext ctx = new StackContext(ins, vctx);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IMul extends Instruction
|
||||
{
|
||||
@@ -30,12 +31,21 @@ public class IMul extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
int i2 = (int) two.getValue().getValue(),
|
||||
i1 = (int) one.getValue().getValue();
|
||||
|
||||
result = new Value(i1 * i2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class INeg extends Instruction
|
||||
{
|
||||
@@ -24,7 +25,15 @@ public class INeg extends Instruction
|
||||
StackContext value = stack.pop();
|
||||
ins.pop(value);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!value.getValue().isNull())
|
||||
{
|
||||
int i = (int) value.getValue().getValue();
|
||||
|
||||
result = new Value(-i);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IOr extends Instruction
|
||||
{
|
||||
@@ -26,7 +27,16 @@ public class IOr extends Instruction
|
||||
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
int i2 = (int) two.getValue().getValue(),
|
||||
i1 = (int) one.getValue().getValue();
|
||||
|
||||
result = new Value(i1 | i2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IRem extends Instruction
|
||||
{
|
||||
@@ -21,12 +22,21 @@ public class IRem extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
int i2 = (int) two.getValue().getValue(),
|
||||
i1 = (int) one.getValue().getValue();
|
||||
|
||||
result = new Value(i1 % i2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IShL extends Instruction
|
||||
{
|
||||
@@ -21,12 +22,21 @@ public class IShL extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
int i2 = (int) two.getValue().getValue(),
|
||||
i1 = (int) one.getValue().getValue();
|
||||
|
||||
result = new Value(i1 << i2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IShR extends Instruction
|
||||
{
|
||||
@@ -21,12 +22,21 @@ public class IShR extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
int i2 = (int) two.getValue().getValue(),
|
||||
i1 = (int) one.getValue().getValue();
|
||||
|
||||
result = new Value(i1 >> i2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class ISub extends Instruction
|
||||
{
|
||||
@@ -28,7 +29,16 @@ public class ISub extends Instruction
|
||||
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
int i2 = (int) two.getValue().getValue(),
|
||||
i1 = (int) one.getValue().getValue();
|
||||
|
||||
result = new Value(i1 - i2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IUShR extends Instruction
|
||||
{
|
||||
@@ -21,12 +22,21 @@ public class IUShR extends Instruction
|
||||
InstructionContext ins = new InstructionContext(this, frame);
|
||||
Stack stack = frame.getStack();
|
||||
|
||||
StackContext one = stack.pop();
|
||||
StackContext two = stack.pop();
|
||||
StackContext one = stack.pop();
|
||||
|
||||
ins.pop(one, two);
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
int i2 = (int) two.getValue().getValue(),
|
||||
i1 = (int) one.getValue().getValue();
|
||||
|
||||
result = new Value(i1 >>> i2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.Stack;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class IXor extends Instruction
|
||||
{
|
||||
@@ -26,7 +27,16 @@ public class IXor extends Instruction
|
||||
|
||||
ins.pop(two, one);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
Value result = Value.NULL;
|
||||
if (!two.getValue().isNull() && !one.getValue().isNull())
|
||||
{
|
||||
int i2 = (int) two.getValue().getValue(),
|
||||
i1 = (int) one.getValue().getValue();
|
||||
|
||||
result = new Value(i1 ^ i2);
|
||||
}
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class, result);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import net.runelite.deob.ClassGroup;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class InstanceOf extends Instruction
|
||||
{
|
||||
@@ -48,7 +49,7 @@ public class InstanceOf extends Instruction
|
||||
StackContext obj = stack.pop();
|
||||
ins.pop(obj);
|
||||
|
||||
StackContext ctx = new StackContext(ins, int.class);
|
||||
StackContext ctx = new StackContext(ins, int.class, Value.NULL);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import net.runelite.deob.execution.Execution;
|
||||
import net.runelite.deob.execution.Value;
|
||||
|
||||
public class InvokeInterface extends Instruction implements InvokeInstruction
|
||||
{
|
||||
@@ -88,7 +89,10 @@ public class InvokeInterface extends Instruction implements InvokeInstruction
|
||||
|
||||
if (!method.getNameAndType().isVoid())
|
||||
{
|
||||
StackContext ctx = new StackContext(ins, new Type(method.getNameAndType().getDescriptor().getReturnValue()).toStackType());
|
||||
StackContext ctx = new StackContext(ins,
|
||||
new Type(method.getNameAndType().getDescriptor().getReturnValue()).toStackType(),
|
||||
Value.NULL
|
||||
);
|
||||
stack.push(ctx);
|
||||
|
||||
ins.push(ctx);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user