Giter Club home page Giter Club logo

uncompyle2's Introduction

uncompyle2

A Python 2.5, 2.6, 2.7 byte-code decompiler, written in Python 2.7

Introduction

'uncompyle2' converts Python byte-code back into equivalent Python source code. It accepts byte-code from Python version 2.5 to 2.7. Additionally, it will only run on Python 2.7.

The generated source is very readable: docstrings, lists, tuples and hashes get pretty-printed.

'uncompyle2' is based on John Aycock's generic small languages compiler 'spark' (http://www.csr.uvic.ca/~aycock/python/) and his prior work on a tool called 'decompyle'. This tool has been vastly improved by Hartmut Goebel http://www.crazy-compilers.com/

# Additional note (3 July 2004, Ben Burton):

This software is no longer available from the original website. 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.

# Additional note (5 June 2012):

The decompilation of python bytecode 2.5 & 2.6 is based on the work of Eloi Vanderbeken. bytecode is translated to a pseudo 2.7 python bytecode and then decompiled.

Features

  • decompiles Python byte-code into equivalent Python source
  • decompiles byte-code from Python version 2.5, 2.6, 2.7
  • pretty-prints docstrings, hashes, lists and tuples
  • reads directly from .pyc/.pyo files, bulk-decompile whole directories
  • output may be written to file, a directory or to stdout
  • option for including byte-code disassembly into generated source

For a list of changes please refer to the 'CHANGES' file.

Requirements

uncompyle2 requires Python 2.7

Installation

You may either create a RPM and install this, or install directly from the source distribution.

Creating RPMS:

python setup.py bdist_rpm

### 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

For more information on 'Installing Python Modules' please refer to http://www.python.org/doc/current/inst/inst.html

Usage

./scripts/uncompyle2 -h prints usage

./test_pythonlib.py test files and python library

Known Bugs/Restrictions

No support for python 3.2

It currently reconstructs most of Python code but probably needs to be tested more thoroughly. All feedback welcome

uncompyle2's People

Contributors

mysterie avatar htgoebel avatar supervirus avatar kernelsmith avatar jbremer avatar skyfion avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.