AlkantarClanX12

Your IP : 3.144.25.248


Current Path : /proc/self/root/opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python35/lib64/python3.5/__pycache__/dis.cpython-35.opt-2.pyc



���]�C�@snddlZddlZddlZddlZddlTddlmZdddddd	d
ddd
dgeZ[ejejej	e
eefZ
dd�Zddddd�Zddddd�Zddddddddddddd d!d"d#d$d%i	Zd&d'�Zd(d)�Zd*d�Zd+d,�Zddd-d�Zejd.d/�ZGd0d
�d
e�Zd1dd2d�Zd3d4�Zd5d6�Zddddddd7d8�ZdGddd9d�ZdHdddddddd:dd;d<�Zddd=d>�Z eZ!d?d@�Z"dAd
�Z#dBd	�Z$GdCd�d�Z%dDdE�Z&e'dFkrje&�dS)I�N)�*)�__all__�	code_info�dis�disassemble�distb�disco�findlinestarts�
findlabels�	show_code�get_instructions�Instruction�BytecodecCsAyt||d�}Wn$tk
r<t||d�}YnX|S)N�eval�exec)�compile�SyntaxError)�source�name�c�r�(/opt/alt/python35/lib64/python3.5/dis.py�_try_compiles

r�filecCs�|dkrtd|�dSt|d�r5|j}t|d�rM|j}t|d�re|j}t|d�r"t|jj��}x|D]�\}}t|t	�r�t
d|d|�yt|d|�Wn8tk
r
}zt
d|d|�WYdd}~XnXt
d|�q�Wn�t|d�rDt
|d|�nct|ttf�rlt|d|�n;t|t�r�t|d|�ntd	t|�j��dS)
Nr�__func__�__code__�gi_code�__dict__zDisassembly of %s:zSorry:�co_codez(don't know how to disassemble %s objects)r�hasattrrrr�sortedr�items�
isinstance�
_have_code�printr�	TypeErrorr�bytes�	bytearray�_disassemble_bytes�str�_disassemble_str�type�__name__)�xrr!rZx1�msgrrrr s6
			&c
Css|dkrSy
tj}Wntk
r9td��YnXx|jrR|j}q=Wt|jj|jd|�dS)Nz no last traceback to disassembler)	�sys�last_traceback�AttributeError�RuntimeError�tb_nextr�tb_frame�f_code�tb_lasti)�tbrrrrrCs


�Z	OPTIMIZED�Z	NEWLOCALS�ZVARARGS�ZVARKEYWORDS�ZNESTED� Z	GENERATOR�@ZNOFREE�Z	COROUTINE�ZITERABLE_COROUTINEcCs�g}xktd�D]J}d|>}||@r|jtj|t|���||N}|sPqW|jt|��dj|�S)Nr=r8z, )�range�append�COMPILER_FLAG_NAMES�get�hex�join)�flags�names�i�flagrrr�pretty_flags\s


rKcCs�t|d�r|j}t|d�r0|j}t|d�rH|j}t|t�rft|d�}t|d�ry|Stdt|�j	��dS)Nrrrz
<disassembly>rz(don't know how to disassemble %s objects)
rrrrr"r)rr%r+r,)r-rrr�_get_code_objectjs			rLcCstt|��S)N)�_format_code_inforL)r-rrrryscCs�g}|jd|j�|jd|j�|jd|j�|jd|j�|jd|j�|jd|j�|jdt|j��|j	r�|jd�x(t
|j	�D]}|jd	|�q�W|jr|jd
�x(t
|j�D]}|jd|�q�W|jr[|jd�x(t
|j�D]}|jd|�q@W|j
r�|jd
�x(t
|j
�D]}|jd|�q�W|jr�|jd�x(t
|j�D]}|jd|�q�Wdj|�S)NzName:              %szFilename:          %szArgument count:    %szKw-only arguments: %szNumber of locals:  %szStack size:        %szFlags:             %sz
Constants:z%4d: %rzNames:z%4d: %szVariable names:zFree variables:zCell variables:�
)rB�co_name�co_filename�co_argcount�co_kwonlyargcount�
co_nlocals�co_stacksizerK�co_flags�	co_consts�	enumerate�co_names�co_varnames�co_freevars�co_cellvarsrF)�co�linesZi_cZi_nrrrrM}s:	
	
	
	
	
rMcCstt|�d|�dS)Nr)r$r)r\rrrrr�s�_InstructionzBopname opcode arg argval argrepr offset starts_line is_jump_targetc@s"eZdZdddd�ZdS)r
�FcCs0g}|rM|jdk	r<d|}|j||j�n|jd|�|rc|jd�n
|jd�|jr�|jd�n
|jd�|jt|j�jd��|j|jjd��|jdk	r|jt|j�jd	��|j	r|jd
|j	d�dj
|�j�S)Nz%%%dd� z-->z   z>>z  r:���(�))�starts_linerB�is_jump_target�repr�offset�rjust�opname�ljust�arg�argreprrF�rstrip)�self�lineno_widthZmark_as_currentZfieldsZ
lineno_fmtrrr�_disassemble�s&

	
	zInstruction._disassembleN)r,�
__module__�__qualname__rqrrrrr
�s�
first_linecCsxt|�}|j|j}tt|��}|dk	rJ||j}nd}t|j|j|j	|j
|||�S)Nr)rLr[rZ�dictr	�co_firstlineno�_get_instructions_bytesrrYrXrV)r-rtr\�
cell_names�
linestarts�line_offsetrrrr�scCs,|}|dk	r||}|t|�fS)N)rg)Zconst_indexZ
const_list�argvalrrr�_get_const_info�s
r|cCs;|}|dk	r%||}|}nt|�}||fS)N)rg)Z
name_indexZ	name_listr{rmrrr�_get_name_info�s
	r}c
cs�t|�}d}d}	x�t|�D]�\}
}}|dk	rh|j|
d�}|dk	rh||7}|
|k}
d}d}|dk	r�|}|tkr�t||�\}}n�|tkr�t||�\}}n�|tkr|
d|}dt|�}n�|t	kr+t||�\}}ng|t
krJt|}|}nH|tkrnt||�\}}n$|t
kr�d|d|df}tt||||||
||
�Vq%WdS)N�r_zto z%d positional, %d keyword pairr@)r
�_unpack_opargsrDZhasconstr|Zhasnamer}�hasjrelrgZhaslocalZ
hascompareZcmp_opZhasfreeZhasnargsr
rj)�code�varnamesrH�	constants�cellsryrz�labelsre�freerh�oprlrfr{rmrrrrws@


	
	rwc
CsT|j|j}tt|��}t|j||j|j|j||d|�dS)Nr)	r[rZrur	r(rrYrXrV)r\�lastirrxryrrrr:srzc	Cs�|dk	}	|	rdnd}
x�t||||||d|�D]h}|	og|jdk	og|jdk}|r}td|�|j|k}
t|j|
|
�d|�q@WdS)Nr_rrzr)rwrerhr$rq)r�r�r�rHr�r�ryrrzZshow_linenorpZinstrZnew_source_lineZis_current_instrrrrr(As

r(cCstt|d�d|�dS)Nz<dis>r)rr)rrrrrr*Ssr*ccs�d}t|�}d}x�||kr�||}|}|d}d}|tkr�||||dd|}d}|d}|tkr�|d}|||fVqWdS)Nrr8r@r9i)�lenZ
HAVE_ARGUMENTZEXTENDED_ARG)r�Zextended_arg�nrIr�rhrlrrrrYs



rcCs�g}x�t|�D]u\}}}|dk	rd}|tkrQ|d|}n|tkrc|}|dkr||kr|j|�qW|S)Nr8r_r���)rr�ZhasjabsrB)r�r�rhr�rlZlabelrrrr
lsccs�t|jddd��}t|jddd��}d}|j}d}xTt||�D]C\}}|r�||kr�||fV|}||7}||7}q]W||kr�||fVdS)Nrr9r8)�list�	co_lnotabrv�zip)r�Zbyte_incrementsZline_incrementsZ
lastlineno�lineno�addrZ	byte_incrZ	line_incrrrrr	s	
c@sjeZdZdddddd�Zdd�Zdd	�Zed
d��Zdd
�Zdd�Z	dS)rrtN�current_offsetcCs�t|�|_}|dkr7|j|_d|_n||_||j|_|j|j|_tt	|��|_
||_||_dS)Nr)
rL�codeobjrvrt�_line_offsetr[rZ�_cell_namesrur	�_linestarts�_original_objectr�)ror-rtr�r\rrr�__init__�s		zBytecode.__init__c	Cs=|j}t|j|j|j|j|j|jd|j�S)Nrz)	r�rwrrYrXrVr�r�r�)ror\rrr�__iter__�s
		zBytecode.__iter__cCsdj|jj|j�S)Nz{}({!r}))�format�	__class__r,r�)rorrr�__repr__�szBytecode.__repr__cCs2x|jr|j}qW||jjd|j�S)Nr�)r3r4r5r6)�clsr7rrr�from_traceback�s
zBytecode.from_tracebackcCs
t|j�S)N)rMr�)rorrr�info�sz
Bytecode.infocCs�|j}|jdk	r$|j}nd
}tj��`}t|jd|jd|jd|jd|j	d|j
d|jd|d	|�|j�SWdQRXdS)Nr8r�rHr�r�ryrzrr�r�)
r�r��io�StringIOr(rrYrXrVr�r�r��getvalue)ror\rh�outputrrrr�s				zBytecode.dis)
r,rrrsr�r�r��classmethodr�r�rrrrrr�s
cCs�ddl}|j�}|jdd|j�dddd�|j�}|j�}|j�}WdQRXt||jjd�}t	|�dS)	Nr�infiler+�nargs�?�default�-r)
�argparse�ArgumentParser�add_argument�FileType�
parse_argsr��readrrr)r��parser�argsr�rr�rrr�_test�s%r��__main__r�r�)(r/�types�collectionsr�ZopcoderZ_opcodes_all�
MethodType�FunctionType�CodeTyper��staticmethodr+r#rrrrCrKrLrrMr�
namedtupler^r
rr|r}rwrr(r*rrr
r	rr�r,rrrr�<module>sb
	
#		3	.	=