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.5 disassembly conventions.

It accepts bytecodes from Python version 1.5 to 3.6 or so. The code requires Python 2.6 or later and has been tested on Python running versions 2.6, pypy-2.6.1 2.7, pypy-5.0.1, pypy-5.3.1, 3.2, 3.3, 3.4, 3.5 and 3.6.

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.3.0.tar.gz (146.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

xdis-3.3.0-py3.5.egg (120.4 kB view details)

Uploaded Egg

xdis-3.3.0-py3.4.egg (120.6 kB view details)

Uploaded Egg

xdis-3.3.0-py2.7.egg (117.9 kB view details)

Uploaded Egg

xdis-3.3.0-py2.6.egg (118.1 kB view details)

Uploaded Egg

xdis-3.3.0-py2.5.egg (127.5 kB view details)

Uploaded Egg

xdis-3.3.0-py2.4.egg (129.5 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for xdis-3.3.0.tar.gz
Algorithm Hash digest
SHA256 32eeb690e9376ad404c1fb18c1f87a09345f9beca31cee1ea8f21dd0f0dcaa07
MD5 054f7d08a959fd20b5b6781333a3eb47
BLAKE2b-256 29a6e5407f68da544d06c424531b2a59f5a7c0d2a347edfda743fe31231c01bd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for xdis-3.3.0-py3.5.egg
Algorithm Hash digest
SHA256 d05cd8f73073d26c8ef59a288cd0deea810805ba830e7cc319cf70e0a1d0b881
MD5 f4379d6803ced9c379d2674a9df9c1e3
BLAKE2b-256 d4b3c57002e26c6478144323bbfff222993b99320c88ac8333873191b3436e70

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for xdis-3.3.0-py3.4.egg
Algorithm Hash digest
SHA256 a354663625042d305a99b7b094d263e6c3e73266aed4eefe2e3bc52f4af277e8
MD5 90c837a6285e6dcfb26585753d95235b
BLAKE2b-256 a2176d73e2eebb06aa59a5c302e9e09fc9a1529e223676ba38e4ad78ef34bea1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for xdis-3.3.0-py2.7.egg
Algorithm Hash digest
SHA256 ff65920dd0e456e0fc9474129f760be4c7d02790b7d1fc84f4e8f083f54d6bbf
MD5 bfadcd1a3a07a914495afc5cd7e21f27
BLAKE2b-256 98d66174219c7bdfb69f3b5751bee772f8630a44197f2d1ed80d598f7fa8ef77

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for xdis-3.3.0-py2.6.egg
Algorithm Hash digest
SHA256 7b4b0c9e2568ee5495874413b1043168778e3f58d154039cf7a7c1aecfb49ad0
MD5 5b054bcd94abbd23d941e755154d679d
BLAKE2b-256 8f67f37710be39f0064189f09cf904b2a19138e0ede4ba177994b08bedf955ae

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for xdis-3.3.0-py2.5.egg
Algorithm Hash digest
SHA256 7134a970047fb3ab69a903534a7def8cd3a790f34b638b318fe0849a2bfaf3c3
MD5 47a543f961e5ea6121662b5bc5d24037
BLAKE2b-256 638b4df3ed7b7b4afc5fb5503b66907fcc161c44c63a4307ef0010570556608b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for xdis-3.3.0-py2.4.egg
Algorithm Hash digest
SHA256 5e486a90d53c5fcbaeedaec8aa5660380a03961209cfc22185a5e156a88069b5
MD5 4872a0c0bba8d3b88101fc46ba32d777
BLAKE2b-256 da51e892f4e8f53a308cce4075e51f9bf78b9823504141eff6809843fc68d757

See more details on using hashes here.

Supported by

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