Allow pool to be dynamically rebuilt

This commit is contained in:
Adam
2015-05-09 17:00:30 -04:00
parent 0d21d49d2d
commit 4af719032d
45 changed files with 597 additions and 333 deletions

View File

@@ -1,6 +1,7 @@
package info.sigterm.deob.attributes.code;
import info.sigterm.deob.ConstantPool;
import info.sigterm.deob.pool.Class;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -13,26 +14,29 @@ public class Exception
private int startPc;
private int endPc;
private int handlerPc;
private int catchType;
private Class cacheType;
public Exception(Exceptions exceptions) throws IOException
{
this.exceptions = exceptions;
DataInputStream is = exceptions.getCode().getAttributes().getStream();
ConstantPool pool = exceptions.getCode().getAttributes().getClassFile().getPool();
startPc = is.readUnsignedShort();
endPc = is.readUnsignedShort();
handlerPc = is.readUnsignedShort();
catchType = is.readUnsignedShort();
cacheType = pool.getClass(is.readUnsignedShort());
}
public void write(DataOutputStream out) throws IOException
{
ConstantPool pool = exceptions.getCode().getAttributes().getClassFile().getPool();
out.writeShort(startPc);
out.writeShort(endPc);
out.writeShort(handlerPc);
out.writeShort(catchType);
out.writeShort(cacheType == null ? 0 : pool.make(cacheType));
}
public Exceptions getExceptions()