Skip to main content

Python cross-version byte-code disassembler and marshal routines

Project description

buildstatus Supported Python Versions

xdis

Cross-Python bytecode Disassembler and Marshal routines

Introduction

The Python dis module allows you to disassemble bytecode from the same version of Python that you are running on. But what about bytecode from different versions?

That’s what this package is for. It can “marshal load” Python bytecodes from different versions of Python. The command-line routine pydisasm will show disassembly output using Python 3.6 disassembly conventions.

It accepts bytecodes from Python version 1.5 to 3.6 or so. The code requires Python 2.4 or later and has been tested on Python running lots of Python versions.

To install versions for Python before 2.6 install via eggs or use the python-2.4 branch of git in github.

Installation

This uses setup.py, so it follows the standard Python routine:

pip install -r requirements.txt
pip install -r requirements-dev.txt
python setup.py install # may need sudo
# or if you have pyenv:
python setup.py develop

A GNU makefile is also provided so make install (possibly as root or sudo) will do the steps above.

Testing

make check

A GNU makefile has been added to smooth over setting running the right command, and running tests from fastest to slowest.

If you have remake installed, you can see the list of all tasks including tests via remake --tasks.

Usage

Run

./bin/pydisasm -h

for usage help.

As a drop-in replacement for dis

xdis also provides some support as a drop in replacement for the the Python library dis module. This is may be desirable when you want to use the improved API from Python 3.4 or later from an earlier Python version.

For example:

>>> # works in Python 2 and 3
>>> import xdis.std as dis
>>> [x.opname for x in dis.Bytecode('a = 10')]
['LOAD_CONST', 'STORE_NAME', 'LOAD_CONST', 'RETURN_VALUE']

There may some small differences in output produced for formatted disassembly or how we show compiler flags. We expect you’ll find the xdis output more informative though.

See Also

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xdis-3.5.4.tar.gz (151.5 kB view details)

Uploaded Source

Built Distributions

xdis-3.5.4-py3.5.egg (144.1 kB view details)

Uploaded Egg

xdis-3.5.4-py3.4.egg (144.5 kB view details)

Uploaded Egg

xdis-3.5.4-py3.3.egg (145.1 kB view details)

Uploaded Egg

xdis-3.5.4-py2.py3-none-any.whl (70.6 kB view details)

Uploaded Python 2Python 3

xdis-3.5.4-py2.7.egg (146.3 kB view details)

Uploaded Egg

xdis-3.5.4-py2.6.egg (146.6 kB view details)

Uploaded Egg

xdis-3.5.4-py2.5.egg (146.8 kB view details)

Uploaded Egg

xdis-3.5.4-py2.4.egg (149.3 kB view details)

Uploaded Egg

File details

Details for the file xdis-3.5.4.tar.gz.

File metadata

  • Download URL: xdis-3.5.4.tar.gz
  • Upload date:
  • Size: 151.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.5.4.tar.gz
Algorithm Hash digest
SHA256 9576d39559f2b76b8b7b6cd380328b471642d52e8d164d52cce9da75af7ef370
MD5 ef8b9cb41a27615f3719706d10f2b506
BLAKE2b-256 d6fd8485c978edf90aef477a5feade274180c9d20be59f1cae5de906b7428e02

See more details on using hashes here.

File details

Details for the file xdis-3.5.4-py3.5.egg.

File metadata

  • Download URL: xdis-3.5.4-py3.5.egg
  • Upload date:
  • Size: 144.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.5.4-py3.5.egg
Algorithm Hash digest
SHA256 e1b28083a418eb8786d2d52fd7f1e16e276af690636f64e447aedfc3decc3b83
MD5 35dcb56c335ed107a65bf941f6a8893a
BLAKE2b-256 ee2fb4327f079e97176a04cf435393e4edc92714e0aba9ea19a1b827dc4e7646

See more details on using hashes here.

File details

Details for the file xdis-3.5.4-py3.4.egg.

File metadata

  • Download URL: xdis-3.5.4-py3.4.egg
  • Upload date:
  • Size: 144.5 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.5.4-py3.4.egg
Algorithm Hash digest
SHA256 d801f6d8cfed0c1671dccdeefbff27114f6104684944fec7caabc409cfd6bff5
MD5 f4ab6c9e0c3b819f592fc2b528525422
BLAKE2b-256 c5d279f362cf4fbffb9dafbd588072ea8fb203fb32e584b4acd55ce30751e915

See more details on using hashes here.

File details

Details for the file xdis-3.5.4-py3.3.egg.

File metadata

  • Download URL: xdis-3.5.4-py3.3.egg
  • Upload date:
  • Size: 145.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.5.4-py3.3.egg
Algorithm Hash digest
SHA256 45825d0a7320a2d3c6fb3bf9d3995885427c1f15b03e477b3f5b03064fbeb6e5
MD5 b5ca8ca4cf1ec19d13a507bbfe9d72e5
BLAKE2b-256 0ab41b54b17e4c45d014578d4ae080b7f543e308c78a00b67ca775da08ec02ae

See more details on using hashes here.

File details

Details for the file xdis-3.5.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for xdis-3.5.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 271a017ba9779c8e71b4d7882dbcffda959cddfcada5f0864c1551fa2b463108
MD5 d9fc4da963b50799a6ab10b47d491dca
BLAKE2b-256 beabbfc65551e2a9b27ab09a640735d191148297315aa90a2e526aabe473426e

See more details on using hashes here.

File details

Details for the file xdis-3.5.4-py2.7.egg.

File metadata

  • Download URL: xdis-3.5.4-py2.7.egg
  • Upload date:
  • Size: 146.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.5.4-py2.7.egg
Algorithm Hash digest
SHA256 9bc55b34843ffc48d5d101214ee83dac883b2c16ff311f7cdf4dba9054095d2d
MD5 f9b560913a22738c992d5950c1c1f084
BLAKE2b-256 f06fb5b70923444232920e5bd93a93f53791235b1305afbc18961092b4b14228

See more details on using hashes here.

File details

Details for the file xdis-3.5.4-py2.6.egg.

File metadata

  • Download URL: xdis-3.5.4-py2.6.egg
  • Upload date:
  • Size: 146.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.5.4-py2.6.egg
Algorithm Hash digest
SHA256 fb6b4224e0b7ad0d96ee9eeb31e6dccb9956be4d0090a0ec1c788a1bc7f9c2b9
MD5 3063802546a1ff2988bcb59c2f7f8c63
BLAKE2b-256 c61d44cf4f413b97b036c9970db21634c3c05bb8bc96d884e19e76514005f314

See more details on using hashes here.

File details

Details for the file xdis-3.5.4-py2.5.egg.

File metadata

  • Download URL: xdis-3.5.4-py2.5.egg
  • Upload date:
  • Size: 146.8 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.5.4-py2.5.egg
Algorithm Hash digest
SHA256 48afaaef214983738ab2f65085e325260d8391b5ef075fc082bcb348ee558379
MD5 4c21a1c396ff3274570d21cba43d8aef
BLAKE2b-256 f0d66ca83455845f530d4640f0b07ac0200f938b200afd109452a8ac9a0b65e7

See more details on using hashes here.

File details

Details for the file xdis-3.5.4-py2.4.egg.

File metadata

  • Download URL: xdis-3.5.4-py2.4.egg
  • Upload date:
  • Size: 149.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.5.4-py2.4.egg
Algorithm Hash digest
SHA256 d3f4c28a7bcaab1a3fc875f1e884862de09029c456fbdc377b78def732317cf2
MD5 609ed61f99f38320576f02586e5e4805
BLAKE2b-256 3aa69e3857dafb8adea671574fb7861efc7c4e4546cd8767065c36f952986434

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page