Skip to main content

buildstatus Pypi Installs Latest Version Supported Python Versions

packagestatus

xdis

A Cross-Python bytecode isassembler, bytecode/wordcode and magic-number manipulation library/package.

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

Also, if you need to modify and write bytecode, the routines here can be of help. There are routines to pack and unpack the read-only tuples in Python’s Code type. For interoperability between Python 2 and 3 we provide our own versions of the Code type, and we provide routines to reduce the tedium in writing a bytecode file.

This package also has an extensive knowledge of Python bytecode magic numbers, including Pypy and others, and how to translate from sys.sys_info major, minor, and release numbers to the corresponding magic value.

So If you want to write a cross-version assembler, or a bytecode-level optimizer this package may also be useful. In addition to the kinds of instruction categorization that dis offers, we have additional categories for things that would be useful in such a bytecode optimizer.

The programs here accept bytecodes from Python version 1.0 to 3.8 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

The standard Python routine:

$ pip install -e .
$ pip install -r requirements-dev.txt

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

Release files for xdis 4.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xdis 4.5.1
File Size Uploaded
xdis-4.5.1.tar.gz 224.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for xdis 4.5.1
File
xdis-4.5.1-py37-none-any.whl Python 3.7 none any Details
xdis-4.5.1-py36-none-any.whl Python 3.6 none any Details
xdis-4.5.1-py35-none-any.whl Python 3.5 none any Details
xdis-4.5.1-py34-none-any.whl Python 3.4 none any Details
xdis-4.5.1-py33-none-any.whl Python 3.3 none any Details
xdis-4.5.1-py32-none-any.whl Python 3.2 none any Details
xdis-4.5.1-py26-none-any.whl Python 2.6 none any Details
xdis-4.5.1-py3.8.egg Legacy Egg format - - Details
xdis-4.5.1-py3.7.egg Legacy Egg format - - Details
xdis-4.5.1-py3.6.egg Legacy Egg format - - Details
xdis-4.5.1-py3.5.egg Legacy Egg format - - Details
xdis-4.5.1-py3.4.egg Legacy Egg format - - Details
xdis-4.5.1-py3.3.egg Legacy Egg format - - Details
xdis-4.5.1-py3.2.egg Legacy Egg format - - Details
xdis-4.5.1-py2.6.egg Legacy Egg format - - Details
xdis-4.5.1-py2.5.egg Legacy Egg format - - Details
xdis-4.5.1-py2.4.egg Legacy Egg format - - Details

Total release size: 3.2 MB

Release files / xdis-4.5.1.tar.gz

Download URL xdis-4.5.1.tar.gz
Size 224.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2cbdbff1325a78b2f825bc065ccd1d3c827cd5188963ec87a2f89576eb5867bd
BLAKE2b-256 checksum
How to use checksums
c8991e9d8800e0649bff469f6789a5186af0eb6d5de1582bec59e8838e350516
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py37-none-any.whl

Download URL xdis-4.5.1-py37-none-any.whl
Size 115.8 kB
Tags Python 3.7
SHA-256 checksum
How to use checksums
ae8f24a0a6045bfea8e6be916ebb3b722d668a5c67315c4cf0d7d71bcf6588a8
BLAKE2b-256 checksum
How to use checksums
ea0e61c11e4c986615ee2a06902c637bbd53f71392e9320760812d9d60d87b37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py36-none-any.whl

Download URL xdis-4.5.1-py36-none-any.whl
Size 115.8 kB
Tags Python 3.6
SHA-256 checksum
How to use checksums
59a0f6c064c6639d867182a220cd8ddd53797c21d4103103c43b8b5c7df93c0c
BLAKE2b-256 checksum
How to use checksums
a6b658e369a7db31f685630538aee76ca65359d6ffaf86ac2cf4be8a3d99251a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py35-none-any.whl

Download URL xdis-4.5.1-py35-none-any.whl
Size 115.8 kB
Tags Python 3.5
SHA-256 checksum
How to use checksums
33da8db6de7defd4620f997d8393676fc20fb4ce2249bbc67595506bb8eb16a6
BLAKE2b-256 checksum
How to use checksums
0dde324c9150ea3840b94c1e8f9622cd2dba93d184e87b8428551cf2d929396c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py34-none-any.whl

Download URL xdis-4.5.1-py34-none-any.whl
Size 115.8 kB
Tags Python 3.4
SHA-256 checksum
How to use checksums
fd6eb451b042d6089054f891876638614340379d58583e44990856aea6c30cda
BLAKE2b-256 checksum
How to use checksums
68c3555c07a7250334c0d5d9b4e362987ee2165320b551f8b562292eeb922830
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py33-none-any.whl

Download URL xdis-4.5.1-py33-none-any.whl
Size 111.6 kB
Tags Python 3.3
SHA-256 checksum
How to use checksums
9e208987148c2413b79267e34e3b10bc4c6be2a2579421374f23dfa65385e05d
BLAKE2b-256 checksum
How to use checksums
dc5afad4c6f508bb3c988247cf4a8c9255aa8a68f8166b5b8f57f77d08443823
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py32-none-any.whl

Download URL xdis-4.5.1-py32-none-any.whl
Size 111.5 kB
Tags Python 3.2
SHA-256 checksum
How to use checksums
fd7211eb84f93f91f0611f3fa2425d13ad7aae317434daebbd8d975a86dcc76c
BLAKE2b-256 checksum
How to use checksums
16d3f332c477b65272db75fda54d098cf4aca750c7b1cd0d9acd1635151fce7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py26-none-any.whl

Download URL xdis-4.5.1-py26-none-any.whl
Size 111.5 kB
Tags Python 2.6
SHA-256 checksum
How to use checksums
a4c8116de0ec24c995a34ca0e5354db8d17541e4e8bb0d3b4511860df558e969
BLAKE2b-256 checksum
How to use checksums
d82edb268deb8788eaac9282d00f367e95efbd609a94ac4035c9442219b86ac8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py3.8.egg

Download URL xdis-4.5.1-py3.8.egg
Size 216.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
cb27740ad0787be18ab19b99dae8d0abbc2e14b08ec5b6ec98bb133e45c61686
BLAKE2b-256 checksum
How to use checksums
c994abe7a74cf33a5fe9e2b335443b11c73ac783d8038d1a9941658e792d141f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py3.7.egg

Download URL xdis-4.5.1-py3.7.egg
Size 215.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
97ae31f9abe2e614bff0c39e1cc14435c015bd8403041a4bf9cdfea7a72b15b2
BLAKE2b-256 checksum
How to use checksums
455f959409efcac42519d54205eb0bc0f09608c6f49fb5c07a872fff04df058d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py3.6.egg

Download URL xdis-4.5.1-py3.6.egg
Size 215.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
cf4e00e2a4b492370516641661dd2118035671d12703d4d74c4ec20efc7a365d
BLAKE2b-256 checksum
How to use checksums
cdf5854536197f3f8dd3301ae3d2491555e3730ff208d84f383a6080dbb2dae1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py3.5.egg

Download URL xdis-4.5.1-py3.5.egg
Size 219.5 kB
Tags Egg
SHA-256 checksum
How to use checksums
80e349afe02aeaf1fd78d04a8620ac6b033d002775f5da805aa0d97214b6f244
BLAKE2b-256 checksum
How to use checksums
c36b7103c59d524fd30538ab351785589914d6ce679144715e4628f64e44530a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py3.4.egg

Download URL xdis-4.5.1-py3.4.egg
Size 220.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
73ffd15eadf26173464c607195734d569df7ea5ee0aa4f093bb7fd7b5f2b56bf
BLAKE2b-256 checksum
How to use checksums
5c935cacce35a3883732dc577a92f7010aef6265572ecdb8e5d23c00301eae6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py3.3.egg

Download URL xdis-4.5.1-py3.3.egg
Size 221.2 kB
Tags Egg
SHA-256 checksum
How to use checksums
3e57e710414957b34c41f14cd2918db826e76f3d2dac93fdcd3d428848bc9fcb
BLAKE2b-256 checksum
How to use checksums
f248e9683c5694243900283b6e8a88143413f3ffbdc0a0db24758f4f6f010ef8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py3.2.egg

Download URL xdis-4.5.1-py3.2.egg
Size 218.5 kB
Tags Egg
SHA-256 checksum
How to use checksums
ab90065a8f6701cb5a26560e1589ea561bb0c63ea346443fcb4deb816a8aacc9
BLAKE2b-256 checksum
How to use checksums
db350c6f58e9c11235f3f5db55731e06cf782f4dfcf35a3862528b1143fbc5fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py2.6.egg

Download URL xdis-4.5.1-py2.6.egg
Size 216.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
ff26d02e7ae007b96af02cb6e0dab53269557e71d67ea69cbcb911c4fc384741
BLAKE2b-256 checksum
How to use checksums
ac5916de939b99b3a3a1bb45b9cd776b1fa0e28c30e475fdfe07a112736c8b03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py2.5.egg

Download URL xdis-4.5.1-py2.5.egg
Size 225.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
bf7377f36d307298bc440edc1c79300e722a17fbd9bba288f855c7adcc959f70
BLAKE2b-256 checksum
How to use checksums
c2f386fa686f937235ba6fc946a1232718e107ddfca715597b7997d606b7fd37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release files / xdis-4.5.1-py2.4.egg

Download URL xdis-4.5.1-py2.4.egg
Size 229.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
0e5654d096fd3a3da7f32dc95ff1d7e8dcf1b9e9811e793907fe23c720fb6021
BLAKE2b-256 checksum
How to use checksums
3a74102183f39acbc0474a27789fc5ea10c314f2754b9c6905f12cc5b6223147
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Release history Release notifications | RSS feed

6.3.0

12 release files

6.1.8

9 release files

6.1.7

9 release files

6.1.6

6 release files

6.1.5

3 release files

6.1.4

11 release files

6.1.3

7 release files

6.1.2

9 release files

6.1.1

5 release files

6.1.0

3 release files

6.0.5

27 release files

6.0.4

23 release files

6.0.2

24 release files

6.0.1

24 release files

6.0.0

25 release files

5.0.9

14 release files

5.0.8

11 release files

5.0.7

13 release files

5.0.6

14 release files

5.0.5

13 release files

5.0.4

21 release files

5.0.3

20 release files

5.0.2

21 release files

5.0.1

21 release files

5.0.0

20 release files

4.7.0

21 release files

4.6.1

19 release files

4.6.0

20 release files

This release

4.5.1 This release

18 release files

4.5.0

18 release files

4.4.0

20 release files

4.3.2

21 release files

4.2.4

19 release files

4.2.3

15 release files

4.2.2

20 release files

4.2.1

20 release files

4.1.3

20 release files

4.1.2

15 release files

4.1.1

15 release files

4.1.0

17 release files

4.0.3

8 release files

4.0.2

14 release files

4.0.1

15 release files

4.0.0

14 release files

3.9.1

14 release files

3.9.0

11 release files

3.8.9

7 release files

3.8.8

15 release files

3.8.7

17 release files

3.8.4

15 release files

3.8.2

15 release files

3.8.1

16 release files

3.6.9

15 release files

3.6.8

16 release files

3.6.7

15 release files

3.6.6

15 release files

3.6.5

9 release files

3.6.1

10 release files

3.6.0

9 release files

3.5.5

8 release files

3.5.4

9 release files

3.5.3

9 release files

3.5.2

10 release files

3.5.1

10 release files

3.5.0

5 release files

3.4.0

7 release files

3.3.1

7 release files

3.3.0

7 release files

3.2.4

11 release files

3.2.3

3 release files

3.2.2

7 release files

3.2.1

5 release files

3.2.0

5 release files

3.1.0

6 release files

3.0.2

4 release files

3.0.1

6 release files

3.0.0

6 release files

2.3.2

3 release files

2.3.1

6 release files

2.2.3

6 release files

2.2.2

6 release files

2.2.1

6 release files

2.2.0

6 release files

2.1.0

6 release files

2.0.3

6 release files

2.0.2

6 release files

2.0.1

6 release files

2.0.0

6 release files

1.1.7

6 release files

1.1.6

6 release files

1.1.5

6 release files

1.1.4

6 release files

1.1.3

6 release files

1.1.2

6 release files

1.1.1

6 release files

1.1.0

8 release files

1.0.5

6 release files

1.0.4

6 release files

1.0.3

6 release files

1.0.2

6 release files

1.0.1

6 release files

1.0.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page