dupinstruction, and enc

This commit is contained in:
Adam
2015-09-12 13:59:31 -04:00
parent 53234351f9
commit c463687202
7 changed files with 45 additions and 18 deletions

View File

@@ -0,0 +1,6 @@
package net.runelite.deob.attributes.code.instruction.types;
public interface DupInstruction
{
}

View File

@@ -1,5 +1,6 @@
package net.runelite.deob.attributes.code.instructions; package net.runelite.deob.attributes.code.instructions;
import java.io.IOException;
import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.Instruction;
import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.InstructionType;
import net.runelite.deob.attributes.code.Instructions; 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.InstructionContext;
import net.runelite.deob.execution.Stack; import net.runelite.deob.execution.Stack;
import net.runelite.deob.execution.StackContext; import net.runelite.deob.execution.StackContext;
import net.runelite.deob.attributes.code.instruction.types.DupInstruction;
import java.io.IOException; public class Dup extends Instruction implements DupInstruction
public class Dup extends Instruction
{ {
public Dup(Instructions instructions, InstructionType type, int pc) throws IOException public Dup(Instructions instructions, InstructionType type, int pc) throws IOException
{ {
@@ -27,11 +27,13 @@ public class Dup extends Instruction
ins.pop(obj); ins.pop(obj);
StackContext ctx = new StackContext(ins, obj.getType()); StackContext ctx = new StackContext(ins, obj.getType());
ctx.encryption = obj.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
ctx = new StackContext(ins, obj.getType()); ctx = new StackContext(ins, obj.getType());
ctx.encryption = obj.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);

View File

@@ -1,5 +1,6 @@
package net.runelite.deob.attributes.code.instructions; package net.runelite.deob.attributes.code.instructions;
import java.io.IOException;
import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.Instruction;
import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.InstructionType;
import net.runelite.deob.attributes.code.Instructions; 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.Stack;
import net.runelite.deob.execution.StackContext; import net.runelite.deob.execution.StackContext;
import net.runelite.deob.execution.Type; import net.runelite.deob.execution.Type;
import net.runelite.deob.attributes.code.instruction.types.DupInstruction;
import java.io.IOException; public class Dup2 extends Instruction implements DupInstruction
public class Dup2 extends Instruction
{ {
public Dup2(Instructions instructions, InstructionType type, int pc) throws IOException public Dup2(Instructions instructions, InstructionType type, int pc) throws IOException
{ {
@@ -36,12 +36,14 @@ public class Dup2 extends Instruction
if (two != null) if (two != null)
{ {
StackContext ctx = new StackContext(ins, two.getType()); StackContext ctx = new StackContext(ins, two.getType());
ctx.encryption = two.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
} }
StackContext ctx = new StackContext(ins, one.getType()); StackContext ctx = new StackContext(ins, one.getType());
ctx.encryption = one.encryption;
stack.push(one); stack.push(one);
ins.push(ctx); ins.push(ctx);
@@ -49,12 +51,14 @@ public class Dup2 extends Instruction
if (two != null) if (two != null)
{ {
ctx = new StackContext(ins, two.getType()); ctx = new StackContext(ins, two.getType());
ctx.encryption = two.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
} }
ctx = new StackContext(ins, one.getType()); ctx = new StackContext(ins, one.getType());
ctx.encryption = one.encryption;
stack.push(one); stack.push(one);
ins.push(ctx); ins.push(ctx);

View File

@@ -1,5 +1,6 @@
package net.runelite.deob.attributes.code.instructions; package net.runelite.deob.attributes.code.instructions;
import java.io.IOException;
import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.Instruction;
import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.InstructionType;
import net.runelite.deob.attributes.code.Instructions; 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.Stack;
import net.runelite.deob.execution.StackContext; import net.runelite.deob.execution.StackContext;
import net.runelite.deob.execution.Type; 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 implements DupInstruction
public class Dup2_X1 extends Instruction
{ {
public Dup2_X1(Instructions instructions, InstructionType type, int pc) throws IOException public Dup2_X1(Instructions instructions, InstructionType type, int pc) throws IOException
{ {
@@ -38,17 +38,20 @@ public class Dup2_X1 extends Instruction
if (two != null) if (two != null)
{ {
StackContext ctx = new StackContext(ins, two.getType()); StackContext ctx = new StackContext(ins, two.getType());
ctx.encryption = two.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
} }
StackContext ctx = new StackContext(ins, one.getType()); StackContext ctx = new StackContext(ins, one.getType());
ctx.encryption = one.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
ctx = new StackContext(ins, three.getType()); ctx = new StackContext(ins, three.getType());
ctx.encryption = three.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
@@ -56,12 +59,14 @@ public class Dup2_X1 extends Instruction
if (two != null) if (two != null)
{ {
ctx = new StackContext(ins, two.getType()); ctx = new StackContext(ins, two.getType());
ctx.encryption = two.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
} }
ctx = new StackContext(ins, one.getType()); ctx = new StackContext(ins, one.getType());
ctx.encryption = one.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);

View File

@@ -1,5 +1,6 @@
package net.runelite.deob.attributes.code.instructions; package net.runelite.deob.attributes.code.instructions;
import java.io.IOException;
import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.Instruction;
import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.InstructionType;
import net.runelite.deob.attributes.code.Instructions; 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.Stack;
import net.runelite.deob.execution.StackContext; import net.runelite.deob.execution.StackContext;
import net.runelite.deob.execution.Type; 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 implements DupInstruction
public class Dup2_X2 extends Instruction
{ {
public Dup2_X2(Instructions instructions, InstructionType type, int pc) throws IOException public Dup2_X2(Instructions instructions, InstructionType type, int pc) throws IOException
{ {
@@ -43,12 +43,14 @@ public class Dup2_X2 extends Instruction
if (two != null) if (two != null)
{ {
StackContext ctx = new StackContext(ins, two.getType()); StackContext ctx = new StackContext(ins, two.getType());
ctx.encryption = two.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
} }
StackContext ctx = new StackContext(ins, one.getType()); StackContext ctx = new StackContext(ins, one.getType());
ctx.encryption = one.encryption;
stack.push(one); stack.push(one);
ins.push(ctx); ins.push(ctx);
@@ -56,12 +58,14 @@ public class Dup2_X2 extends Instruction
if (four != null) if (four != null)
{ {
ctx = new StackContext(ins, four.getType()); ctx = new StackContext(ins, four.getType());
ctx.encryption = four.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
} }
ctx = new StackContext(ins, three.getType()); ctx = new StackContext(ins, three.getType());
ctx.encryption = three.encryption;
stack.push(one); stack.push(one);
ins.push(ctx); ins.push(ctx);
@@ -69,12 +73,14 @@ public class Dup2_X2 extends Instruction
if (two != null) if (two != null)
{ {
ctx = new StackContext(ins, two.getType()); ctx = new StackContext(ins, two.getType());
ctx.encryption = two.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
} }
ctx = new StackContext(ins, one.getType()); ctx = new StackContext(ins, one.getType());
ctx.encryption = one.encryption;
stack.push(one); stack.push(one);
ins.push(ctx); ins.push(ctx);

View File

@@ -1,5 +1,6 @@
package net.runelite.deob.attributes.code.instructions; package net.runelite.deob.attributes.code.instructions;
import java.io.IOException;
import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.Instruction;
import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.InstructionType;
import net.runelite.deob.attributes.code.Instructions; 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.InstructionContext;
import net.runelite.deob.execution.Stack; import net.runelite.deob.execution.Stack;
import net.runelite.deob.execution.StackContext; 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 implements DupInstruction
public class Dup_X1 extends Instruction
{ {
public Dup_X1(Instructions instructions, InstructionType type, int pc) throws IOException public Dup_X1(Instructions instructions, InstructionType type, int pc) throws IOException
{ {

View File

@@ -1,5 +1,6 @@
package net.runelite.deob.attributes.code.instructions; package net.runelite.deob.attributes.code.instructions;
import java.io.IOException;
import net.runelite.deob.attributes.code.Instruction; import net.runelite.deob.attributes.code.Instruction;
import net.runelite.deob.attributes.code.InstructionType; import net.runelite.deob.attributes.code.InstructionType;
import net.runelite.deob.attributes.code.Instructions; 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.Stack;
import net.runelite.deob.execution.StackContext; import net.runelite.deob.execution.StackContext;
import net.runelite.deob.execution.Type; 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 implements DupInstruction
public class Dup_X2 extends Instruction
{ {
public Dup_X2(Instructions instructions, InstructionType type, int pc) throws IOException public Dup_X2(Instructions instructions, InstructionType type, int pc) throws IOException
{ {
@@ -35,6 +35,7 @@ public class Dup_X2 extends Instruction
ins.pop(three); ins.pop(three);
StackContext ctx = new StackContext(ins, one.getType()); StackContext ctx = new StackContext(ins, one.getType());
ctx.encryption = one.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
@@ -42,17 +43,20 @@ public class Dup_X2 extends Instruction
if (three != null) if (three != null)
{ {
ctx = new StackContext(ins, three.getType()); ctx = new StackContext(ins, three.getType());
ctx.encryption = three.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
} }
ctx = new StackContext(ins, two.getType()); ctx = new StackContext(ins, two.getType());
ctx.encryption = two.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);
ctx = new StackContext(ins, one.getType()); ctx = new StackContext(ins, one.getType());
ctx.encryption = one.encryption;
stack.push(ctx); stack.push(ctx);
ins.push(ctx); ins.push(ctx);