Exemplo n.º 1
0
        /// <summary>
        ///     Build an Instruction Detail.
        /// </summary>
        /// <param name="disassembler">
        ///     A disassembler.
        /// </param>
        /// <param name="hInstruction">
        ///     An instruction handle.
        /// </param>
        internal override void Build(CapstoneDisassembler disassembler, NativeInstructionHandle hInstruction)
        {
            // ...
            //
            // Throws an exception if the operation fails.
            base.Build(disassembler, hInstruction);
            var nativeInstructionDetail = NativeCapstone.GetInstructionDetail <NativeX86InstructionDetail>(hInstruction).GetValueOrDefault();

            this.AddressSize              = nativeInstructionDetail.AddressSize;
            this.AvxConditionCode         = nativeInstructionDetail.AvxConditionCode;
            this.AvxRoundingMode          = nativeInstructionDetail.AvxRoundingMode;
            this.AvxSuppressAllExceptions = nativeInstructionDetail.AvxSuppressAllExceptions;
            this.Displacement             = nativeInstructionDetail.Displacement;
            this.EFlags           = nativeInstructionDetail.Flag.EFlags;
            this.Encoding         = new X86Encoding(ref nativeInstructionDetail.Encoding);
            this.FpuFlags         = nativeInstructionDetail.Flag.FpuFlags;
            this.ModRm            = nativeInstructionDetail.ModRm;
            this.Opcode           = nativeInstructionDetail.Opcode;
            this.Operands         = X86Operand.Create(disassembler, ref nativeInstructionDetail);
            this.Prefix           = nativeInstructionDetail.Prefix;
            this.Rex              = nativeInstructionDetail.Rex;
            this.Sib              = nativeInstructionDetail.Sib;
            this.SibBase          = X86Register.TryCreate(disassembler, nativeInstructionDetail.SibBase);
            this.SibIndex         = X86Register.TryCreate(disassembler, nativeInstructionDetail.SibIndex);
            this.SibScale         = nativeInstructionDetail.SibScale;
            this.SseConditionCode = nativeInstructionDetail.SseConditionCode;
            this.XopConditionCode = nativeInstructionDetail.XopConditionCode;
        }
 /// <summary>
 ///     Create an X86 Instruction Detail.
 /// </summary>
 /// <param name="builder">
 ///     A builder to initialize the object with.
 /// </param>
 internal X86InstructionDetail(X86InstructionDetailBuilder builder) : base(builder)
 {
     this.AddressSize              = builder.AddressSize;
     this.AvxConditionCode         = builder.AvxConditionCode;
     this.AvxRoundingMode          = builder.AvxRoundingMode;
     this.AvxSuppressAllExceptions = builder.AvxSuppressAllExceptions;
     this.Displacement             = builder.Displacement;
     this.EFlags           = builder.EFlags;
     this.Encoding         = builder.Encoding;
     this.FpuFlags         = builder.FpuFlags;
     this.ModRm            = builder.ModRm;
     this.Opcode           = builder.Opcode;
     this.Operands         = builder.Operands;
     this.Prefix           = builder.Prefix;
     this.Rex              = builder.Rex;
     this.Sib              = builder.Sib;
     this.SibBase          = builder.SibBase;
     this.SibIndex         = builder.SibIndex;
     this.SibScale         = builder.SibScale;
     this.SseConditionCode = builder.SseConditionCode;
     this.XopConditionCode = builder.XopConditionCode;
 }