Allow pool to be dynamically rebuilt
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user