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

This version

3.6.3

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

Uploaded Source

Built Distributions

xdis-3.6.3-py36-none-any.whl (73.3 kB view details)

Uploaded Python 3.6

xdis-3.6.3-py34-none-any.whl (73.3 kB view details)

Uploaded Python 3.4

xdis-3.6.3-py33-none-any.whl (73.3 kB view details)

Uploaded Python 3.3

xdis-3.6.3-py26-none-any.whl (73.4 kB view details)

Uploaded Python 2.6

xdis-3.6.3-py3.6.egg (151.6 kB view details)

Uploaded Source

xdis-3.6.3-py3.5-none-any.whl (73.3 kB view details)

Uploaded Python 3

xdis-3.6.3-py3.4.egg (154.7 kB view details)

Uploaded Source

xdis-3.6.3-py3.3.egg (155.3 kB view details)

Uploaded Source

xdis-3.6.3-py2.6.egg (151.6 kB view details)

Uploaded Source

xdis-3.6.3-py2.5.egg (161.1 kB view details)

Uploaded Source

xdis-3.6.3-py2.4.egg (163.9 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for xdis-3.6.3.tar.gz
Algorithm Hash digest
SHA256 e03eb0afe27c65ac0452dc5c5010de2391624c199bb3b40cd2e82b1cd3881f22
MD5 aa6c43a90897eb755260848cb589d7c1
BLAKE2b-256 ca699b1171092034beaf4083b6d911ef8434e65a528cc3c64ad80ff736c1cb90

See more details on using hashes here.

Provenance

File details

Details for the file xdis-3.6.3-py36-none-any.whl.

File metadata

File hashes

Hashes for xdis-3.6.3-py36-none-any.whl
Algorithm Hash digest
SHA256 5d1fec888007f2834cf3929fce45fb94b0c9722e6740d9bd0dfd0913f0d4bfd0
MD5 78b7f171cf15a8a1875dd6fd4e3dcd4f
BLAKE2b-256 e8b6a6c76346a8a1dbff3e039c3794d68198020e208ae02e8458d0563eea6598

See more details on using hashes here.

Provenance

File details

Details for the file xdis-3.6.3-py34-none-any.whl.

File metadata

File hashes

Hashes for xdis-3.6.3-py34-none-any.whl
Algorithm Hash digest
SHA256 cbdcb780d66a1fd420a2952d4efb2bd09f21965716e579feca160aa2bf5e5ad7
MD5 128e021c8d43b5d4dc6cb65c0dc819be
BLAKE2b-256 428c18dfd83b07741eabaa91b71de345a78a35415f70f1f54b0b4861ec165e33

See more details on using hashes here.

Provenance

File details

Details for the file xdis-3.6.3-py33-none-any.whl.

File metadata

File hashes

Hashes for xdis-3.6.3-py33-none-any.whl
Algorithm Hash digest
SHA256 1024c11716e87405c3f3d861e8dd6200646c6974e034630473f34329d47392f6
MD5 7f5ff9c9e8187956cf8c02d64fb262f7
BLAKE2b-256 7c4b200cc3176e9945995d02dd59aaade92cc9767c23c6288ade4c6423a54822

See more details on using hashes here.

Provenance

File details

Details for the file xdis-3.6.3-py26-none-any.whl.

File metadata

File hashes

Hashes for xdis-3.6.3-py26-none-any.whl
Algorithm Hash digest
SHA256 96293251ca29f7aad80c19a514663908cc92dddc26797609e31cba0e91b36e41
MD5 f1d3b276932d0915789fe51c78a70230
BLAKE2b-256 a3f5dac6eb0f1dcd3804b330e452d4620b66ab022228e9fa873e05deb34eb19e

See more details on using hashes here.

Provenance

File details

Details for the file xdis-3.6.3-py3.6.egg.

File metadata

  • Download URL: xdis-3.6.3-py3.6.egg
  • Upload date:
  • Size: 151.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.6.3-py3.6.egg
Algorithm Hash digest
SHA256 6213f328154364fb3a6335a18b8a64901ee67719af79ee02aca738a61c1f212c
MD5 57aac0b8de150b78603b7024966017eb
BLAKE2b-256 b6db09e507887c117008e0b0d3b7152584389eb7222a085a10ee469a7e0de4a9

See more details on using hashes here.

Provenance

File details

Details for the file xdis-3.6.3-py3.5-none-any.whl.

File metadata

File hashes

Hashes for xdis-3.6.3-py3.5-none-any.whl
Algorithm Hash digest
SHA256 5099cf2f7f3f64accb98e820035a8a2d3eeb7e099c49bbdfacd917fbc071fc7f
MD5 268f0c346e0fed0c1ee5dfdbb9a0ab56
BLAKE2b-256 3a8045dd0c07c86db8e2c68e326a4c7861d166cf7f7eaf1e9dff1b4c87580240

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: xdis-3.6.3-py3.4.egg
  • Upload date:
  • Size: 154.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.6.3-py3.4.egg
Algorithm Hash digest
SHA256 b02f122d9b6f6d4074c96587ecdf77eed30786a7035d82a825cd5b677a076adc
MD5 fcd3e91f2a2b72bdf6e0892e98a76da5
BLAKE2b-256 8ad49442a21ee557157dce3e60af6f38ed34018dbbd8eca8d343112ee44106cc

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: xdis-3.6.3-py3.3.egg
  • Upload date:
  • Size: 155.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.6.3-py3.3.egg
Algorithm Hash digest
SHA256 2c0bcec0b18864ad6456209a13be650a36e9b080d81eafb31a3a408a21d39d03
MD5 dcae57007336e38e60b53f525a61aa16
BLAKE2b-256 c7154d3fa9d2a8d7e2e61e783eaf46cdbf6eb4dd4355cf8ea6f769692912d9cd

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: xdis-3.6.3-py2.6.egg
  • Upload date:
  • Size: 151.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.6.3-py2.6.egg
Algorithm Hash digest
SHA256 0599a8b51499af3b2ed18d66b4f4fd2141d103f1e2872705bdbbe84640cc8fba
MD5 3eefcf628ace7d41fc4cd34e4548f3bb
BLAKE2b-256 8cf820d5e15e51a4b99ae17b745e1cf23384690258ab5ecca2741a191c3170d3

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: xdis-3.6.3-py2.5.egg
  • Upload date:
  • Size: 161.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.6.3-py2.5.egg
Algorithm Hash digest
SHA256 7fd5e4434ca3c6ebcd3b78a0c760a9f90c57b50d3fb42c00c5cf31bc891b1b8b
MD5 0ed14a89eb991c9630e046332945cec8
BLAKE2b-256 1c1bced771f5232284abc044f476038dd59ccbe7d58d150e6cfef69d578617fb

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: xdis-3.6.3-py2.4.egg
  • Upload date:
  • Size: 163.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.6.3-py2.4.egg
Algorithm Hash digest
SHA256 9d5e0ea315ef119f94a4b431ca07c611fd408986b3fc620cff3cac606c9af7ef
MD5 8b27ca7037084de8d2aa8c12ea239eeb
BLAKE2b-256 dc152a190898dfd52de4aacd0f863c55e8c06e4bf2572ced6dcda438535c44ac

See more details on using hashes here.

Provenance

Supported by

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