(arch: archinfo.Arch, block)
return False
Check if the block is a no-op block by checking VEX statements.

        :param arch:    An architecture descriptor.
        :param block: The VEX block instance.
        :return: True if the entire block is a single-byte or multi-byte nop instruction, False otherwise.
        :rtype: bool
Check if the block is a no-op block by checking VEX statements.
Check if the block is a no - op block by checking VEX statements .
def _is_noop_block(arch: archinfo.Arch, block):
        """
        Check if the block is a no-op block by checking VEX statements.

        :param arch:    An architecture descriptor.
        :param block: The VEX block instance.
        :return: True if the entire block is a single-byte or multi-byte nop instruction, False otherwise.
        :rtype: bool
        """

        if arch.name == "X86":
            if set(block.bytes) == { 'b\x90' }:
                return True
        elif arch.name == "AMD64":
            if set(block.bytes) == { 'b\x90' }:
                return True
        elif arch.name == "MIPS32":
            if arch.memory_endness == "Iend_BE":
                MIPS32_BE_NOOPS = {
                    b"\x00\x20\x08\x25",  # move $at, $at
                }
                insns = set(block.bytes[i:i + 4] for i in range(0, block.size, 4))
                if MIPS32_BE_NOOPS.issuperset(insns):
                    return True

        elif is_arm_arch(arch):
            if block.addr & 1 == 0:
                # ARM mode
                if arch.memory_endness == archinfo.Endness.LE:
                    ARM_NOOPS = {
                        b"\x00\x00\x00\x00",  # andeq r0, r0, r0
                        b"\x00\x00\xa0\xe1",  # mov r0, r0
                    }
                else:  #if arch.memory_endness == archinfo.Endness.BE:
                    ARM_NOOPS = {
                        b"\x00\x00\x00\x00",  # andeq r0, r0, r0
                        b"\xe1\xa0\x00\x00",  # mov r0, r0
                    }
                insns = set(block.bytes[i:i + 4] for i in range(0, block.size, 4))
                if ARM_NOOPS.issuperset(insns):
                    return True

            else:
                # THUMB mode, 2-byte instructions
                if arch.memory_endness == archinfo.Endness.LE:
                    THUMB_NOOPS = {
                        b"\xc0\x46",  # mov r8, r8
                        b"\xb0\x00",  # add sp, #0
                    }
                else:
                    THUMB_NOOPS = {
                        b"\x46\xc0",  # mov r8, r8
                        b"\x00\xb0",  # add sp, #0
                    }
                insns = set(block.bytes[i:i+4] for i in range(0, block.size, 4))
                if THUMB_NOOPS.issuperset(insns):
                    return True

        # Fallback
        # the block is a noop block if it only has IMark statements **and** it jumps to its immediate successor. VEX
        # will generate such blocks when opt_level==1 and cross_insn_opt is True
        fallthrough_addr = block.addr + block.size
        next_ = block.vex.next
        if isinstance(next_, pyvex.IRExpr.Const) and next_.con.value == fallthrough_addr:
            if all((type(stmt) is pyvex.IRStmt.IMark) for stmt in block.vex.statements):
                return True

        # the block is a noop block if it only has IMark statements and IP-setting statements that set the IP to the
        # next location. VEX will generate such blocks when opt_level==1 and cross_insn_opt is False
        ip_offset = arch.ip_offset
        if all((type(stmt) is pyvex.IRStmt.IMark
                or
                (type(stmt) is pyvex.IRStmt.Put and stmt.offset == ip_offset))
               for stmt in block.vex.statements):
            if block.vex.statements:
                last_stmt = block.vex.statements[-1]
                if isinstance(last_stmt, pyvex.IRStmt.IMark):
                    if isinstance(next_, pyvex.IRExpr.Const) and next_.con.value == fallthrough_addr:
                        return True
        return False
def _is_noop_block ( arch : archinfo . Arch , block ) : if arch . name == "X86" : if set ( block . bytes ) == { 'b\x90' } : return True elif arch . name == "AMD64" : if set ( block . bytes ) == { 'b\x90' } : return True elif arch . name == "MIPS32" : if arch . memory_endness == "Iend_BE" : MIPS32_BE_NOOPS = { b"\x00\x20\x08\x25" , # move $at, $at } insns = set ( block . bytes [ i : i + 4 ] for i in range ( 0 , block . size , 4 ) ) if MIPS32_BE_NOOPS . issuperset ( insns ) : return True elif is_arm_arch ( arch ) : if block . addr & 1 == 0 : # ARM mode if arch . memory_endness == archinfo . Endness . LE : ARM_NOOPS = { b"\x00\x00\x00\x00" , # andeq r0, r0, r0 b"\x00\x00\xa0\xe1" , # mov r0, r0 } else : #if arch.memory_endness == archinfo.Endness.BE: ARM_NOOPS = { b"\x00\x00\x00\x00" , # andeq r0, r0, r0 b"\xe1\xa0\x00\x00" , # mov r0, r0 } insns = set ( block . bytes [ i : i + 4 ] for i in range ( 0 , block . size , 4 ) ) if ARM_NOOPS . issuperset ( insns ) : return True else : # THUMB mode, 2-byte instructions if arch . memory_endness == archinfo . Endness . LE : THUMB_NOOPS = { b"\xc0\x46" , # mov r8, r8 b"\xb0\x00" , # add sp, #0 } else : THUMB_NOOPS = { b"\x46\xc0" , # mov r8, r8 b"\x00\xb0" , # add sp, #0 } insns = set ( block . bytes [ i : i + 4 ] for i in range ( 0 , block . size , 4 ) ) if THUMB_NOOPS . issuperset ( insns ) : return True # Fallback # the block is a noop block if it only has IMark statements **and** it jumps to its immediate successor. VEX # will generate such blocks when opt_level==1 and cross_insn_opt is True fallthrough_addr = block . addr + block . size next_ = block . vex . next if isinstance ( next_ , pyvex . IRExpr . Const ) and next_ . con . value == fallthrough_addr : if all ( ( type ( stmt ) is pyvex . IRStmt . IMark ) for stmt in block . vex . statements ) : return True # the block is a noop block if it only has IMark statements and IP-setting statements that set the IP to the # next location. VEX will generate such blocks when opt_level==1 and cross_insn_opt is False ip_offset = arch . ip_offset if all ( ( type ( stmt ) is pyvex . IRStmt . IMark or ( type ( stmt ) is pyvex . IRStmt . Put and stmt . offset == ip_offset ) ) for stmt in block . vex . statements ) : if block . vex . statements : last_stmt = block . vex . statements [ - 1 ] if isinstance ( last_stmt , pyvex . IRStmt . IMark ) : if isinstance ( next_ , pyvex . IRExpr . Const ) and next_ . con . value == fallthrough_addr : return True return False