GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: a ruby-to-pyc compiler
Clone URL: git://github.com/why/unholy.git
why (author)
Mon May 05 11:36:37 -0700 2008
commit  82cce7287f80b8a7309d399615ec48a81bb03480
tree    86322b03ddd2be27e1bbdf910059c0237f7ebd0c
parent  7ff70885df568be45997640f65415915231a46a2
unholy / decompyle / README
100644 126 lines (79 sloc) 3.712 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
 
             decompyle -- A Python byte-code decompiler
                          2.3
                          2004-12-12
 
Introduction
------------
 
'decompyle' converts Python byte-code back into equivalent Python
source. It accepts byte-code from any Python version starting with 1.5
up to 2.3.
 
The generated source is very readable: docstrings, lists, tuples and
hashes get pretty-printed.
 
'decompyle' may also verify the equivalence of the generated source by
by compiling it and comparing both byte-codes.
 
'decompyle' is based on John Aycock's generic small languages compiler
'spark' (http://www.csr.uvic.ca/~aycock/python/) and his prior work on
'decompyle'.
 
Additional note (3 July 2004, Ben Burton):
 
    The original website from which this software was obtained is no longer
    available. It has now become a commercial decompilation service, with
    no software available for download.
 
    Any developers seeking to make alterations or enhancements to this code
    should therefore consider these debian packages an appropriate starting
    point.
 
Features
--------
 
  * decompyles Python byte-code into equivalent Python source
 
  * decompyles byte-code from Python versions 1.5 up to 2.3
 
  * pretty-prints docstrings, hashes, lists and tuples
  
  * supports an option for verifing the generated Python source is
    equivalent to the byte-code. This is done by compiling the
    generated source and comparing both byte-codes.
 
  * decompyles and successfully verifies 100% of the Python 1.5, 2.0,
    2.1 and 2.2 library
 
  * decompyles and successfully verifies 100% of the Python 1.5
    library, including lib-stdwin, lib-tk, gnome and gtk.
 
  * reads directly from .pyc/.pyo files, bulk-decompyle whole
    directories
 
  * output may be written to file, a directory or to stdout
 
  * option for including byte-code disassembly into generated source
 
  * If translation fails, the part causing the problem is output. This
    helps improofing 'decompyle'. If this happens to you, please
    contact the author.
 
  For a list of changes please refer to the 'CHANGES' file.
 
 
Requirements
------------
 
'decompyle' requires Python 2.2 or later.
 
 
Installation
------------
 
You may either create a RPM and install this, or install directly from
the source distribution.
 
Creating RPMS:
 
  python setup.py bdist_rpm
 
  If you need to force the python interpreter to eg. pyton2:
     python2 setup.py bdist_rpm --python=python2
 
 
Installation from the source distribution:
 
     python setup.py install
 
   To install to a user's home-dir:
     python setup.py install --home=<dir>
 
   To install to another prefix (eg. /usr/local)
     python setup.py install --prefix=/usr/local
 
  If you need to force the python interpreter to eg. pyton2:
     python2 setup.py install
 
  For more information on 'Installing Python Modules' please refer to
     http://www.python.org/doc/current/inst/inst.html
 
 
Usage
-----
 
decompyle -h    prints short usage
decompyle --help  prints long usage
 
 
Known Bugs/Restrictions
-----------------------
 
* EXTENDED_ARG token is untested (this is a new token for Python 2.0
  which is used only if many items exist within a code object).
 
* Verifying decompyled source with optizimzed byte code (.pyo) when
  running without optimizations (option '-O' not given) fails in most
  cases. Same is true for vis-a-versa. This is due to the fact that
  Python generated different bytecode depending on option '-O'.
 
 
* Python 2.2 generated different byte-code than prior version for the
  same source. This is due the intruduction of iterators. Currently
  'decompyle' fails verifying this source if the byte-code was
  generated by an older version of Python.