CasperSecurity

Current Path : /lib/python3.10/__pycache__/
Upload File :
Current File : //lib/python3.10/__pycache__/quopri.cpython-310.pyc

o

`�wic�@s�dZgd�ZdZdZdZdZz
ddlmZmZWn
e	y%dZdZYnwd	d
�Z
dd�Zddd�Zddd�Z
ddd�Zddd�Zdd�Zdd�Zdd�ZedkrWe�dSdS)zHConversions to/from quoted-printable transport encoding as per RFC 1521.)�encode�decode�encodestring�decodestring�=�Ls0123456789ABCDEF��)�a2b_qp�b2a_qpNcCsHt|t�sJ�|dvr
|S|dkr|S|tkp#d|ko dknS)z�Decide whether a particular byte ordinal needs to be quoted.

    The 'quotetabs' flag indicates whether embedded tabs and spaces should be
    quoted.  Note that line-ending tabs and spaces are always encoded, as per
    RFC 1521.
    � 	�_� �~)�
isinstance�bytes�ESCAPE)�c�	quotetabs�header�r�/usr/lib/python3.10/quopri.py�needsquotings"rcCsBt|t�rt|�dks
J�t|�}ttt|dt|df�S)zQuote a single character.��)rr�len�ordr�HEX�rrrr�quote$s rFc
Cs<tdur|��}t|||d�}|�|�dS|dfdd�}d}	|��}|s'nig}	d}
|dd�dkr;|dd�}d}
|D]"}t|f�}t|||�rNt|�}|rZ|d	krZ|	�d
�q=|	�|�q=|durh||�t�	|	�}t
|�tkr�||dtd�dd�|tdd�}t
|�tkss|}q |dur�|||
d�dSdS)
avRead 'input', apply quoted-printable encoding, and write to 'output'.

    'input' and 'output' are binary file objects. The 'quotetabs' flag
    indicates whether embedded tabs and spaces should be quoted. Note that
    line-ending tabs and spaces are always encoded, as per RFC 1521.
    The 'header' flag indicates whether we are encoding spaces as _ as per RFC
    1522.N�rr�
cSsn|r|dd�dvr|�|dd�t|dd��|�dS|dkr.|�t|�|�dS|�||�dS)N���r�.)�writer)�s�output�lineEndrrrr#;s
*zencode.<locals>.writerrr!r
rs=
)r&)r
�readr#�readlinerrr�append�EMPTYSTRING�joinr�MAXLINESIZE)
�inputr%rr�data�odatar#�prevline�line�outline�strippedr�thislinerrrr,sF	



��!�rcCsFtdurt|||d�Sddlm}||�}|�}t||||�|��S)Nrr��BytesIO)r
�ior6r�getvalue)r$rrr6�infp�outfprrrrjsrcCstdur|��}t||d�}|�|�dSd}	|��}|sn�dt|�}}|dkr[||d|�dkr[d}	|d}|dkrZ||d|�dvrZ|d}|dkrZ||d|�dvsHnd}	||kr�|||d�}
|
dkrx|rx|d	}|d}no|
tkr�||
}|d}nb|d|kr�|	s�d}	n[|d|kr�||d|d
�tkr�|t}|d
}n<|d
|kr�t||d|d
��r�t||d
|d��r�|tt||d|d��f�}|d}n||
}|d}||ksa|	s�|�|d�d}q|�r|�|�dSdS)z�Read 'input', apply quoted-printable decoding, and write to 'output'.
    'input' and 'output' are binary file objects.
    If 'header' is true, decode underscore as space (per RFC 1522).N�rrrrr s 	
rr
��)	r	r'r#r(rr�ishexr�unhex)r-r%rr.r/�newr1�i�n�partialrrrrrusL
��$<,���rcCsDtdur
t||d�Sddlm}||�}|�}t|||d�|��S)Nr;rr5)r	r7r6rr8)r$rr6r9r:rrrr�srcCsVt|t�sJ�d|kodknp*d|kodknp*d|ko(dkSS)zDReturn true if the byte ordinal 'c' is a hexadecimal digit in ASCII.�0�9�a�f�A�F)rrrrrrr>�sHr>cCs�d}|D]P}t|f�}d|krdkrnntd�}n.d|kr&dkr/nntd�d}nd	|kr9d
krBnntd	�d}nJdt|���|d
t|�|}q|S)z.Get the integer value of a hexadecimal number.rrDrE�0rFrG�a�
rHrIFznon-hex digit r)rr�repr)r$�bitsrrArrrr?�s

r?cCs�ddl}ddl}z|�|jdd�d�\}}Wn,|jyC}z|j|_t|�td�td�td�|�d�WYd}~nd}~wwd}d}|D]\}}|d	krTd
}|dkrZd
}qJ|rl|rl|j|_td�|�d�|sqd
g}d}	|D]W}
|
d
kr�|jj	}n&zt
|
d�}Wnty�}z|j�d|
|f�d}	WYd}~qud}~wwz|r�t
||jj	�nt||jj	|�W|
d
kr�|��qu|
d
kr�|��ww|	r�|�|	�dSdS)Nrr�tdz"usage: quopri [-t | -d] [file] ...z-t: quote tabsz-d: decode; default encoder<Fz-tTz-dz -t and -d are mutually exclusive�-�rbz%s: can't open (%s)
)�sys�getopt�argv�error�stderr�stdout�print�exit�stdin�buffer�open�OSErrorr#rr�close)rRrS�opts�args�msg�deco�tabs�orK�sts�file�fprrr�main�sd���


�����
��rh�__main__)F)FF)�__doc__�__all__rr,rr*�binasciir	r
�ImportErrorrrrrrrr>r?rh�__name__rrrr�<module>s0�

>

+.
�
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY