Esempio n. 1
0
        static InstrInfo[] ReadInfos()
        {
            var reader  = new DataReader(GetSerializedInstrInfos());
            var infos   = new InstrInfo[IcedConstants.NumberOfCodeValues];
            var strings = FormatterStringsTable.GetStringsTable();

            var    ca = new char[1];
            string s, s2, s3, s4;
            uint   v, v2;
            int    prevIndex = -1;

            for (int i = 0; i < infos.Length; i++)
            {
                byte f        = reader.ReadByte();
                var  ctorKind = (CtorKind)(f & 0x7F);
                int  currentIndex;
                if (ctorKind == CtorKind.Previous)
                {
                    currentIndex = reader.Index;
                    reader.Index = prevIndex;
                    ctorKind     = (CtorKind)(reader.ReadByte() & 0x7F);
                }
                else
                {
                    currentIndex = -1;
                    prevIndex    = reader.Index - 1;
                }
                s = strings[reader.ReadCompressedUInt32()];
                if ((f & 0x80) != 0)
                {
                    ca[0] = 'v';
                    s     = AddPrefix(s, ca);
                }
                InstrInfo instrInfo;
                switch (ctorKind)
                {
                case CtorKind.Normal_1:
                    instrInfo = new SimpleInstrInfo(s);
                    break;

                case CtorKind.Normal_2a:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    instrInfo = new SimpleInstrInfo(s, s2);
                    break;

                case CtorKind.Normal_2b:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo(s, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.Normal_2c:
                    ca[0]     = (char)reader.ReadByte();
                    s         = AddSuffix(s, ca);
                    instrInfo = new SimpleInstrInfo(s);
                    break;

                case CtorKind.Normal_3:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo(s, s2, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.AamAad:
                    instrInfo = new SimpleInstrInfo_AamAad(s);
                    break;

                case CtorKind.asz:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_as((int)v, s);
                    break;

                case CtorKind.bnd2_2:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    instrInfo = new SimpleInstrInfo_bnd2(s, s2);
                    break;

                case CtorKind.bnd2_3:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_bnd2(s, s2, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.DeclareData:
                    instrInfo = new SimpleInstrInfo_DeclareData((Code)i, s);
                    break;

                case CtorKind.er_2:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_er((int)v, s);
                    break;

                case CtorKind.er_4:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_er((int)v, s, s2, (InstrOpInfoFlags)v2);
                    break;

                case CtorKind.far:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_far((int)v, s, s2);
                    break;

                case CtorKind.imul:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    instrInfo = new SimpleInstrInfo_imul(s, s2);
                    break;

                case CtorKind.maskmovq:
                    instrInfo = new SimpleInstrInfo_maskmovq(s);
                    break;

                case CtorKind.movabs:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    s3        = strings[reader.ReadCompressedUInt32()];
                    ca[0]     = (char)reader.ReadByte();
                    s4        = AddSuffix(s3, ca);
                    instrInfo = new SimpleInstrInfo_movabs((int)v, s, s2, s3, s4);
                    break;

                case CtorKind.nop:
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_nop((int)v, s, (Register)v2);
                    break;

                case CtorKind.OpSize:
                    v         = reader.ReadByte();
                    s2        = string.Intern(s + "w");
                    s3        = string.Intern(s + "l");
                    s4        = string.Intern(s + "q");
                    instrInfo = new SimpleInstrInfo_OpSize((CodeSize)v, s, s2, s3, s4);
                    break;

                case CtorKind.OpSize2_bnd:
                    s2        = strings[reader.ReadCompressedUInt32()];
                    s3        = strings[reader.ReadCompressedUInt32()];
                    s4        = strings[reader.ReadCompressedUInt32()];
                    instrInfo = new SimpleInstrInfo_OpSize2_bnd(s, s2, s3, s4);
                    break;

                case CtorKind.OpSize3:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_OpSize3((int)v, s, s2);
                    break;

                case CtorKind.os_A:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os((int)v, s);
                    break;

                case CtorKind.os_B:
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os((int)v, s, (InstrOpInfoFlags)v2);
                    break;

                case CtorKind.os_bnd:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_bnd((int)v, s);
                    break;

                case CtorKind.os_jcc:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_jcc((int)v, s);
                    break;

                case CtorKind.os_loop:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_loop((int)v, (int)v2, s, s2);
                    break;

                case CtorKind.os_mem:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_mem((int)v, s, s2);
                    break;

                case CtorKind.os_mem_reg16:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_mem_reg16((int)v, s);
                    break;

                case CtorKind.os_mem2:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_mem2((int)v, s, s2);
                    break;

                case CtorKind.os2_3:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os2((int)v, s, s2);
                    break;

                case CtorKind.os2_4:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os2((int)v, s, s2, (InstrOpInfoFlags)v2);
                    break;

                case CtorKind.os2_bnd:
                    ca[0]     = (char)reader.ReadByte();
                    s2        = AddSuffix(s, ca);
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os2_bnd((int)v, s, s2);
                    break;

                case CtorKind.pblendvb:
                    instrInfo = new SimpleInstrInfo_pblendvb(s);
                    break;

                case CtorKind.pclmulqdq:
                    v         = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_pclmulqdq(s, FormatterConstants.GetPseudoOps((PseudoOpsKind)v));
                    break;

                case CtorKind.pops:
                    v         = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_pops(s, FormatterConstants.GetPseudoOps((PseudoOpsKind)v));
                    break;

                case CtorKind.Reg16:
                    instrInfo = new SimpleInstrInfo_Reg16(s);
                    break;

                case CtorKind.sae:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_sae((int)v, s);
                    break;

                case CtorKind.sae_pops:
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_sae_pops((int)v, s, FormatterConstants.GetPseudoOps((PseudoOpsKind)v2));
                    break;

                case CtorKind.ST_STi:
                    instrInfo = new SimpleInstrInfo_ST_STi(s);
                    break;

                case CtorKind.STi_ST:
                    instrInfo = new SimpleInstrInfo_STi_ST(s);
                    break;

                case CtorKind.STi_ST2:
                    instrInfo = new SimpleInstrInfo_STi_ST2(s);
                    break;

                case CtorKind.STIG_1a:
                    instrInfo = new SimpleInstrInfo_STIG1(s);
                    break;

                case CtorKind.STIG_1b:
                    v = reader.ReadByte();
                    if (v > 1)
                    {
                        throw new InvalidOperationException();
                    }
                    instrInfo = new SimpleInstrInfo_STIG1(s, v != 0);
                    break;

                case CtorKind.xbegin:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_xbegin((int)v, s);
                    break;

                default:
                    throw new InvalidOperationException();
                }
                infos[i] = instrInfo;
                if (currentIndex >= 0)
                {
                    reader.Index = currentIndex;
                }
            }
            if (reader.CanRead)
            {
                throw new InvalidOperationException();
            }

            return(infos);
        }
Esempio n. 2
0
        static InstrInfo[] ReadInfos()
        {
            var reader  = new DataReader(GetSerializedInstrInfos());
            var infos   = new InstrInfo[DecoderConstants.NumberOfCodeValues];
            var strings = FormatterStringsTable.GetStringsTable();

            var    ca = new char[1];
            string s;
            uint   v, v2;
            int    prevIndex = -1;

            for (int i = 0; i < infos.Length; i++)
            {
                var  code     = (Code)i;
                byte f        = reader.ReadByte();
                var  ctorKind = (CtorKind)(f & 0x7F);
                int  currentIndex;
                if (ctorKind == CtorKind.Previous)
                {
                    currentIndex = reader.Index;
                    reader.Index = prevIndex;
                    ctorKind     = (CtorKind)(reader.ReadByte() & 0x7F);
                }
                else
                {
                    currentIndex = -1;
                    prevIndex    = reader.Index - 1;
                }
                s = strings[reader.ReadCompressedUInt32()];
                if ((f & 0x80) != 0)
                {
                    ca[0] = 'v';
                    s     = AddPrefix(s, ca);
                }
                InstrInfo instrInfo;
                switch (ctorKind)
                {
                case CtorKind.Normal_1:
                    instrInfo = new SimpleInstrInfo(code, s);
                    break;

                case CtorKind.Normal_2:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo(code, s, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.asz:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_as(code, (int)v, s);
                    break;

                case CtorKind.AX:
                    instrInfo = new SimpleInstrInfo_AX(code, s);
                    break;

                case CtorKind.AY:
                    instrInfo = new SimpleInstrInfo_AY(code, s);
                    break;

                case CtorKind.bcst:
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_bcst(code, s, (InstrOpInfoFlags)v, (InstrOpInfoFlags)v2);
                    break;

                case CtorKind.bnd_1:
                    instrInfo = new SimpleInstrInfo_bnd(code, s);
                    break;

                case CtorKind.bnd_2:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_bnd(code, s, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.DeclareData:
                    instrInfo = new SimpleInstrInfo_DeclareData(code, s);
                    break;

                case CtorKind.fpu_ST_STi:
                    instrInfo = new SimpleInstrInfo_fpu_ST_STi(code, s);
                    break;

                case CtorKind.fpu_STi_ST:
                    instrInfo = new SimpleInstrInfo_fpu_STi_ST(code, s);
                    break;

                case CtorKind.imul:
                    instrInfo = new SimpleInstrInfo_imul(code, s);
                    break;

                case CtorKind.k1:
                    instrInfo = new SimpleInstrInfo_k1(code, s);
                    break;

                case CtorKind.k2:
                    instrInfo = new SimpleInstrInfo_k2(code, s);
                    break;

                case CtorKind.maskmovq:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_maskmovq(code, s, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.memsize:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_memsize(code, (int)v, s);
                    break;

                case CtorKind.movabs:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_movabs(code, (int)v, s);
                    break;

                case CtorKind.nop:
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_nop(code, (int)v, s, (Register)v2);
                    break;

                case CtorKind.nop0F1F:
                    v         = reader.ReadByte();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_nop0F1F(code, (Register)v, s, (InstrOpInfoFlags)v2);
                    break;

                case CtorKind.os2:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os(code, (int)v, s);
                    break;

                case CtorKind.os3:
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os(code, (int)v, s, (InstrOpInfoFlags)v2);
                    break;

                case CtorKind.os_bnd:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_bnd(code, (int)v, s);
                    break;

                case CtorKind.os_jcc_2:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_jcc(code, (int)v, s);
                    break;

                case CtorKind.os_jcc_3:
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_jcc(code, (int)v, s, (InstrOpInfoFlags)v2);
                    break;

                case CtorKind.os_loop:
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_os_loop(code, (int)v, (Register)v2, s);
                    break;

                case CtorKind.os_mem:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_mem(code, (int)v, s);
                    break;

                case CtorKind.pclmulqdq:
                    v         = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_pclmulqdq(code, s, FormatterConstants.GetPseudoOps((PseudoOpsKind)v));
                    break;

                case CtorKind.pops:
                    v         = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_pops(code, s, FormatterConstants.GetPseudoOps((PseudoOpsKind)v));
                    break;

                case CtorKind.reg:
                    v         = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_reg(code, s, (Register)v);
                    break;

                case CtorKind.Reg16:
                    instrInfo = new SimpleInstrInfo_Reg16(code, s);
                    break;

                case CtorKind.ST_STi:
                    instrInfo = new SimpleInstrInfo_ST_STi(code, s);
                    break;

                case CtorKind.ST1_2:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_ST1(code, s, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.ST1_3:
                    v  = reader.ReadCompressedUInt32();
                    v2 = reader.ReadByte();
                    if (v2 > 1)
                    {
                        throw new InvalidOperationException();
                    }
                    instrInfo = new SimpleInstrInfo_ST1(code, s, (InstrOpInfoFlags)v, v2 != 0);
                    break;

                case CtorKind.ST2:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_ST2(code, s, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.STi_ST:
                    instrInfo = new SimpleInstrInfo_STi_ST(code, s);
                    break;

                case CtorKind.xbegin:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_xbegin(code, (int)v, s);
                    break;

                case CtorKind.YA:
                    instrInfo = new SimpleInstrInfo_YA(code, s);
                    break;

                default:
                    throw new InvalidOperationException();
                }
                infos[i] = instrInfo;
                if (currentIndex >= 0)
                {
                    reader.Index = currentIndex;
                }
            }
            if (reader.CanRead)
            {
                throw new InvalidOperationException();
            }

            return(infos);
        }
Esempio n. 3
0
        static InstrInfo[] ReadInfos()
        {
            var reader  = new DataReader(GetSerializedInstrInfos());
            var infos   = new InstrInfo[IcedConstants.NumberOfCodeValues];
            var strings = FormatterStringsTable.GetStringsTable();

            var    ca = new char[1];
            string s, s2, s3;
            uint   v, v2, v3;
            int    prevIndex = -1;

            for (int i = 0; i < infos.Length; i++)
            {
                byte f        = reader.ReadByte();
                var  ctorKind = (CtorKind)(f & 0x7F);
                int  currentIndex;
                if (ctorKind == CtorKind.Previous)
                {
                    currentIndex = reader.Index;
                    reader.Index = prevIndex;
                    ctorKind     = (CtorKind)(reader.ReadByte() & 0x7F);
                }
                else
                {
                    currentIndex = -1;
                    prevIndex    = reader.Index - 1;
                }
                s = strings[reader.ReadCompressedUInt32()];
                if ((f & 0x80) != 0)
                {
                    ca[0] = 'v';
                    s     = AddPrefix(s, ca);
                }
                InstrInfo instrInfo;
                switch (ctorKind)
                {
                case CtorKind.Normal_1:
                    instrInfo = new SimpleInstrInfo(s);
                    break;

                case CtorKind.Normal_2:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo(s, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.asz:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_as((int)v, s);
                    break;

                case CtorKind.StringIg0:
                    instrInfo = new SimpleInstrInfo_StringIg0(s);
                    break;

                case CtorKind.StringIg1:
                    instrInfo = new SimpleInstrInfo_StringIg1(s);
                    break;

                case CtorKind.bcst:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_bcst(s, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.bnd:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_bnd(s, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.DeclareData:
                    instrInfo = new SimpleInstrInfo_DeclareData((Code)i, s);
                    break;

                case CtorKind.ST_STi:
                    v = reader.ReadByte();
                    if (v > 1)
                    {
                        throw new InvalidOperationException();
                    }
                    instrInfo = new SimpleInstrInfo_ST_STi(s, v != 0);
                    break;

                case CtorKind.STi_ST:
                    v = reader.ReadByte();
                    if (v > 1)
                    {
                        throw new InvalidOperationException();
                    }
                    instrInfo = new SimpleInstrInfo_STi_ST(s, v != 0);
                    break;

                case CtorKind.imul:
                    instrInfo = new SimpleInstrInfo_imul(s);
                    break;

                case CtorKind.opmask_op:
                    instrInfo = new SimpleInstrInfo_opmask_op(s);
                    break;

                case CtorKind.maskmovq:
                    instrInfo = new SimpleInstrInfo_maskmovq(s);
                    break;

                case CtorKind.memsize:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_memsize((int)v, s);
                    break;

                case CtorKind.movabs:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_movabs((int)v, s);
                    break;

                case CtorKind.nop:
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_nop((int)v, s, (Register)v2);
                    break;

                case CtorKind.os2:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os((int)v, s);
                    break;

                case CtorKind.os3:
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os((int)v, s, (InstrOpInfoFlags)v2);
                    break;

                case CtorKind.os_bnd:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_bnd((int)v, s);
                    break;

                case CtorKind.CC_1:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_cc((int)v, new[] { s });
                    break;

                case CtorKind.CC_2:
                    s2        = strings[reader.ReadCompressedUInt32()];
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_cc((int)v, new[] { s, s2 });
                    break;

                case CtorKind.CC_3:
                    s2        = strings[reader.ReadCompressedUInt32()];
                    s3        = strings[reader.ReadCompressedUInt32()];
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_cc((int)v, new[] { s, s2, s3 });
                    break;

                case CtorKind.os_jcc_a_1:
                    v2        = reader.ReadCompressedUInt32();
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_jcc((int)v, (int)v2, new[] { s });
                    break;

                case CtorKind.os_jcc_a_2:
                    s2        = strings[reader.ReadCompressedUInt32()];
                    v2        = reader.ReadCompressedUInt32();
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_jcc((int)v, (int)v2, new[] { s, s2 });
                    break;

                case CtorKind.os_jcc_a_3:
                    s2        = strings[reader.ReadCompressedUInt32()];
                    s3        = strings[reader.ReadCompressedUInt32()];
                    v2        = reader.ReadCompressedUInt32();
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_jcc((int)v, (int)v2, new[] { s, s2, s3 });
                    break;

                case CtorKind.os_jcc_b_1:
                    v3        = reader.ReadCompressedUInt32();
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_jcc((int)v, (int)v3, new[] { s }, (InstrOpInfoFlags)v2);
                    break;

                case CtorKind.os_jcc_b_2:
                    s2        = strings[reader.ReadCompressedUInt32()];
                    v3        = reader.ReadCompressedUInt32();
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_jcc((int)v, (int)v3, new[] { s, s2 }, (InstrOpInfoFlags)v2);
                    break;

                case CtorKind.os_jcc_b_3:
                    s2        = strings[reader.ReadCompressedUInt32()];
                    s3        = strings[reader.ReadCompressedUInt32()];
                    v3        = reader.ReadCompressedUInt32();
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_os_jcc((int)v, (int)v3, new[] { s, s2, s3 }, (InstrOpInfoFlags)v2);
                    break;

                case CtorKind.os_loopcc:
                    s2        = strings[reader.ReadCompressedUInt32()];
                    v3        = reader.ReadCompressedUInt32();
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_os_loop((int)v, (int)v3, (Register)v2, new[] { s, s2 });
                    break;

                case CtorKind.os_loop:
                    v         = reader.ReadCompressedUInt32();
                    v2        = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_os_loop((int)v, -1, (Register)v2, new[] { s });
                    break;

                case CtorKind.pclmulqdq:
                    v         = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_pclmulqdq(s, FormatterConstants.GetPseudoOps((PseudoOpsKind)v));
                    break;

                case CtorKind.pops:
                    v         = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_pops(s, FormatterConstants.GetPseudoOps((PseudoOpsKind)v));
                    break;

                case CtorKind.reg:
                    v         = reader.ReadByte();
                    instrInfo = new SimpleInstrInfo_reg(s, (Register)v);
                    break;

                case CtorKind.Reg16:
                    instrInfo = new SimpleInstrInfo_Reg16(s);
                    break;

                case CtorKind.Reg32:
                    instrInfo = new SimpleInstrInfo_Reg32(s);
                    break;

                case CtorKind.ST1_2:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_ST1(s, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.ST1_3:
                    v  = reader.ReadCompressedUInt32();
                    v2 = reader.ReadByte();
                    if (v2 > 1)
                    {
                        throw new InvalidOperationException();
                    }
                    instrInfo = new SimpleInstrInfo_ST1(s, (InstrOpInfoFlags)v, v2 != 0);
                    break;

                case CtorKind.ST2:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_ST2(s, (InstrOpInfoFlags)v);
                    break;

                case CtorKind.invlpga:
                    v         = reader.ReadCompressedUInt32();
                    instrInfo = new SimpleInstrInfo_invlpga((int)v, s);
                    break;

                default:
                    throw new InvalidOperationException();
                }
                infos[i] = instrInfo;
                if (currentIndex >= 0)
                {
                    reader.Index = currentIndex;
                }
            }
            if (reader.CanRead)
            {
                throw new InvalidOperationException();
            }

            return(infos);
        }