|
| 1 | + |
| 2 | + uncompyle2 |
| 3 | + A Python 2.5, 2.6, 2.7 byte-code decompiler, written in Python 2.7 |
| 4 | + 0.13 |
| 5 | + 2012-6-5 |
| 6 | + |
| 7 | +Introduction |
| 8 | +------------ |
| 9 | + |
| 10 | +'uncompyle2' converts Python byte-code back into equivalent Python |
| 11 | +source. It accepts byte-code from Python version 2.5, 2.6 & 2.7. Additionally, |
| 12 | +it will only run on Python 2.7. |
| 13 | + |
| 14 | +The generated source is very readable: docstrings, lists, tuples and |
| 15 | +hashes get pretty-printed. |
| 16 | + |
| 17 | +'uncompyle2' may also verify the equivalence of the generated source by |
| 18 | +by compiling it and comparing both byte-codes. |
| 19 | + |
| 20 | +'uncompyle2' is based on John Aycock's generic small languages compiler |
| 21 | +'spark' (http://www.csr.uvic.ca/~aycock/python/) and his prior work on |
| 22 | +'uncompyle'. |
| 23 | + |
| 24 | +Additional note (3 July 2004, Ben Burton): |
| 25 | + |
| 26 | + The original website from which this software was obtained is no longer |
| 27 | + available. It has now become a commercial decompilation service, with |
| 28 | + no software available for download. |
| 29 | + |
| 30 | + Any developers seeking to make alterations or enhancements to this code |
| 31 | + should therefore consider these debian packages an appropriate starting |
| 32 | + point. |
| 33 | + |
| 34 | +Additional note (5 June 2012): |
| 35 | + |
| 36 | + The decompilation of python bytecode 2.5 & 2.6 is based on the work of |
| 37 | + Eloi Vanderbeken. bytecode is translated to a pseudo 2.7 python bytecode |
| 38 | + and then decompiled. |
| 39 | + |
| 40 | +Features |
| 41 | +-------- |
| 42 | + |
| 43 | + * decompiles Python byte-code into equivalent Python source |
| 44 | + |
| 45 | + * decompiles byte-code from Python version 2.5, 2.6, 2.7 |
| 46 | + |
| 47 | + * pretty-prints docstrings, hashes, lists and tuples |
| 48 | + |
| 49 | + * reads directly from .pyc/.pyo files, bulk-decompile whole |
| 50 | + directories |
| 51 | + |
| 52 | + * output may be written to file, a directory or to stdout |
| 53 | + |
| 54 | + * option for including byte-code disassembly into generated source |
| 55 | + |
| 56 | + For a list of changes please refer to the 'CHANGES' file. |
| 57 | + |
| 58 | + |
| 59 | +Requirements |
| 60 | +------------ |
| 61 | + |
| 62 | +uncompyle2 requires Python 2.7 |
| 63 | + |
| 64 | + |
| 65 | +Installation |
| 66 | +------------ |
| 67 | + |
| 68 | +You may either create a RPM and install this, or install directly from |
| 69 | +the source distribution. |
| 70 | + |
| 71 | +Creating RPMS: |
| 72 | + |
| 73 | + python setup.py bdist_rpm |
| 74 | + |
| 75 | + If you need to force the python interpreter to eg. pyton2: |
| 76 | + python2 setup.py bdist_rpm --python=python2 |
| 77 | + |
| 78 | + |
| 79 | +Installation from the source distribution: |
| 80 | + |
| 81 | + python setup.py install |
| 82 | + |
| 83 | + To install to a user's home-dir: |
| 84 | + python setup.py install --home=<dir> |
| 85 | + |
| 86 | + To install to another prefix (eg. /usr/local) |
| 87 | + python setup.py install --prefix=/usr/local |
| 88 | + |
| 89 | + If you need to force the python interpreter to eg. pyton2: |
| 90 | + python2 setup.py install |
| 91 | + |
| 92 | + For more information on 'Installing Python Modules' please refer to |
| 93 | + http://www.python.org/doc/current/inst/inst.html |
| 94 | + |
| 95 | + |
| 96 | +Usage |
| 97 | +----- |
| 98 | + |
| 99 | +uncompyle2 -h prints short usage |
| 100 | +uncompyle2 --help prints long usage |
| 101 | + |
| 102 | + |
| 103 | +Known Bugs/Restrictions |
| 104 | +----------------------- |
| 105 | + |
| 106 | +I have some known bug in the 2.5 & 2.6 decompilation version but this will be fixed in a few. |
0 commit comments