Instructions done
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class ANewArray extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
ANewArray(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class CheckCast extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
CheckCast(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
public class DLoad extends Instruction
|
public class DLoad extends Instruction
|
||||||
{
|
{
|
||||||
int index;
|
private int index;
|
||||||
|
|
||||||
DLoad(Instructions instructions, InstructionType type, int pc) throws IOException
|
DLoad(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
public class FLoad extends Instruction
|
public class FLoad extends Instruction
|
||||||
{
|
{
|
||||||
int index;
|
private int index;
|
||||||
|
|
||||||
FLoad(Instructions instructions, InstructionType type, int pc) throws IOException
|
FLoad(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class GetField extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
GetField(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class GetStatic extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
GetStatic(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
19
src/main/java/info/sigterm/deob/attributes/code/GotoW.java
Normal file
19
src/main/java/info/sigterm/deob/attributes/code/GotoW.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class GotoW extends Instruction
|
||||||
|
{
|
||||||
|
private int offset;
|
||||||
|
|
||||||
|
GotoW(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
offset = is.readInt();
|
||||||
|
length += 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class IfNonNull extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
IfNonNull(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
19
src/main/java/info/sigterm/deob/attributes/code/IfNull.java
Normal file
19
src/main/java/info/sigterm/deob/attributes/code/IfNull.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class IfNull extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
IfNull(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class InstanceOf extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
InstanceOf(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ public class Instruction
|
|||||||
private int pc;
|
private int pc;
|
||||||
protected int length = 1;
|
protected int length = 1;
|
||||||
|
|
||||||
Instruction(Instructions instructions, InstructionType type, int pc)
|
public Instruction(Instructions instructions, InstructionType type, int pc)
|
||||||
{
|
{
|
||||||
this.instructions = instructions;
|
this.instructions = instructions;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|||||||
@@ -163,43 +163,50 @@ public enum InstructionType
|
|||||||
IFLE(0x9e, "ifle", Branch.class),
|
IFLE(0x9e, "ifle", Branch.class),
|
||||||
IF_ICMPEQ(0x9f, "if_icmpeq", Branch.class),
|
IF_ICMPEQ(0x9f, "if_icmpeq", Branch.class),
|
||||||
IF_ICMPNE(0xa0, "if_icmpne", Branch.class),
|
IF_ICMPNE(0xa0, "if_icmpne", Branch.class),
|
||||||
IF_ICMPLT(0xa1, "if_cmplt", Branch.class);
|
IF_ICMPLT(0xa1, "if_cmplt", Branch.class),
|
||||||
|
IF_CMPGE(0xa2, "if_cmpge", Branch.class),
|
||||||
|
IF_CMPGT(0xa3, "if_cmpgt", Branch.class),
|
||||||
|
IF_CMPLE(0xa4, "if_cmple", Branch.class),
|
||||||
|
IF_ACMPEQ(0xa5, "if_acmpeq", Branch.class),
|
||||||
|
IF_ACMPNE(0xa6, "if_acmpne", Branch.class),
|
||||||
|
GOTO(0xa7, "goto", Branch.class),
|
||||||
|
JSR(0xa8, "jsr", Branch.class),
|
||||||
|
RET(0xa9, "ret", Ret.class),
|
||||||
|
TABLESWITCH(0xaa, "tableswitch", TableSwitch.class),
|
||||||
|
LOOKUPSWITCH(0xab, "lookupswitch", LookupSwitch.class),
|
||||||
|
IRETURN(0xac, "ireturn", Instruction.class),
|
||||||
|
LRETURN(0xad, "lreturn", Instruction.class),
|
||||||
|
FRETURN(0xae, "freturn", Instruction.class),
|
||||||
|
DRETURN(0xaf, "dreturn", Instruction.class),
|
||||||
|
ARETURN(0xb0, "areturn", Instruction.class),
|
||||||
|
RETURN(0xb1, "return", Instruction.class),
|
||||||
|
GETSTATIC(0xb2, "getstatic", GetStatic.class),
|
||||||
|
PUTSTATIC(0xb3, "putstatic", PutStatic.class),
|
||||||
|
GETFIELD(0xb4, "getfield", GetField.class),
|
||||||
|
PUTFIELD(0xb5, "putfield", PutField.class),
|
||||||
|
INVOKEVIRTUAL(0xb6, "invokevirtual", InvokeVirtual.class),
|
||||||
|
INVOKESPECIAL(0xb7, "invokespecial", InvokeSpecial.class),
|
||||||
|
INVOKESTATIC(0xb8, "invokestatic", InvokeStatic.class),
|
||||||
|
INVOKEINTERFACE(0xb9, "invokeinterface", InvokeInterface.class),
|
||||||
|
NEW(0xbb, "new", New.class),
|
||||||
|
NEWARRAY(0xbc, "newarray", NewArray.class),
|
||||||
|
ANEWARRAY(0xbd, "anewarray", ANewArray.class),
|
||||||
|
ARRAYLENGTH(0xbe, "arraylength", Instruction.class),
|
||||||
|
ATHROW(0xbf, "athrow", Instruction.class),
|
||||||
|
CHECKCAST(0xc0, "checkcast", CheckCast.class),
|
||||||
|
INSTANCEOf(0xc1, "instanceof", InstanceOf.class),
|
||||||
|
MONITORENTER(0xc2, "monitorenter", Instruction.class),
|
||||||
|
MONITOREXIT(0xc3, "monitorexit", Instruction.class),
|
||||||
|
WIDE(0xc4, "wide", Wide.class),
|
||||||
|
MULTIANEWARRAY(0xc5, "multianewarray", MultiANewArray.class),
|
||||||
|
IFNULL(0xc6, "ifnull", IfNull.class),
|
||||||
|
IFNONNULL(0xc7, "ifnonnull", IfNonNull.class),
|
||||||
|
GOTO_W(0xc8, "goto_w", GotoW.class),
|
||||||
|
JSR_W(0xc9, "jsr_w", JSR_W.class),
|
||||||
|
BREAKPOINT(0xca, "breakpoint", Instruction.class);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
{"0xa2", "3", "if_icmpge", Code_Branch.class},
|
|
||||||
{"0xa3", "3", "if_icmpgt", Code_Branch.class},
|
|
||||||
{"0xa4", "3", "if_icmple", Code_Branch.class},
|
|
||||||
{"0xa5", "3", "if_acmpeq", Code_Branch.class},
|
|
||||||
{"0xa6", "3", "if_acmpne", Code_Branch.class},
|
|
||||||
{"0xa7", "3", "goto", Code_Branch.class},
|
|
||||||
{"0xa8", "3", "jsr", Code_Branch.class},
|
|
||||||
{"0xa9", "2", "ret", Code_VarTable.class},
|
|
||||||
{"0xaa", "0", "tableswitch", Code_tableswitch.class},
|
|
||||||
{"0xab", "0", "lookupswitch", Code_lookupswitch.class},
|
|
||||||
{"0xac", "1", "ireturn", null},
|
|
||||||
{"0xad", "1", "lreturn", null},
|
|
||||||
{"0xae", "1", "freturn", null},
|
|
||||||
{"0xaf", "1", "dreturn", null},
|
|
||||||
{"0xb0", "1", "areturn", null},
|
|
||||||
{"0xb1", "1", "return", null},
|
|
||||||
{"0xb2", "3", "getstatic", Code_Pool.class},
|
|
||||||
{"0xb3", "3", "putstatic", Code_Pool.class},
|
|
||||||
{"0xb4", "3", "getfield", Code_Pool.class},
|
|
||||||
{"0xb5", "3", "putfield", Code_Pool.class},
|
|
||||||
{"0xb6", "3", "invokevirtual", Code_Pool.class},
|
|
||||||
{"0xb7", "3", "invokespecial", Code_Pool.class},
|
|
||||||
{"0xb8", "3", "invokestatic", Code_Pool.class},
|
|
||||||
{"0xb9", "5", "invokeinterface", Code_invokeinterface.class},
|
|
||||||
{"0xba", "1", "xxxunusedxxx", null},
|
|
||||||
{"0xbb", "3", "new", Code_Pool.class},
|
|
||||||
{"0xbc", "2", "newarray", Code_newarray.class},
|
|
||||||
{"0xbd", "3", "anewarray", Code_Pool.class},
|
|
||||||
{"0xbe", "1", "arraylength", null},
|
|
||||||
{"0xbf", "1", "athrow", null},
|
|
||||||
{"0xc0", "3", "checkcast", Code_Pool.class},
|
|
||||||
{"0xc1", "3", "instanceof", Code_Pool.class},
|
|
||||||
{"0xc2", "1", "monitorenter", null},
|
|
||||||
{"0xc3", "1", "monitorexit", null},
|
|
||||||
{"0xc4", "4", "wide", Code_wide.class},
|
{"0xc4", "4", "wide", Code_wide.class},
|
||||||
{"0xc5", "4", "multianewarray", Code_multianewarray.class},
|
{"0xc5", "4", "multianewarray", Code_multianewarray.class},
|
||||||
{"0xc6", "3", "ifnull", Code_Branch.class},
|
{"0xc6", "3", "ifnull", Code_Branch.class},
|
||||||
|
|||||||
@@ -5,13 +5,16 @@ import info.sigterm.deob.attributes.Code;
|
|||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class Instructions
|
public class Instructions
|
||||||
{
|
{
|
||||||
private Code code;
|
private Code code;
|
||||||
|
private ArrayList<Instruction> instructions = new ArrayList<Instruction>();
|
||||||
|
|
||||||
public Instructions(Code code) throws IOException
|
public Instructions(Code code) throws IOException
|
||||||
{
|
{
|
||||||
|
this.code = code;
|
||||||
DataInputStream is = code.getAttributes().getStream();
|
DataInputStream is = code.getAttributes().getStream();
|
||||||
|
|
||||||
int length = is.readInt();
|
int length = is.readInt();
|
||||||
@@ -24,11 +27,17 @@ public class Instructions
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Constructor<? extends Instruction> con = type.getInstructionClass().getConstructor(new Class[] { Instructions.class, InstructionType.class, Integer.class });
|
Constructor<? extends Instruction> con = type.getInstructionClass().getConstructor(Instructions.class, InstructionType.class, int.class);
|
||||||
Instruction ins = con.newInstance(this, type, pc);
|
Instruction ins = con.newInstance(this, type, pc);
|
||||||
|
|
||||||
|
instructions.add(ins);
|
||||||
|
|
||||||
|
int len = ins.getLength();
|
||||||
|
pc += len;
|
||||||
}
|
}
|
||||||
catch (java.lang.Exception ex)
|
catch (java.lang.Exception ex)
|
||||||
{
|
{
|
||||||
|
System.out.println(type);
|
||||||
throw new IOException(ex);
|
throw new IOException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class InvokeInterface extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
InvokeInterface(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class InvokeSpecial extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
public InvokeSpecial(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class InvokeStatic extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
InvokeStatic(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class InvokeVirtual extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
InvokeVirtual(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
19
src/main/java/info/sigterm/deob/attributes/code/JSR_W.java
Normal file
19
src/main/java/info/sigterm/deob/attributes/code/JSR_W.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class JSR_W extends Instruction
|
||||||
|
{
|
||||||
|
private int offset;
|
||||||
|
|
||||||
|
JSR_W(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
offset = is.readInt();
|
||||||
|
length += 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class LookupSwitch extends Instruction
|
||||||
|
{
|
||||||
|
private int def;
|
||||||
|
private int[] match;
|
||||||
|
private int[] branch;
|
||||||
|
|
||||||
|
LookupSwitch(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
|
||||||
|
int tableSkip = 4 - (pc + 1) % 4;
|
||||||
|
if (tableSkip == 4) tableSkip = 0;
|
||||||
|
if (tableSkip > 0) is.skip(tableSkip);
|
||||||
|
|
||||||
|
def = is.readInt();
|
||||||
|
|
||||||
|
int count = is.readInt();
|
||||||
|
match = new int[count];
|
||||||
|
branch = new int[count];
|
||||||
|
|
||||||
|
for (int i = 0; i < count; ++i)
|
||||||
|
{
|
||||||
|
match[i] = is.readInt();
|
||||||
|
branch[i] = is.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
length += tableSkip + 8 + (count * 8);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class MultiANewArray extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
private int dimensions;
|
||||||
|
|
||||||
|
MultiANewArray(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
dimensions = is.readUnsignedByte();
|
||||||
|
length += 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
19
src/main/java/info/sigterm/deob/attributes/code/New.java
Normal file
19
src/main/java/info/sigterm/deob/attributes/code/New.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class New extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
New(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class NewArray extends Instruction
|
||||||
|
{
|
||||||
|
private int type;
|
||||||
|
|
||||||
|
NewArray(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
this.type = is.readUnsignedByte();
|
||||||
|
length += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class PutField extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
PutField(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class PutStatic extends Instruction
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
PutStatic(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
19
src/main/java/info/sigterm/deob/attributes/code/Ret.java
Normal file
19
src/main/java/info/sigterm/deob/attributes/code/Ret.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class Ret extends Instruction
|
||||||
|
{
|
||||||
|
int index;
|
||||||
|
|
||||||
|
Ret(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
index = is.readByte();
|
||||||
|
length += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class TableSwitch extends Instruction
|
||||||
|
{
|
||||||
|
private int def;
|
||||||
|
private int[] jumps;
|
||||||
|
|
||||||
|
TableSwitch(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
|
||||||
|
int tableSkip = 4 - (pc + 1) % 4;
|
||||||
|
if (tableSkip == 4) tableSkip = 0;
|
||||||
|
if (tableSkip > 0) is.skip(tableSkip);
|
||||||
|
|
||||||
|
def = is.readInt();
|
||||||
|
|
||||||
|
int low = is.readInt();
|
||||||
|
int high = is.readInt();
|
||||||
|
|
||||||
|
int count = high - low + 1;
|
||||||
|
jumps = new int[count];
|
||||||
|
|
||||||
|
for (int i = 0; i < count; ++i)
|
||||||
|
jumps[i] = is.readInt();
|
||||||
|
|
||||||
|
length += tableSkip + 12 + (count * 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
32
src/main/java/info/sigterm/deob/attributes/code/Wide.java
Normal file
32
src/main/java/info/sigterm/deob/attributes/code/Wide.java
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package info.sigterm.deob.attributes.code;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class Wide extends Instruction
|
||||||
|
{
|
||||||
|
private byte opcode;
|
||||||
|
private int index;
|
||||||
|
private int value;
|
||||||
|
|
||||||
|
Wide(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||||
|
{
|
||||||
|
super(instructions, type, pc);
|
||||||
|
|
||||||
|
DataInputStream is = instructions.getCode().getAttributes().getStream();
|
||||||
|
|
||||||
|
opcode = is.readByte();
|
||||||
|
index = is.readUnsignedShort();
|
||||||
|
length += 3;
|
||||||
|
|
||||||
|
// XXX
|
||||||
|
InstructionType optype = InstructionType.findInstructionFromCode(opcode);
|
||||||
|
assert optype != null;
|
||||||
|
if (optype == InstructionType.IINC)
|
||||||
|
{
|
||||||
|
value = is.readUnsignedShort();
|
||||||
|
length += 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user