3
^	                 @   s   d dl mZ d dlZd dlZd dlZd dljZd dlm	Z	 d dl
mZ d dl
mZ ejjejje\ZZdZej ejdd	d
dejdd	ddeje	dejdd	ddejddejdddddd Zedkreejdd  dS )    )print_functionN)VERSION)PYTHON_VERSION)disassemble_file*.pyc*.pyoz--asm/--noasmFz.Produce output suitable for the xasm assembler)defaulthelpz--show-bytes/--noshow-bytesz include bytecode bytes in output)versionz--header/--no-headerz'Show only the module header informationfiles   T)readable)nargstyperequiredc             C   s   dt   kodkn  sddt   ko*dkn  rJtjjdt   tjd tjjdt   tjd x|D ]}tj|stjjd	|  qjnTtj|stjjd
|  qjn6tj|dk r|j	d rtjjd|tj|f  qjt
|tj| || qjW dS )af  Disassembles a Python bytecode file.

    We handle bytecode for virtually every release of Python and some releases of PyPy.
    The version of Python in the bytecode doesn't have to be the same version as
    the Python interpreter used to run this program. For example, you can disassemble Python 3.6.9
    bytecode from Python 2.7.15 and vice versa.
    g@g333333@g333333@g@zZThis code works on 2.7..3.8. code that works for %s can be found in the python-2.4 branch
r   z0This works on Python version 2.7..3.8; have %s.
   zFile name: '%s' doesn't exist
zFile name: '%s' isn't a file
2   z.pyz?File name: '%s (%d bytes)' is too short to be a valid pyc file
N)r   sysstderrwriteexitospexistsisfilegetsizeendswithr   stdout)ZasmZ
show_bytesheaderr   path r   N/home/psgendb/BIRCHDEV/python/lib/python3.6/site-packages/xdis/bin/pydisasm.pymain   s.    





r!   __main__)r   r   )
__future__r   r   osclickos.pathr   r   Zxdis.versionr   xdisr   r   splitextbasename__file__programextZPATTERNScommandoptionZversion_optionargumentZPathr!   __name__argvr   r   r   r    <module>   s2   

,(