Represents a scaled index in an x86 operand.
示例#1
0
 public X86Operand(X86OperandUsage operandUsage, object value, X86ScaledIndex scaledIndex, int offset, X86OffsetType offsetType)
 {
     OperandUsage = operandUsage;
     Value        = value;
     ScaledIndex  = scaledIndex;
     Offset       = offset;
     OffsetType   = offsetType;
 }
示例#2
0
 public X86Operand(X86OperandUsage operandUsage, object value, X86ScaledIndex scaledIndex, int offset, X86OffsetType offsetType)
 {
     OperandUsage = operandUsage;
     Value = value;
     ScaledIndex = scaledIndex;
     Offset = offset;
     OffsetType = offsetType;
 }
示例#3
0
        private static void MakeScaledIndexOperandFromToken(X86Operand operand, byte token)
        {
            // Mechanism:
            // http://ref.x86asm.net/coder32.html#sib_byte_32

            // SIB-byte:
            //  mul | scaled_reg | reg
            // -----+------------+-------
            //  7 6 |   5 4 3    | 2 1 0

            var scaledIndex = new X86ScaledIndex
            {
                Register   = GetRegisterFromToken((byte)((token >> 3) & 7), X86RegisterSize.Dword),
                Multiplier = 1 << ((token >> 6) & 3),
            };

            // ESP scales are ignored.
            if (scaledIndex.Register != X86Register.Esp)
            {
                operand.ScaledIndex = scaledIndex;
            }

            operand.Value = GetRegisterFromToken((byte)(token & 0x7), X86RegisterSize.Dword);
        }
示例#4
0
 public X86Operand(X86OperandUsage operandUsage, object value, X86ScaledIndex scaledIndex)
     : this(operandUsage, value, scaledIndex, 0, X86OffsetType.None)
 {
 }
示例#5
0
        private static void MakeScaledIndexOperandFromToken(X86Operand operand, byte token)
        {
            // Mechanism:
            // http://ref.x86asm.net/coder32.html#sib_byte_32

            // SIB-byte:
            //  mul | scaled_reg | reg
            // -----+------------+-------
            //  7 6 |   5 4 3    | 2 1 0

            var scaledIndex = new X86ScaledIndex
            {
                Register = GetRegisterFromToken((byte)((token >> 3) & 7), X86RegisterSize.Dword),
                Multiplier = 1 << ((token >> 6) & 3),
            };

            // ESP scales are ignored.
            if (scaledIndex.Register != X86Register.Esp)
                operand.ScaledIndex = scaledIndex;

            operand.Value = GetRegisterFromToken((byte)(token & 0x7), X86RegisterSize.Dword);
        }
示例#6
0
 public X86Operand(X86OperandUsage operandUsage, object value, X86ScaledIndex scaledIndex)
     : this(operandUsage, value, scaledIndex, 0, X86OffsetType.None)
 {
 }