use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class DupDeobfuscator method undup_x1.
private void undup_x1(InstructionContext ictx) {
assert ictx.getInstruction() instanceof Dup_X1;
Instructions instructions = ictx.getInstruction().getInstructions();
StackContext duplicated = ictx.getPops().get(0);
// replace dup_x1 with swap
int idx = instructions.replace(ictx.getInstruction(), new Swap(instructions));
// copy imul and insert after idx
copy(duplicated, instructions, idx + 1);
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class DupDeobfuscator method undup.
private void undup(InstructionContext ictx) {
assert ictx.getInstruction() instanceof Dup;
Instructions instructions = ictx.getInstruction().getInstructions();
StackContext duplicated = ictx.getPops().get(0);
int idx = instructions.getInstructions().indexOf(ictx.getInstruction());
assert idx != -1;
// replace dup with duplicated instructions
instructions.remove(ictx.getInstruction());
// insert copy
copy(duplicated, instructions, idx);
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class Pop2 method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext value = stack.pop();
ins.pop(value);
if (value.getType().getSize() == 2)
return ins;
value = stack.pop();
ins.pop(value);
return ins;
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class PutField method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext value = stack.pop();
StackContext object = stack.pop();
ins.pop(value, object);
if (myField != null) {
frame.getExecution().order(frame, myField);
}
return ins;
}
use of net.runelite.asm.execution.StackContext in project runelite by runelite.
the class PutField method canMap.
@Override
public boolean canMap(InstructionContext thisIc) {
StackContext value = thisIc.getPops().get(0);
Instruction i = value.getPushed().getInstruction();
// which are all constants, so we ignore those mappings here
if (thisIc.getFrame().getMethod().getName().equals("<init>")) {
if (i instanceof PushConstantInstruction || i instanceof AConstNull) {
return false;
}
}
return true;
}
Aggregations