diff --git a/src/main/java/net/runelite/deob/attributes/code/instruction/types/DupInstruction.java b/src/main/java/net/runelite/deob/attributes/code/instruction/types/DupInstruction.java new file mode 100644 index 0000000000..6df5249512 --- /dev/null +++ b/src/main/java/net/runelite/deob/attributes/code/instruction/types/DupInstruction.java @@ -0,0 +1,6 @@ +package net.runelite.deob.attributes.code.instruction.types; + +public interface DupInstruction +{ + +} diff --git a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup.java b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup.java index 5c1743fae3..853f7ba849 100644 --- a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup.java +++ b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup.java @@ -1,5 +1,6 @@ package net.runelite.deob.attributes.code.instructions; +import java.io.IOException; import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.Instructions; @@ -7,10 +8,9 @@ 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.attributes.code.instruction.types.DupInstruction; -import java.io.IOException; - -public class Dup extends Instruction +public class Dup extends Instruction implements DupInstruction { public Dup(Instructions instructions, InstructionType type, int pc) throws IOException { @@ -27,11 +27,13 @@ public class Dup extends Instruction ins.pop(obj); StackContext ctx = new StackContext(ins, obj.getType()); + ctx.encryption = obj.encryption; stack.push(ctx); ins.push(ctx); ctx = new StackContext(ins, obj.getType()); + ctx.encryption = obj.encryption; stack.push(ctx); ins.push(ctx); diff --git a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2.java b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2.java index 7a0698ed8a..3f4e7578de 100644 --- a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2.java +++ b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2.java @@ -1,5 +1,6 @@ package net.runelite.deob.attributes.code.instructions; +import java.io.IOException; import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.Instructions; @@ -8,10 +9,9 @@ import net.runelite.deob.execution.InstructionContext; import net.runelite.deob.execution.Stack; import net.runelite.deob.execution.StackContext; import net.runelite.deob.execution.Type; +import net.runelite.deob.attributes.code.instruction.types.DupInstruction; -import java.io.IOException; - -public class Dup2 extends Instruction +public class Dup2 extends Instruction implements DupInstruction { public Dup2(Instructions instructions, InstructionType type, int pc) throws IOException { @@ -36,12 +36,14 @@ public class Dup2 extends Instruction if (two != null) { StackContext ctx = new StackContext(ins, two.getType()); + ctx.encryption = two.encryption; stack.push(ctx); ins.push(ctx); } StackContext ctx = new StackContext(ins, one.getType()); + ctx.encryption = one.encryption; stack.push(one); ins.push(ctx); @@ -49,12 +51,14 @@ public class Dup2 extends Instruction if (two != null) { ctx = new StackContext(ins, two.getType()); + ctx.encryption = two.encryption; stack.push(ctx); ins.push(ctx); } ctx = new StackContext(ins, one.getType()); + ctx.encryption = one.encryption; stack.push(one); ins.push(ctx); diff --git a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2_X1.java b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2_X1.java index b7dbfaacf9..ea1da1d658 100644 --- a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2_X1.java +++ b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2_X1.java @@ -1,5 +1,6 @@ package net.runelite.deob.attributes.code.instructions; +import java.io.IOException; import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.Instructions; @@ -8,10 +9,9 @@ import net.runelite.deob.execution.InstructionContext; import net.runelite.deob.execution.Stack; import net.runelite.deob.execution.StackContext; import net.runelite.deob.execution.Type; +import net.runelite.deob.attributes.code.instruction.types.DupInstruction; -import java.io.IOException; - -public class Dup2_X1 extends Instruction +public class Dup2_X1 extends Instruction implements DupInstruction { public Dup2_X1(Instructions instructions, InstructionType type, int pc) throws IOException { @@ -38,17 +38,20 @@ public class Dup2_X1 extends Instruction if (two != null) { StackContext ctx = new StackContext(ins, two.getType()); + ctx.encryption = two.encryption; stack.push(ctx); ins.push(ctx); } StackContext ctx = new StackContext(ins, one.getType()); + ctx.encryption = one.encryption; stack.push(ctx); ins.push(ctx); ctx = new StackContext(ins, three.getType()); + ctx.encryption = three.encryption; stack.push(ctx); ins.push(ctx); @@ -56,12 +59,14 @@ public class Dup2_X1 extends Instruction if (two != null) { ctx = new StackContext(ins, two.getType()); + ctx.encryption = two.encryption; stack.push(ctx); ins.push(ctx); } ctx = new StackContext(ins, one.getType()); + ctx.encryption = one.encryption; stack.push(ctx); ins.push(ctx); diff --git a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2_X2.java b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2_X2.java index 367e86885f..60553bd5f9 100644 --- a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2_X2.java +++ b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup2_X2.java @@ -1,5 +1,6 @@ package net.runelite.deob.attributes.code.instructions; +import java.io.IOException; import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.Instructions; @@ -8,10 +9,9 @@ import net.runelite.deob.execution.InstructionContext; import net.runelite.deob.execution.Stack; import net.runelite.deob.execution.StackContext; import net.runelite.deob.execution.Type; +import net.runelite.deob.attributes.code.instruction.types.DupInstruction; -import java.io.IOException; - -public class Dup2_X2 extends Instruction +public class Dup2_X2 extends Instruction implements DupInstruction { public Dup2_X2(Instructions instructions, InstructionType type, int pc) throws IOException { @@ -43,12 +43,14 @@ public class Dup2_X2 extends Instruction if (two != null) { StackContext ctx = new StackContext(ins, two.getType()); + ctx.encryption = two.encryption; stack.push(ctx); ins.push(ctx); } StackContext ctx = new StackContext(ins, one.getType()); + ctx.encryption = one.encryption; stack.push(one); ins.push(ctx); @@ -56,12 +58,14 @@ public class Dup2_X2 extends Instruction if (four != null) { ctx = new StackContext(ins, four.getType()); + ctx.encryption = four.encryption; stack.push(ctx); ins.push(ctx); } ctx = new StackContext(ins, three.getType()); + ctx.encryption = three.encryption; stack.push(one); ins.push(ctx); @@ -69,12 +73,14 @@ public class Dup2_X2 extends Instruction if (two != null) { ctx = new StackContext(ins, two.getType()); + ctx.encryption = two.encryption; stack.push(ctx); ins.push(ctx); } ctx = new StackContext(ins, one.getType()); + ctx.encryption = one.encryption; stack.push(one); ins.push(ctx); diff --git a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup_X1.java b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup_X1.java index defb3440de..3ee57b8797 100644 --- a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup_X1.java +++ b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup_X1.java @@ -1,5 +1,6 @@ package net.runelite.deob.attributes.code.instructions; +import java.io.IOException; import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.Instructions; @@ -7,10 +8,9 @@ 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.attributes.code.instruction.types.DupInstruction; -import java.io.IOException; - -public class Dup_X1 extends Instruction +public class Dup_X1 extends Instruction implements DupInstruction { public Dup_X1(Instructions instructions, InstructionType type, int pc) throws IOException { diff --git a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup_X2.java b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup_X2.java index 55412a94a2..5df005d458 100644 --- a/src/main/java/net/runelite/deob/attributes/code/instructions/Dup_X2.java +++ b/src/main/java/net/runelite/deob/attributes/code/instructions/Dup_X2.java @@ -1,5 +1,6 @@ package net.runelite.deob.attributes.code.instructions; +import java.io.IOException; import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.Instructions; @@ -8,10 +9,9 @@ import net.runelite.deob.execution.InstructionContext; import net.runelite.deob.execution.Stack; import net.runelite.deob.execution.StackContext; import net.runelite.deob.execution.Type; +import net.runelite.deob.attributes.code.instruction.types.DupInstruction; -import java.io.IOException; - -public class Dup_X2 extends Instruction +public class Dup_X2 extends Instruction implements DupInstruction { public Dup_X2(Instructions instructions, InstructionType type, int pc) throws IOException { @@ -35,6 +35,7 @@ public class Dup_X2 extends Instruction ins.pop(three); StackContext ctx = new StackContext(ins, one.getType()); + ctx.encryption = one.encryption; stack.push(ctx); ins.push(ctx); @@ -42,17 +43,20 @@ public class Dup_X2 extends Instruction if (three != null) { ctx = new StackContext(ins, three.getType()); + ctx.encryption = three.encryption; stack.push(ctx); ins.push(ctx); } ctx = new StackContext(ins, two.getType()); + ctx.encryption = two.encryption; stack.push(ctx); ins.push(ctx); ctx = new StackContext(ins, one.getType()); + ctx.encryption = one.encryption; stack.push(ctx); ins.push(ctx);