403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.52
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/IPython/utils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/IPython/utils/__pycache__/_process_win32.cpython-312.pyc
�

}�e����dZddlZddlZddlZddlZddlmZmZddlmZm	Z	ddl
mZmZddl
mZddlmZmZmZdd	lmZdd
lmZGd�de�Zd
�Zd�Zd�Z	ej:j<j>Zeee�ge_ ee�e_!ej:jDjFZ#e	e#_$e	ge#_ dd�Zd�Z&y#e%$reZYd�Z&ywxYw)zWindows-specific implementation of process utilities.

This file is only meant to be imported by process.py, not by end-users.
�N)�c_int�POINTER)�LPCWSTR�HLOCAL)�STDOUT�TimeoutExpired)�Thread�)�read_no_interrupt�process_handler�	arg_split)�	py3compat)�DEFAULT_ENCODINGc��eZdZdZd�Zd�Zy)�AvoidUNCPatha�A context manager to protect command execution from UNC paths.

    In the Win32 API, commands can't be invoked with the cwd being a UNC path.
    This context manager temporarily changes directory to the 'C:' drive on
    entering, and restores the original working directory on exit.

    The context manager returns the starting working directory *if* it made a
    change and None otherwise, so that users can apply the necessary adjustment
    to their system calls in the event of a change.

    Examples
    --------
    ::
        cmd = 'dir'
        with AvoidUNCPath() as path:
            if path is not None:
                cmd = '"pushd %s &&"%s' % (path, cmd)
            os.system(cmd)
    c���tj�|_|jjd�|_|jr!tj
d�|jSy)Nz\\zC:)�os�getcwd�path�
startswith�is_unc_path�chdir)�selfs �>/usr/lib/python3/dist-packages/IPython/utils/_process_win32.py�	__enter__zAvoidUNCPath.__enter__9sI���I�I�K��	��9�9�/�/��6�������H�H�T�N��9�9���c�\�|jr tj|j�yy)N)rrrr)r�exc_type�	exc_value�	tracebacks    r�__exit__zAvoidUNCPath.__exit__Es ������H�H�T�Y�Y��rN)�__name__�
__module__�__qualname__�__doc__rr!�rrrr%s���&
� rrc�����t���fd�}��fd�}t|��j�t|��j�	�j�}|�t	j
d�n|S�+)zCallback for _system.c���t�j�j�D]/}|j�d�}t	|t
j���1y�N�replace)�file)r�stdout�
splitlines�decode�print�sys��line�enc�ps ��r�stdout_readz!_system_body.<locals>.stdout_readN�B���%�a�h�h�/�:�:�<�	)�D��;�;�s�I�.�D��$�S�Z�Z�(�	)rc���t�j�j�D]/}|j�d�}t	|t
j���1yr))r�stderrr-r.r/r0r1s ��r�stderr_readz!_system_body.<locals>.stderr_readSr6r)�targetg{�G�z�?)rr	�start�poll�time�sleep)r4r5r9�resultr3s`   @r�_system_bodyr@Jsa���
�C�)�
)�
�+��$�$�&�
�+��$�$�&�
�������>��J�J�t���M�rc�v�t�5}|�d|�d|��}t|t�cddd�S#1swYyxYw)a7Win32 version of os.system() that works with network shares.

    Note that this implementation returns None, as meant for use in IPython.

    Parameters
    ----------
    cmd : str or list
        A command to be executed in the system shell.

    Returns
    -------
    int : child process' exit code.
    N�"pushd � &&")rrr@)�cmdrs  r�systemrEfs:��&
��2�4���'+�S�1�C��s�L�1�2�2�2�s�/�8c��t�5}|�d|�d|��}t|d�t�}ddd��d}tj|�S#1swY�"xYw)z�Return standard output of executing cmd in a shell.

    Accepts the same arguments as os.system().

    Parameters
    ----------
    cmd : str or list
        A command to be executed in the system shell.

    Returns
    -------
    stdout : str
    NrBrCc�(�|j�dS)Nr)�communicate)r4s r�<lambda>zgetoutput.<locals>.<lambda>�s��Q�]�]�_�Q�-?�rr)rrrrr.)rDr�outs   r�	getoutputrK~s`��
��I�4���'+�S�1�C��c�#?��H��I�
�{������C� � �I�I�s�A	�	Ac��|j�dk(rgS|st|||��St�}tt	j
|j
��tj|��}t|jz}|jtj|j��D�cgc]}|��}}t|�}|Scc}w)a4Split a command line's arguments in a shell-like manner.

        This is a special version for windows that use a ctypes call to CommandLineToArgvW
        to do the argv splitting. The posix parameter is ignored.

        If strict=False, process_common.arg_split(...strict=False) is used instead.
        �)�posix�strict)�strip�py_arg_splitr�CommandLineToArgvWr�cast_unicode�lstrip�ctypes�byrefr�value�from_address�	addressof�contents�	LocalFree)	�commandlinerNrO�argvn�result_pointer�result_array_type�argr?�retvals	         rr
r
�s�������"�$��I����5��H�H����+�I�,B�,B�;�CU�CU�CW�,X�Z`�Zf�Zf�gl�Zm�n��#�e�k�k�1��!2�!?�!?��@P�@P�Q_�Qh�Qh�@i�!j�k�#�#�k��k��>�*���
��ls�3	Cc�j�ttjjj	dd|��S)Nr
r)�boolrU�windll�kernel32�OpenProcess)�pids r�	check_pidrh�s(����
�
�&�&�2�2�1�Q�s�;�<�<r)FT)'r%rr0rUr=rr�ctypes.wintypesrr�
subprocessrr�	threadingr	�_process_commonrrr
rQrMr�encodingr�objectrr@rErKrd�shell32rR�	arg_types�restyperer[�res_type�AttributeErrorrhr&rr�<module>rts����"
�
�
��!�+�-��[�Z��&�" �6�" �J�82�0!�0����.�.�A�A��$+�W�U�^�#<�� �!(��!1����
�
�&�&�0�0�I��I��!�(�I���.=�����I�=��s�A/C�C�C

Youez - 2016 - github.com/yon3zu
LinuXploit