dupx1 test
This commit is contained in:
@@ -61,6 +61,7 @@ public class ClassFile
|
||||
{
|
||||
this.group = group;
|
||||
|
||||
interfaces = new Interfaces(this);
|
||||
fields = new Fields(this);
|
||||
methods = new Methods(this);
|
||||
attributes = new Attributes(this);
|
||||
@@ -131,6 +132,16 @@ public class ClassFile
|
||||
this.name = new Class(name);
|
||||
}
|
||||
|
||||
public String getSuperName()
|
||||
{
|
||||
return super_class.getName();
|
||||
}
|
||||
|
||||
public void setSuperName(String name)
|
||||
{
|
||||
super_class = new Class(name);
|
||||
}
|
||||
|
||||
public Class getParentClass()
|
||||
{
|
||||
return this.super_class;
|
||||
|
||||
@@ -24,6 +24,11 @@ public class Interfaces
|
||||
interfaces.add(c.getPool().getClass(is.readUnsignedShort()));
|
||||
}
|
||||
|
||||
Interfaces(ClassFile c)
|
||||
{
|
||||
classFile = c;
|
||||
}
|
||||
|
||||
public List<Class> getInterfaces()
|
||||
{
|
||||
return interfaces;
|
||||
|
||||
@@ -75,6 +75,11 @@ public class Method
|
||||
return attributes;
|
||||
}
|
||||
|
||||
public void setAttributes(Attributes a)
|
||||
{
|
||||
this.attributes = a;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
@@ -100,6 +105,11 @@ public class Method
|
||||
return (accessFlags & ACC_STATIC) != 0;
|
||||
}
|
||||
|
||||
public void setStatic()
|
||||
{
|
||||
accessFlags |= ACC_STATIC;
|
||||
}
|
||||
|
||||
public boolean isSynchronized()
|
||||
{
|
||||
return (accessFlags & ACC_SYNCHRONIZED) != 0;
|
||||
|
||||
@@ -37,6 +37,11 @@ public class Methods
|
||||
m.write(out);
|
||||
}
|
||||
|
||||
public void addMethod(Method m)
|
||||
{
|
||||
methods.add(m);
|
||||
}
|
||||
|
||||
public void removeMethod(Method m)
|
||||
{
|
||||
methods.remove(m);
|
||||
|
||||
@@ -23,6 +23,7 @@ public class Code extends Attribute
|
||||
|
||||
exceptions = new Exceptions(this);
|
||||
this.attributes = new Attributes(this);
|
||||
instructions = new Instructions(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -71,6 +71,11 @@ public class Instructions
|
||||
return instructions;
|
||||
}
|
||||
|
||||
public void addInstruction(Instruction i)
|
||||
{
|
||||
instructions.add(i);
|
||||
}
|
||||
|
||||
public List<Block> getBlocks()
|
||||
{
|
||||
return blocks;
|
||||
|
||||
@@ -12,10 +12,15 @@ import net.runelite.deob.attributes.code.instruction.types.DupInstruction;
|
||||
|
||||
public class Dup_X1 extends Instruction implements DupInstruction
|
||||
{
|
||||
public Dup_X1(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||
public Dup_X1(Instructions instructions, InstructionType type, int pc)
|
||||
{
|
||||
super(instructions, type, pc);
|
||||
}
|
||||
|
||||
public Dup_X1(Instructions instructions)
|
||||
{
|
||||
super(instructions, InstructionType.DUP_X1, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Frame frame)
|
||||
|
||||
@@ -21,7 +21,7 @@ public class IConst_3 extends Instruction implements PushConstantInstruction
|
||||
|
||||
public IConst_3(Instructions instructions)
|
||||
{
|
||||
super(instructions, InstructionType.ICONST_3, 0);
|
||||
super(instructions, InstructionType.ICONST_3, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ILoad extends Instruction implements LVTInstruction, WideInstructio
|
||||
|
||||
public ILoad(Instructions instructions, int index)
|
||||
{
|
||||
super(instructions, InstructionType.ILOAD, 0);
|
||||
super(instructions, InstructionType.ILOAD, -1);
|
||||
this.index = index;
|
||||
++length;
|
||||
}
|
||||
|
||||
@@ -16,10 +16,15 @@ import java.io.IOException;
|
||||
|
||||
public class IStore_0 extends Instruction implements LVTInstruction
|
||||
{
|
||||
public IStore_0(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||
public IStore_0(Instructions instructions, InstructionType type, int pc)
|
||||
{
|
||||
super(instructions, type, pc);
|
||||
}
|
||||
|
||||
public IStore_0(Instructions instructions)
|
||||
{
|
||||
super(instructions, InstructionType.ISTORE_0, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Frame frame)
|
||||
|
||||
@@ -33,6 +33,11 @@ public class LDC_W extends Instruction implements PushConstantInstruction
|
||||
length += 2;
|
||||
}
|
||||
|
||||
public LDC_W(Instructions instructions, int value)
|
||||
{
|
||||
this(instructions, new net.runelite.deob.pool.Integer(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(DataInputStream is) throws IOException
|
||||
{
|
||||
@@ -148,4 +153,9 @@ public class LDC_W extends Instruction implements PushConstantInstruction
|
||||
|
||||
return super.makeSpecific();
|
||||
}
|
||||
|
||||
public int getConstantAsInt()
|
||||
{
|
||||
return (int) value.getObject();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,18 @@ import net.runelite.deob.execution.Frame;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
import net.runelite.deob.execution.StackContext;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Pop extends Instruction
|
||||
{
|
||||
public Pop(Instructions instructions, InstructionType type, int pc) throws IOException
|
||||
public Pop(Instructions instructions, InstructionType type, int pc)
|
||||
{
|
||||
super(instructions, type, pc);
|
||||
}
|
||||
|
||||
public Pop(Instructions instructions)
|
||||
{
|
||||
super(instructions, InstructionType.POP, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Frame frame)
|
||||
|
||||
@@ -14,6 +14,11 @@ public class VReturn extends Instruction implements ReturnInstruction
|
||||
{
|
||||
super(instructions, type, pc);
|
||||
}
|
||||
|
||||
public VReturn(Instructions instructions)
|
||||
{
|
||||
super(instructions, InstructionType.RETURN, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Frame frame)
|
||||
|
||||
Reference in New Issue
Block a user