(insn)
return False
Check if the instruction does nothing.

        :param insn: The capstone insn object.
        :return: True if the instruction does no-op, False otherwise.
Check if the instruction does nothing.
Check if the instruction does nothing .
def _is_noop_insn(insn):
        """
        Check if the instruction does nothing.

        :param insn: The capstone insn object.
        :return: True if the instruction does no-op, False otherwise.
        """

        insn_name = insn.insn_name()

        if insn_name == 'nop':
            # nops
            return True
        elif insn_name == 'lea':
            # lea reg, [reg + 0]
            op0, op1 = insn.operands
            if op0.type == 1 and op1.type == 3:
                # reg and mem
                if op0.reg == op1.mem.base and op1.mem.index == 0 and op1.mem.disp == 0:
                    return True
        elif insn_name == 'mov':
            if len(insn.operands) > 2:
                # mov reg_a, imm1, shift imm2
                # This is not a NOP
                return False
            # mov reg_a, reg_a
            op0, op1 = insn.operands
            if op0.type == 1 and op1.type == 1:
                # reg and reg
                if op0.reg == op1.reg:
                    return True
        elif insn_name in {"ud0", "ud1", "ud2"}:
            return True

        # add more types of no-op instructions here :-)

        return False
def _is_noop_insn ( insn ) : insn_name = insn . insn_name ( ) if insn_name == 'nop' : # nops return True elif insn_name == 'lea' : # lea reg, [reg + 0] op0 , op1 = insn . operands if op0 . type == 1 and op1 . type == 3 : # reg and mem if op0 . reg == op1 . mem . base and op1 . mem . index == 0 and op1 . mem . disp == 0 : return True elif insn_name == 'mov' : if len ( insn . operands ) > 2 : # mov reg_a, imm1, shift imm2 # This is not a NOP return False # mov reg_a, reg_a op0 , op1 = insn . operands if op0 . type == 1 and op1 . type == 1 : # reg and reg if op0 . reg == op1 . reg : return True elif insn_name in { "ud0" , "ud1" , "ud2" } : return True # add more types of no-op instructions here :-) return False