Esempio n. 1
0
 public ByteCode_dup2(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool,int depth)
     : base(code)
 {
     name = "dup2";
     size = 1;
     this.depth = depth;
 }
Esempio n. 2
0
        public ByteCode_tableswitch(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool, int offset)
            : base(code)
        {
            // there is a 0-3 byte padding based on what the bytecode
            // offset is so that the default reference will end up
            // on a 4-byte boundary
            offset++; // handle bytecode
            name = "tableswitch";

            size = 1;

            int padCount = (4 - (offset % 4));
            if (padCount == 4) { padCount = 0; }
            for (int i = 0; i < padCount; i++){
                reader.ReadByte();
            }
            size += padCount;

            //if (log.IsDebugEnabled) log.DebugFormat("Read {0} pad characters, offset = {1}",padCount,offset);

            defaultBranch = (int)reader.ReadUInt32();
            //if (log.IsDebugEnabled) log.DebugFormat("Default: {0}/{0:X}",defaultBranch);
            low = (int)reader.ReadUInt32();
            high = (int)reader.ReadUInt32();
            //if (log.IsDebugEnabled) log.DebugFormat("{0} offsets ({1}/{1:X},{2}/{2:X})",high - low + 1,high,low);
            size += 12;
            int offsetCount = (int)(high - low + 1);
            offsets = new int[offsetCount];

            for (int i = 0; i < offsetCount; i++){
                offsets[i] = (int) reader.ReadUInt32();
                if (log.IsDebugEnabled) log.DebugFormat("Offset: {0}",offsets[i]);
                size += 4;
            }
        }
Esempio n. 3
0
 public ByteCode_lload(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool,int index)
     : base(code)
 {
     name = "lload_" + index;
     size = 1;
     this.index = index;
 }
Esempio n. 4
0
        public ByteCode_if(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool,string op)
            : base(code)
        {
            name = "if" + op;
            size = 3;

            branch = (short)reader.ReadUInt16();

            if (op.Equals("null")){
                opval = OP_NULL;
            }
            else if (op.Equals("nonnull")){
                opval = OP_NOTNULL;
            }
            else if (op.Equals("eq")){
                opval = OP_EQUALS;
            }
            else if (op.Equals("ge")){
                opval = OP_GE;
            }
            else if (op.Equals("gt")){
                opval = OP_G;
            }
            else if (op.Equals("ne")){
                opval = OP_NE;
            }
            else if (op.Equals("lt")){
                opval = OP_LT;
            }
            else if (op.Equals("le")){
                opval = OP_LE;
            }
        }
Esempio n. 5
0
        int index; // which thing are we loading

        #endregion Fields

        #region Constructors

        public ByteCode_lload(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            size = 2;
            this.index = reader.ReadByte();
            name = "lload " + index;
        }
Esempio n. 6
0
        public ByteCode_sipush(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "sipush";

            value = reader.ReadUInt16();
            size = 3;
        }
Esempio n. 7
0
        public ByteCode_jsr(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "jsr";
            size = 3;

            branch = (short)reader.ReadUInt16();
        }
Esempio n. 8
0
        int index; // which thing are we loading

        #endregion Fields

        #region Constructors

        public ByteCode_lstore(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            size = 2;

            index = reader.ReadByte();
            name = "lstore_" + index;
        }
Esempio n. 9
0
        public ByteCode_bipush(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "bipush";

            value = reader.ReadByte();
            size = 2;
        }
Esempio n. 10
0
        public ByteCode_new(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "new";
            size = 3; // 2 bytes defining index into operand pool

            classIndex = reader.ReadUInt16();
            classRef = (ConstantPoolInfo_Class)pool[classIndex - 1];
        }
Esempio n. 11
0
        public ByteCode_anewarray(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "anewarray";
            size = 3; // 2 bytes defining index into operand pool

            UInt16 fieldIndex = reader.ReadUInt16();
            reference = (ConstantPoolInfo_Class)pool[fieldIndex - 1];
        }
Esempio n. 12
0
        public ByteCode_fcmp(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool, string op)
            : base(code)
        {
            name = "fcmp"+op;
            size = 1;

            if ("l".Equals(op)) { opval = OP_LESS; }
            if ("g".Equals(op)) { opval = OP_GREATER; }
        }
Esempio n. 13
0
        public ByteCode_invokespecial(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "invokespecial";
            size = 3; // 2 bytes defining index into operand pool

            UInt16 methodIndex = reader.ReadUInt16();
            method = (ConstantPoolInfo_MethodRef)pool[methodIndex - 1];
        }
Esempio n. 14
0
        public ByteCode_putstatic(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "putstatic";
            size = 3; // 2 bytes defining index into operand pool

            UInt16 fieldIndex = reader.ReadUInt16();
            field = (ConstantPoolInfo_FieldRef)pool[fieldIndex - 1];
        }
Esempio n. 15
0
 public ByteCode_pop(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool,int num)
     : base(code)
 {
     name = "pop";
     if (num == 2){
         name = "pop2";
     }
     size = 1;
     this.count = num;
 }
Esempio n. 16
0
        public ByteCode_ldc(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "ldc";
            size = 2;

            byte index = reader.ReadByte();

            reference = pool[index - 1];
        }
Esempio n. 17
0
        public ByteCode_ldc_w(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "ldc_w";
            size = 3;

            UInt16 index = reader.ReadUInt16();

            reference = pool[index - 1];
        }
Esempio n. 18
0
        public ByteCode_instanceof(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "instanceof";
            size = 3; // 2 bytes defining index into operand pool

            UInt16 methodIndex = reader.ReadUInt16();
            clazz = (ConstantPoolInfo_Class)pool[methodIndex - 1];
            className = clazz.getClassName();
        }
Esempio n. 19
0
        int index; // which thing are we loading

        #endregion Fields

        #region Constructors

        public ByteCode_iinc(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            size = 3;

            index = reader.ReadByte();

            constant = reader.getReader().ReadSByte();

            name = "iinc";
        }
Esempio n. 20
0
        public ByteCode_ldc2_w(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "ldc2_w";
            size = 3;

            UInt16 index = reader.ReadUInt16();

            //			if (log.IsDebugEnabled) log.DebugFormat("Index is {0}",index);
            reference = pool[index - 1];
        }
Esempio n. 21
0
        public ByteCode_invokeinterface(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "invokeinterface";
            size = 5; // 2 bytes defining index into operand pool

            UInt16 methodIndex = reader.ReadUInt16();
            reader.ReadByte(); // count - unused
            reader.ReadByte(); // 0;
            method = (ConstantPoolInfo_InterfaceMethodRef)pool[methodIndex - 1];
        }
Esempio n. 22
0
        public ByteCode_goto(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "goto";
            size = 3;

            UInt16 temp = reader.ReadUInt16();
            if ((temp & 0x8000) != 0){
                branch = (-65536) + (temp);
            }
            else {
                branch = (int) temp;
            }
        }
Esempio n. 23
0
        public ByteCode_if_acmp(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool,string op)
            : base(code)
        {
            name = "if_acmp" + op;
            size = 3;

            branch = reader.ReadUInt16();

            if (op.Equals("ne")){
                opval = OP_NE;
            }
            else if (op.Equals("eq")){
                opval = OP_EQ;
            }
        }
Esempio n. 24
0
        public ByteCode_checkcast(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
            : base(code)
        {
            name = "checkcast";
            size = 3; // 2 bytes defining index into operand pool

            UInt16 methodIndex = reader.ReadUInt16();
            reference = (ConstantPoolInfo_Class)pool[methodIndex - 1];

            // check for array type
            if (reference.getClassName().StartsWith("[L")){

                className = reference.getClassName();
                // [L...;
                className = className.Substring(2,className.Length-3);
                isArray = true;
            }
            else {
                className = reference.getClassName();
            }
        }
Esempio n. 25
0
 public ByteCode_arraylength(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
     : base(code)
 {
     name = "arraylength";
     size = 1;
 }
Esempio n. 26
0
 public ByteCode_iand(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
     : base(code)
 {
     name = "iand";
     size = 1;
 }
Esempio n. 27
0
 public ByteCode_dreturn(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
     : base(code)
 {
     name = "dreturn";
     size = 1;
 }
Esempio n. 28
0
 public ByteCode_monitorexit(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
     : base(code)
 {
     name = "monitorexit";
     size = 1;
 }
Esempio n. 29
0
 public ByteCode_aconst_null(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
     : base(code)
 {
     name = "aconst_null";
     size = 1;
 }
Esempio n. 30
0
 public ByteCode_aastore(byte code,MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
     : base(code)
 {
     name = "aastore";
     size = 1;
 }