Unfinished

This commit is contained in:
Adam
2014-12-01 00:31:26 -05:00
parent 41681f94a5
commit 9a128c191c
21 changed files with 687 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
package info.sigterm.deob.attributes.code;
import info.sigterm.deob.attributes.Code;
import java.io.DataInputStream;
import java.io.IOException;
import java.lang.reflect.Constructor;
public class Instructions
{
private Code code;
public Instructions(Code code) throws IOException
{
DataInputStream is = code.getAttributes().getStream();
int length = is.readInt();
for (int pc = 0; pc < length;)
{
byte opcode = is.readByte();
InstructionType type = InstructionType.findInstructionFromCode(opcode);
try
{
Constructor<? extends Instruction> con = type.getInstructionClass().getConstructor(new Class[] { Instructions.class, InstructionType.class, Integer.class });
Instruction ins = con.newInstance(this, type, pc);
}
catch (java.lang.Exception ex)
{
throw new IOException(ex);
}
}
}
public Code getCode()
{
return code;
}
}