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

Uploaded Source

Built Distributions

xdis-3.5.2-py3.6.egg (138.2 kB view details)

Uploaded Source

xdis-3.5.2-py3.5.egg (140.6 kB view details)

Uploaded Source

xdis-3.5.2-py3.4.egg (141.0 kB view details)

Uploaded Source

xdis-3.5.2-py3.3.egg (141.6 kB view details)

Uploaded Source

xdis-3.5.2-py2.py3-none-any.whl (69.1 kB view details)

Uploaded Python 2 Python 3

xdis-3.5.2-py2.7.egg (143.0 kB view details)

Uploaded Source

xdis-3.5.2-py2.6.egg (143.2 kB view details)

Uploaded Source

xdis-3.5.2-py2.5.egg (143.7 kB view details)

Uploaded Source

xdis-3.5.2-py2.4.egg (146.2 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for xdis-3.5.2.tar.gz
Algorithm Hash digest
SHA256 e2db992590220311554750a6f6e05d53cdbabcad5ac1e55ba9b973510bf0045a
MD5 3813257e4a73443f1740a9b3fbd1606d
BLAKE2b-256 4648727bfb7b2c79d638a37fc34e806cd4e2add9687b15049d3f18c40c6cab5d

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for xdis-3.5.2-py3.6.egg
Algorithm Hash digest
SHA256 8d742bec1ad7b0f7b7eee8b544bb53576f90ebaf119d681b154e8e9a93ab1ade
MD5 cb0317d2ffc2e56558bf5ab8780cb280
BLAKE2b-256 439c314072012e057f8d8f63122b78c49365cc14948b8f3c11f7f1cd92d905fc

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: xdis-3.5.2-py3.5.egg
  • Upload date:
  • Size: 140.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.5.2-py3.5.egg
Algorithm Hash digest
SHA256 59a6aed5400fc840dbb216c833c6a7bd9915a88f38e7666ed62073cac09e926a
MD5 1dbbe64dedee5f94644e40f56bab5d98
BLAKE2b-256 bbf38b67194c08211be41cec52ace8a6b4b2e3a88492f839f13769943a32d596

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for xdis-3.5.2-py3.4.egg
Algorithm Hash digest
SHA256 db360f7da2450b0904ed8ad848554a0c4b382ad03a8b5b835304c1496807cbed
MD5 4e08fe654e6e9ce5b45f1db4f6aab420
BLAKE2b-256 1b2e31dec2e8aa598c1e11d177cc1f9ab883260129919f194ae72469fe7f9205

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for xdis-3.5.2-py3.3.egg
Algorithm Hash digest
SHA256 05e12de1f1c4edc695b48d1ed8ea8ca0a762b7ccb4475b5b2297d6b2f366f592
MD5 f75dde22b73eb06e7d75e5be6f612715
BLAKE2b-256 bd63a8339e671fc971382d47ed5e45b3ad6fa61516ffb2246cc72829d03dee8e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for xdis-3.5.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 afce8f82e215e315a67a13ed4cf950cdfd34050d14ed029c8fb872f2c97e9c9c
MD5 175ea7b93cbcc1eadf6de42f2dbae66e
BLAKE2b-256 ad5e5d981210ca757d1e3c94ec6dff8fe004eca399c124fb42168ebea18d4a27

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: xdis-3.5.2-py2.7.egg
  • Upload date:
  • Size: 143.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xdis-3.5.2-py2.7.egg
Algorithm Hash digest
SHA256 d25508bf8b27b4dc870bb2be39896b58d383e629a1eeaa81725a9847db53c09e
MD5 1cf2d87c9519baf6fc756cea63ab8e35
BLAKE2b-256 ccee014142a5c45a2d1616ab3bb4af554492c96755ee5e04d359063151cc522b

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for xdis-3.5.2-py2.6.egg
Algorithm Hash digest
SHA256 987c3ff2d0ffdeb93245250a9e1f343ab94cb1dec68935639f386017766dee60
MD5 85aaa7a96cbc4dd9169aa9c0ea54ffff
BLAKE2b-256 1c5a394ba447d374b3296bf06f2d0de829bfcfac51b2cd1b52eae9991ea6dd16

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for xdis-3.5.2-py2.5.egg
Algorithm Hash digest
SHA256 f0cbc55f3436e0b27ea1b95698fe3d04ce4539fde9279b66177b5fbe0a9732c9
MD5 22208ddc41caec0b4ed05d11df315251
BLAKE2b-256 f87fe3936657da880ddcd8478222ad9b86f0df2f2aa80f8f036d732fb0d90631

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for xdis-3.5.2-py2.4.egg
Algorithm Hash digest
SHA256 7ae091c6989ffadf67a34c99f203653e8387e33330b5f211b7c27fa35611c864
MD5 42ba16c58429c27721715aed47779b31
BLAKE2b-256 40680dba4d16774eb33c3886e568725796a334b1659b562f83ba158b54da560f

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