pub fn loop_condition(&self) -> Result<Expression> {
        let cx = self.get_register(x86_reg::X86_REG_ECX)?.get_full()?;

        if let capstone::InstrIdArch::X86(instruction_id) = self.instruction().id {
            match instruction_id {
                capstone::x86_insn::X86_INS_LOOP => {
                    Expr::cmpneq(cx.get()?, expr_const(0, cx.bits()))
                }
                capstone::x86_insn::X86_INS_LOOPE => {
                    let expr = Expr::cmpneq(cx.get()?, expr_const(0, cx.bits()))?;
                    Expr::and(expr, Expr::cmpeq(expr_scalar("ZF", 1), expr_const(1, 1))?)
                }
                capstone::x86_insn::X86_INS_LOOPNE => {
                    let expr = Expr::cmpneq(cx.get()?, expr_const(0, cx.bits()))?;
                    Expr::and(expr, Expr::cmpeq(expr_scalar("ZF", 1), expr_const(0, 1))?)
                }
                _ => bail!("unhandled loop"),
            }
        } else {
            bail!("not an x86 instruction")
        }
    }
/// Returns a condition which is true if a loop should be taken
Returns a condition which is true if a loop should be taken
Returns a condition which is true if a loop should be taken
pub fn loop_condition(&self) -> Result<Expression> {
        let cx = self.get_register(x86_reg::X86_REG_ECX)?.get_full()?;
        if let capstone::InstrIdArch::X86(instruction_id) = self.instruction().id {
            match instruction_id {
                capstone::x86_insn::X86_INS_LOOP => {
                    Expr::cmpneq(cx.get()?, expr_const(0, cx.bits()))
                }
                capstone::x86_insn::X86_INS_LOOPE => {
                    let expr = Expr::cmpneq(cx.get()?, expr_const(0, cx.bits()))?;
                    Expr::and(expr, Expr::cmpeq(expr_scalar("ZF", 1), expr_const(1, 1))?)
                }
                capstone::x86_insn::X86_INS_LOOPNE => {
                    let expr = Expr::cmpneq(cx.get()?, expr_const(0, cx.bits()))?;
                    Expr::and(expr, Expr::cmpeq(expr_scalar("ZF", 1), expr_const(0, 1))?)
                }
                _ => bail!("unhandled loop"),
            }
        } else {
            bail!("not an x86 instruction")
        }
    }
pub fn loop_condition ( & self ) -> Result < Expression > { let cx = self . get_register ( x86_reg :: X86_REG_ECX ) ? . get_full ( ) ? ; if let capstone :: InstrIdArch :: X86 ( instruction_id ) = self . instruction ( ) . id { match instruction_id { capstone :: x86_insn :: X86_INS_LOOP => { Expr :: cmpneq ( cx . get ( ) ? , expr_const ( 0 , cx . bits ( ) ) ) } capstone :: x86_insn :: X86_INS_LOOPE => { let expr = Expr :: cmpneq ( cx . get ( ) ? , expr_const ( 0 , cx . bits ( ) ) ) ? ; Expr :: and ( expr , Expr :: cmpeq ( expr_scalar ( " " , 1 ) , expr_const ( 1 , 1 ) ) ? ) } capstone :: x86_insn :: X86_INS_LOOPNE => { let expr = Expr :: cmpneq ( cx . get ( ) ? , expr_const ( 0 , cx . bits ( ) ) ) ? ; Expr :: and ( expr , Expr :: cmpeq ( expr_scalar ( " " , 1 ) , expr_const ( 0 , 1 ) ) ? ) } _ => bail ! ( " " ) , } } else { bail ! ( " " ) } }
Returns a condition which is true if a loop should be taken
Returns a condition which is true if a loop should be taken
&self
&self