head 1.43; access; symbols pkgsrc-2023Q4:1.42.0.8 pkgsrc-2023Q4-base:1.42 pkgsrc-2023Q3:1.42.0.6 pkgsrc-2023Q3-base:1.42 pkgsrc-2023Q2:1.42.0.4 pkgsrc-2023Q2-base:1.42 pkgsrc-2023Q1:1.42.0.2 pkgsrc-2023Q1-base:1.42 pkgsrc-2022Q4:1.41.0.6 pkgsrc-2022Q4-base:1.41 pkgsrc-2022Q3:1.41.0.4 pkgsrc-2022Q3-base:1.41 pkgsrc-2022Q2:1.41.0.2 pkgsrc-2022Q2-base:1.41 pkgsrc-2022Q1:1.40.0.2 pkgsrc-2022Q1-base:1.40 pkgsrc-2021Q4:1.38.0.2 pkgsrc-2021Q4-base:1.38 pkgsrc-2021Q3:1.34.0.2 pkgsrc-2021Q3-base:1.34 pkgsrc-2021Q2:1.31.0.2 pkgsrc-2021Q2-base:1.31 pkgsrc-2021Q1:1.30.0.2 pkgsrc-2021Q1-base:1.30 pkgsrc-2020Q4:1.28.0.2 pkgsrc-2020Q4-base:1.28 pkgsrc-2020Q3:1.27.0.2 pkgsrc-2020Q3-base:1.27 pkgsrc-2020Q2:1.26.0.2 pkgsrc-2020Q2-base:1.26 pkgsrc-2020Q1:1.17.0.2 pkgsrc-2020Q1-base:1.17 pkgsrc-2019Q4:1.15.0.4 pkgsrc-2019Q4-base:1.15 pkgsrc-2019Q3:1.10.0.2 pkgsrc-2019Q3-base:1.10 pkgsrc-2019Q2:1.9.0.2 pkgsrc-2019Q2-base:1.9 pkgsrc-2019Q1:1.5.0.2 pkgsrc-2019Q1-base:1.5 pkgsrc-2018Q4:1.2.0.2 pkgsrc-2018Q4-base:1.2 pkgsrc-2018Q3:1.1.0.2 pkgsrc-2018Q3-base:1.1; locks; strict; comment @# @; 1.43 date 2024.03.23.06.49.52; author adam; state Exp; branches; next 1.42; commitid n1gDXvruk2c7Ff3F; 1.42 date 2023.01.16.09.26.23; author adam; state Exp; branches; next 1.41; commitid NpOd8hSXXZ7JpK9E; 1.41 date 2022.05.22.19.05.00; author adam; state Exp; branches; next 1.40; commitid BNUC4izJoNVAi5FD; 1.40 date 2022.01.05.15.41.09; author wiz; state Exp; branches; next 1.39; commitid FQ77UruBIUsgzsnD; 1.39 date 2022.01.04.20.53.48; author wiz; state Exp; branches; next 1.38; commitid CYyhdK9qtoffkmnD; 1.38 date 2021.12.17.00.15.47; author wiz; state Exp; branches; next 1.37; commitid q9BgOickmYi64WkD; 1.37 date 2021.11.10.16.09.53; author adam; state Exp; branches; next 1.36; commitid 1J6T4TigioL8xggD; 1.36 date 2021.10.31.08.40.03; author adam; state Exp; branches; next 1.35; commitid Dkgt7AZt5zFImWeD; 1.35 date 2021.09.28.16.17.23; author adam; state Exp; branches; next 1.34; commitid kwCg65JqhgZqXJaD; 1.34 date 2021.09.12.09.58.03; author adam; state Exp; branches; next 1.33; commitid bMnmS9mQroQ9nE8D; 1.33 date 2021.07.07.10.11.47; author adam; state Exp; branches; next 1.32; commitid zFc0kriqRFqoB20D; 1.32 date 2021.06.23.20.11.31; author adam; state Exp; branches; next 1.31; commitid FB15WGthrasPmiYC; 1.31 date 2021.04.22.16.07.43; author adam; state Exp; branches; next 1.30; commitid PmoABU79NDhY0jQC; 1.30 date 2021.03.14.08.25.02; author adam; state Exp; branches; next 1.29; commitid SjLkUctKfc2XHfLC; 1.29 date 2021.01.11.07.17.06; author adam; state Exp; branches; next 1.28; commitid ndomZPmsOwBbkhDC; 1.28 date 2020.10.27.22.33.37; author adam; state Exp; branches; next 1.27; commitid sXvOEj2qYJT2QAtC; 1.27 date 2020.09.10.09.25.02; author adam; state Exp; branches; next 1.26; commitid 5wSc3hfw976WYtnC; 1.26 date 2020.06.20.16.21.38; author adam; state Exp; branches; next 1.25; commitid K5CPWfQw5VRyVYcC; 1.25 date 2020.06.12.06.26.47; author adam; state Exp; branches; next 1.24; commitid Yz1I0hRGRDYoTTbC; 1.24 date 2020.05.23.08.41.11; author adam; state Exp; branches; next 1.23; commitid Y8P0ksA001Qmhl9C; 1.23 date 2020.05.16.14.07.20; author adam; state Exp; branches; next 1.22; commitid 2BWZGPuUAC0kjt8C; 1.22 date 2020.04.28.11.01.17; author adam; state Exp; branches; next 1.21; commitid 9aK6TeovSfVcR86C; 1.21 date 2020.04.22.20.44.34; author adam; state Exp; branches; next 1.20; commitid WUE7e8R7bepkhq5C; 1.20 date 2020.04.17.05.47.33; author adam; state Exp; branches; next 1.19; commitid b277hhk1gn2wtH4C; 1.19 date 2020.04.16.18.32.32; author adam; state Exp; branches; next 1.18; commitid qiLhoHtZJzBQJD4C; 1.18 date 2020.03.31.16.26.13; author adam; state Exp; branches; next 1.17; commitid zaSeDY4pRgIyyz2C; 1.17 date 2020.03.17.10.28.07; author adam; state Exp; branches; next 1.16; commitid PaDgSH5Q9MrB1K0C; 1.16 date 2019.12.31.10.16.56; author adam; state Exp; branches; next 1.15; commitid j34rNaj6mLV9rQQB; 1.15 date 2019.12.11.13.18.25; author adam; state Exp; branches; next 1.14; commitid irI1NCP9JcIl5iOB; 1.14 date 2019.11.20.09.29.21; author adam; state Exp; branches; next 1.13; commitid 6qE8mj6dqXzCuzLB; 1.13 date 2019.10.31.08.22.00; author adam; state Exp; branches; next 1.12; commitid HCp7TeQMx0H8LZIB; 1.12 date 2019.10.15.16.59.35; author adam; state Exp; branches; next 1.11; commitid AeLpcrcZuziN8ZGB; 1.11 date 2019.10.07.05.38.38; author adam; state Exp; branches; next 1.10; commitid eFjLxUqczCSaDTFB; 1.10 date 2019.08.03.08.55.10; author adam; state Exp; branches; next 1.9; commitid ssQ6dO3OS3L6OyxB; 1.9 date 2019.06.13.07.52.45; author adam; state Exp; branches; next 1.8; commitid LFedstefPTnj60rB; 1.8 date 2019.05.02.08.32.15; author adam; state Exp; branches; next 1.7; commitid hwFJ9LYmEORyFBlB; 1.7 date 2019.04.17.12.16.05; author adam; state Exp; branches; next 1.6; commitid regzcMiP6dU9oHjB; 1.6 date 2019.04.01.10.24.15; author adam; state Exp; branches; next 1.5; commitid WfkckPmntxlLhDhB; 1.5 date 2019.03.26.20.57.37; author adam; state Exp; branches; next 1.4; commitid 0GsGRkPKd2s0ZUgB; 1.4 date 2019.03.10.13.52.36; author adam; state Exp; branches; next 1.3; commitid LqcnApAwDAf79PeB; 1.3 date 2019.01.04.22.13.11; author adam; state Exp; branches; next 1.2; commitid xMdTzQncLRrk0w6B; 1.2 date 2018.10.23.08.05.39; author adam; state Exp; branches; next 1.1; commitid 5StCRdbLtai0F3XA; 1.1 date 2018.09.20.13.45.11; author adam; state Exp; branches; next ; commitid 1ccGDXGmvGDjBQSA; desc @@ 1.43 log @py-xdis: updated to 6.1.0 6.1.0 2024-03-15 ================= Lots of changes major changes. API has changed. We now support many disassembly options: * classic: disasm-like output * bytes: disasm-like output with bytecode * extended: simple interpretation of previous sequence of instructions * extended-bytes: same as above, but with "bytes" bytecode ouptut * header: show header/metadata information only This is reflected in the `--format` (`-F`) options on `pydisasm`. Option `--show-source` (`-S`) gives add the source text line (or part of it) before assembly instructions that implement the line. Released Python magic numbers have been updated as of this release (up to Python 3.12.2, including PyPy magic numbers. Some support for the [GraalVM](https://www.graalvm.org/python/) implementation of Python started. Many bugs fixed. A lot of Linting and coding style modernization. typing.NameTuple used for Python versions that support this. Additional fields "start_offset" and "tos_str" added to instruction. Elliot Tarbet (2elli) largely provided support for Python 3.11 and 3.12 bytecode @ text @# $NetBSD: Makefile,v 1.42 2023/01/16 09:26:23 adam Exp $ DISTNAME= xdis-6.1.0 PKGNAME= ${PYPKGPREFIX}-${DISTNAME} CATEGORIES= devel python MASTER_SITES= ${MASTER_SITE_PYPI:=x/xdis/} MAINTAINER= pkgsrc-users@@NetBSD.org HOMEPAGE= https://github.com/rocky/python-xdis COMMENT= Python cross-version byte-code disassembler and marshal routines LICENSE= gnu-gpl-v2 TOOL_DEPENDS+= ${PYPKGPREFIX}-setuptools>=61.2:../../devel/py-setuptools TOOL_DEPENDS+= ${PYPKGPREFIX}-wheel-[0-9]*:../../devel/py-wheel DEPENDS+= ${PYPKGPREFIX}-click-[0-9]*:../../devel/py-click DEPENDS+= ${PYPKGPREFIX}-pygments-[0-9]*:../../textproc/py-pygments DEPENDS+= ${PYPKGPREFIX}-six>=1.10.0:../../lang/py-six DEPENDS+= ${PYPKGPREFIX}-term-background>=1.0.1:../../comms/py-term-background #TEST_DEPENDS+= ${PYPKGPREFIX}-test-runner-[0-9]*:../../devel/py-test-runner USE_LANGUAGES= # none PYTHON_VERSIONS_INCOMPATIBLE= 27 post-install: cd ${DESTDIR}${PREFIX}/bin && \ ${MV} pydisasm pydisasm-${PYVERSSUFFIX} || ${TRUE} .include "../../lang/python/wheel.mk" .include "../../mk/bsd.pkg.mk" @ 1.42 log @py-xdis: updated to 6.0.5 6.0.5 2022-12-22 ================= * Detect versions pypy3.8.15, pypy-3.9.15 * Dectect Python 3.{7,8,9}.14 3.10.{5,6,7} * correct 3.10+ pydisasm -F xasm label * Revise marshal error handling * Improve PyPy 3.7 `CALL_FUNCTION` arg interpretation * Fix 1.5-2.x bugs in line number encoding * Fix showing `MAKE_FUNCTION` operand * Miscellaneous lint, black, and isort changes @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.41 2022/05/22 19:05:00 adam Exp $ d3 1 a3 1 DISTNAME= xdis-6.0.5 d13 2 d16 1 d18 2 a19 1 TEST_DEPENDS+= ${PYPKGPREFIX}-test-runner-[0-9]*:../../devel/py-test-runner a24 2 USE_PKG_RESOURCES= yes d29 1 a29 1 .include "../../lang/python/egg.mk" @ 1.41 log @py-xdis: updated to 6.0.4 6.0.4 2022-05-19 HF+LB-1 ======================== * Detect 3.7.[7-13], 3.9.[8-13], 3.10.[1-4], PyPy 2.7.12, 3.[8-9]pypy * Correct line-number detection on Python 1.0-1.4 * Handle SET_LINENO in older pythons * Warn about wrong names in after RESERVE_FAST in older Pythons * Some PyPy x-3.9.7 tolerance * Add Pypy 3.8 support * Better PyPy 3.6 formatting * Correct relative jump target calculation in 3.10 @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.40 2022/01/05 15:41:09 wiz Exp $ d3 1 a3 1 DISTNAME= xdis-6.0.4 @ 1.40 log @python: egg.mk: add USE_PKG_RESOURCES flag This flag should be set for packages that import pkg_resources and thus need setuptools after the build step. Set this flag for packages that need it and bump PKGREVISION. @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.39 2022/01/04 20:53:48 wiz Exp $ d3 1 a3 1 DISTNAME= xdis-6.0.3 a4 1 PKGREVISION= 2 @ 1.39 log @*: bump PKGREVISION for egg.mk users They now have a tool dependency on py-setuptools instead of a DEPENDS @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.38 2021/12/17 00:15:47 wiz Exp $ d5 1 a5 1 PKGREVISION= 1 d22 2 @ 1.38 log @py-xdis: does not build with python 2.7, mark it so Also mark packages using it that way. @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.37 2021/11/10 16:09:53 adam Exp $ d5 1 @ 1.37 log @py-xdis: updated to 6.0.3 6.0.3 * xasm format fixes * more Python version tuple compare conversions * add `version_str_to_tuple()` to convert the other way. This is useful in xasm, for example. @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.36 2021/10/31 08:40:03 adam Exp $ d19 2 @ 1.36 log @py-xdis: updated to 6.0.2 6.0.2 2021-10-29 ================= * Remove str2float, sysinfo2float and magic_int2float. With Python 3.10 this is no longer tenable * Reduce PYTHON_VERSION usage in xdis. * Allow optional delimeter and start length in `version_tuple_to_str()` * fix logic bug in setting MAGIC * Add a little Python 3.8.5 Graal (Java VM) knowledge 6.0.1 2021-10-22 ================= * Add PyPy 3.8 opcodes and disassembly * Accept Python 3.8.12 * Fix some small lingering bugs introduced converting Python version number floats to tuples 6.0.0 2021-10-15 ================= Reworked for Python 3.10. We had been internally using floating point numbers for version testing. Clearl this doesn't work to distinguish 3.1 from 3.10. (This was a flaw known about for a while and we'd been avoiding). * Add 3.10 opcodes. * Add 3.9 and 3.10 testing. * Some tolerance for running from 3.11 * Update magic numbers * Expanding testing to include pyston and PyPy 3.7 * Improve distribution packaging, e.g. Python 3 wheels should no longer be attmpted on Python 2.x @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.35 2021/09/28 16:17:23 adam Exp $ d3 1 a3 1 DISTNAME= xdis-6.0.2 @ 1.35 log @py-xdis: updated to 5.0.13 5.0.13 2021-09-24 ================= Added knowledge of Python versions 3.6.15 and 3.7.12. However the main motivation was to impove packaging to handle administration of the 3 different branches or dialects of Python 2.4-2.7, 3.1-3.2, 3.3-3.5, and 3.6+ Restrict wheel packaging for Python 3 only. Use the wheel for only the 3.x and newer version of Python. Use eggs for 2.x versions (and others as well). @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.34 2021/09/12 09:58:03 adam Exp $ d3 1 a3 1 DISTNAME= xdis-5.0.13 @ 1.34 log @py-xdis: updated to 5.0.12 5.0.12 2021-09-11 ================= * Add Python version 3.9.7 * Document unmarshal beter * Correct stack information for IMPORT_NAME * Fix bug in code type handling where bytes were showing up as strings * More type annotations in master branch. Create more older variations without annotations @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.33 2021/07/07 10:11:47 adam Exp $ d3 1 a3 1 DISTNAME= xdis-5.0.12 @ 1.33 log @py-xdis: updated to 5.0.11 5.0.11: Add Python versions 3.9.6, 3.7.11, 3.8.11, and 3.6.14 Format Python various files using black. (Not completely done yet though) @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.32 2021/06/23 20:11:31 adam Exp $ d3 1 a3 1 DISTNAME= xdis-5.0.11 @ 1.32 log @py-xdis: updated to 5.0.10 5.0.10: Fix incorrect variable name in marshaller dump Add Python 3.8.10 as a 3.8.x release xdis/magics.py: Add 3.9.5 @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.31 2021/04/22 16:07:43 adam Exp $ d3 1 a3 1 DISTNAME= xdis-5.0.10 @ 1.31 log @py-xdis: updated to 5.0.9 5.0.9: Improve 3.9 IS_OP and CONTAINS_OP operand formatting Correct disassembly of 3.9 bytecode from other bytecode Accept 3.9.3 and 3.9.4 as a valid 3.9 version Accept 3.8.9 as a valid 3.8 version @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.30 2021/03/14 08:25:02 adam Exp $ d3 1 a3 1 DISTNAME= xdis-5.0.9 @ 1.30 log @py-xdis: updated to 5.0.8 5.0.8: Allow an alternate opmap - adds the capability to disassemble python bytecode that has been frozen with a custom opcode mapping. This is particularly useful for disassembling malware that uses custom opcode mappings in an attempt to hinder disassembly with standard tools. The updates in this pull request are used by pydecipher, a tool to unfreeze and deob fuscate frozen python code. Add Python versions 3.8.8 and 3.9.2 @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.29 2021/01/11 07:17:06 adam Exp $ d3 1 a3 1 DISTNAME= xdis-5.0.8 @ 1.29 log @py-xdis: updated to 5.0.7 5.0.7: Add Python 3.8.7 5.0.6: Add Python 3.9.1 @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.28 2020/10/27 22:33:37 adam Exp $ d3 1 a3 1 DISTNAME= xdis-5.0.7 @ 1.28 log @py-xdis: updated to 5.0.5 5.0.5: Add support for Python2.7 on Ubuntu 20.04 Bump versions for Python 3.8.6 and 3.5.10 Release instructions moved to wiki VERSION -> __version__ because Python prefers it that way @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.27 2020/09/10 09:25:02 adam Exp $ d3 1 a3 1 DISTNAME= xdis-5.0.5 @ 1.27 log @py-xdis: updated to 5.0.4 5.0.4: Add python versions 3.6.12, 3.7.9 extended arg disassembly handling for {LOAD,STORE}_ATTR 5.0.3: Add versions 3.8.5, 3.7.8, and 3.6.11 Clarify changes to 3.8 ROT_FOUR Update 3.9 magics and opcodes 5.0.2: Add Python 3.8.4 as a 3.8 release pydisasm.py Python 3.3 tolerance Make pydoc's version reporting show xdis's version 5.0.1: Two small improvements that are usefil in the forthcoming trepan3k release: interpret RAISE_VARARGS's argc parameter. Some other formatting was extended too check_object_path() is more leanient in the path name (it doesn't have to end in .py anymore), but it is more stringent about what constitutes Python source (it compiles the text to determine validity) In the above is_python_source() and is_bytecode_extension() are used. They are also exported. 5.0.0: Disassembly format and options have simplified and improved. @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.26 2020/06/20 16:21:38 adam Exp $ d3 1 a3 1 DISTNAME= xdis-5.0.4 @ 1.26 log @py-xdis: updated to 4.7.0 4.7.0: Routines for extracting line and offset information from code objects was added. @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.25 2020/06/12 06:26:47 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.7.0 @ 1.25 log @py-xdis: updated to 4.6.1 4.6.1: The main purpose of this release is to support x-python better. Fix a bad bug in handling byte constants in 3.x. How could this go so long fixed? More custom formatting across more opcodes * CALL_FUNCTION, CALL_FUNCTION_KW, CALL_FUNCTION_VAR, etc * MAKE_FUNCTION * LOAD_CONST in some cases Go over magics numbers, yet again Update See also links @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.24 2020/05/23 08:41:11 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.6.1 @ 1.24 log @py-xdis: updated to 4.6.0 4.6.0: 3.8.3 added as a valid 3.8 release command program pydisasm disassembles more Python source files now Add better argument formatting on CALL_FUNCTION and MAKE_FUNCTION bytecode.py now has distb opcode modules now have variable python_implementation which is either "CPython" or "PyPY" Reformat a number of files using blacken, and lint using flymake Update __init__.py exports based on what is used in projects uncompyle6, decompyle3, trepan3k, xasm and x-python Remove duplicate findlinestarts() code. Remove testing on the Python version and simplify this where possible. get_opcode_module allows either a float and string datatype for the version, and coverts the bytecode datatype when needed Fix a bugs in marshal and unmarshal @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.23 2020/05/16 14:07:20 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.6.0 @ 1.23 log @pytest from versioned deps. @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.22 2020/04/28 11:01:17 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.5.1 @ 1.22 log @py-xdis: updated to 4.5.1 4.5.1: Stack-effect redux Fix bug in marshal for 3.8+ (include posonlyargcount) Go over stack effects from 2.5 to 3.4 using and idea from Maynard Expand stack-effect testing @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.21 2020/04/22 20:44:34 adam Exp $ a14 1 TEST_DEPENDS+= ${PYPKGPREFIX}-test-[0-9]*:../../devel/py-test @ 1.21 log @py-xdis: updated to 4.4.0 4.4.0: Incompatibility: load_module() and load_module_from_file_object() now return a couple more parameters: is_pypy, and the sip_hash value when that is available. The timestamp and file_size returned on these functions is now None when they aren't available. Previously timestamp had been 0. --asm option fixes Show sip hash in 3.7+ when that is used Handle PEP 552 bytecode-file variations more properly Detect more intermediate Python versions in load_code_from_file_object() 3.8+ posonlyargcount in assembly... rename Kw-only field to Keyword-only Add 3.5 canonic bytecode version Marshal dumps() convert from byte() to str() in dumps() when needed in 3.x to_native() convert to bytes from string when needed in 3.x. clean up loading code by using float version values rather than magic values @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.20 2020/04/17 05:47:33 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.4.0 @ 1.20 log @py-xdis: updated to 4.3.2 4.3.2: Deleted release 4.3.0 and 4.3.1 had a bugs in detected by decompilers and in handling some 3.8 bytecode. @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.19 2020/04/16 18:32:32 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.3.2 @ 1.19 log @py-xdis: updated to 4.3.1 4.3.1: A portable version of types.CodeType was rewritten, to make it easier to use and catch more errors more complete in tracking Python types.CodeType changes simpler in implementation by using type inheretence more general Previously getting bytecode read from a bytecode file or from a code object requiring knowing a lot about the Python version of the code type and of the currently running interpreter. That is gone now. Use codeType2Portable() to turn a native types.CodeType or a structure read in from a bytecode file into a portable code type. The portable code type allows fields to be mutated, and is more flexible in the kinds of datatypes it allows. For example lists of thing like co_consts, or varnames can be Python lists as well as tuples. The line number table is stored as a dictionary mapping of address to bytecode offset rather than as a compressed structure. Bytecode can either be a string (which is advantageous if you are running Python before 3.x) or a sequence of bytes which is the datatype of a code object for 3.x. However when you need a type.CodeType that can be can be eval()'d by the Python interpreter you are running, use the to_native() method on the portable code type returned. It will compress and encode the line number table, and turn lists into tuples and convert other datatypes to the right type as needed. If you have a complete types.Codetype structure for a particular Python version whether, it is the one the current Python interpreter is using or not, use the to_portable() function and it will figure out based on the version parameter supplied (or use the current Python interpreter version if none supplieed), which particlar portable code type is the right one. If on the other hand, you have a number of code-type fields which may be incomplete, but still want to work with something that has code-type characteristics while not worring about which fields are required an their exact proper datatypes, use the CodeTypeUnion structure. Internally, we use OO inheritence to reduce the amount of duplicate code. The load_code_internal() function from unmarshal.py is now a lot shorter and cleaner as a result of this reorganization. New Portable Code Methods, Modules and Classes Python 3.8-ish replace() method has been added to the portable code types Portable code type classes Code13, Code15 have been added to more precisely distinguish Python 1.3 and 1.5 code types. The other portable code classes are Code2, Code3, and Code38. the to_native() conversts a portable code type into a native code type the decode_lineno_tab() method on portable code types from Python 1.5 on decompresses the Python encode line number table into a dictionary mapping offset to line number. Incompatibility The module xdis.code has been remamed to xdis.codetype and with that the function iscode() moved as well. In previous versions to use iscode() you might import it from xdis.code; now simply import it from xdis. In general function that had been imported from a module under xdis can now be imported simply from xdis. The classes Compat3Code and function code2compat() and code3compat() have been removed. Compat2Code is still around for dropbox 2.5, but that is deprecated and will be removed when I can figure out how to remove it from dropbox 2.5. Other Changes CI testing for older testing has been fixed now that 2.7 is even more deprecated. Note Deleted release 4.3.0 had a bug in handling some 3.8 bytecode. @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.18 2020/03/31 16:26:13 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.3.1 @ 1.18 log @py-xdis: updated to 4.2.4 4.2.4: Add Instruction instance methods: #Instruction.is_jump() and #Instruction.jumps_forward() @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.17 2020/03/17 10:28:07 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.2.4 @ 1.17 log @py-xdis: updated to 4.2.3 4.2.3: Add Python versions: 3.7.7, 3.8.2, and 3.9.0alpha1, Create a set for "STORE" instructions facilitate code type freezing Warn about cross-decompilation problems for byte types @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.16 2019/12/31 10:16:56 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.2.3 @ 1.16 log @py-xdis: updated to 4.2.2 4.2.2: Add Python versions: 3.6.10, 3.7.6. 3.8.1, Update 3.9-dev to 3.9.0alpha2 Add interpolation of FUNCTION_CALL_{KW,EX} argument for 3.7-3.9 Better output of complex type values 4.2.1: Correct and clean up compiler flags. Add 3.5+ ITERABLE_COROUTINE and 3.6+ ASYNC_GENERATOR. Clean up PYPY 3.6 flags and opcodes Many thanks again to Arman Rigo. Split PYPY specfic compiler-specific flags into its own thing. @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.15 2019/12/11 13:18:25 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.2.2 @ 1.15 log @py-xdis: updated to 4.2.0 4.2.0: Add preliminary 3.9(dev) support Handle 3.8-3.9 bytecode from 3.7ish @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.14 2019/11/20 09:29:21 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.2.0 @ 1.14 log @py-xdis: updated to 4.1.3 4.1.3: Add magics for 3.5.8 and 3.5.9 Python 3.0 tolerance Fix for unmarshaling Python 3.8 str from 3.2 Pypy 3.3, 3.5 3.6 and 3.6.9 magic numbers and support improve distribution wheels, and eggs @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.13 2019/10/31 08:22:00 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.1.3 @ 1.13 log @py-xdis: updated to 4.1.2 4.1.2 pre Halloween redux: Python 3.8.0 magic changed More Pypy 3.6 tolerance Fixed DeprecationWarning 4.1.1 pre-Halloween: Fix unmarshaling 3.4+ object_ref bugs. A big thanks to Armin Rigo of the PyPy team. Add Pypy 3.6+ disassembly, e.g. pypy3.6-7.1.0 and pypy3.6-7.1.1 Add Python 3.7.5, 2.7.16, 2.7.17rc1, and 2.7.15candidate1 as a valid releases convert unmarshal if .. elif code to a dictionary lookup with function entries Handle newer Python importlib @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.12 2019/10/15 16:59:35 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.1.2 d16 1 @ 1.12 log @py-xdis: updated to 4.1.0 4.1.0: Add early bytecodes: 1.0, 1.1, 1.2, and 1.6. Going off of pycdc bytecode since this is the only bytecode for these versions I know of Fix bug in Python 3.x decompiling 2.x that contains strings with non-ascii characters More generally, better handling of non-ascii Python 2 strings in both input and output in Python 3 pypy 3.6-7.1.0 tolerance @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.11 2019/10/07 05:38:38 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.1.0 @ 1.11 log @py-xdis: updated to 4.0.4 4.0.4: Add most-recent 3.8 magic number Remove some 3.8 invalid escape warnings @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.10 2019/08/03 08:55:10 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.0.4 @ 1.10 log @py-xdis: updated to 4.0.3 4.0.3: Support 3.8.0beta2; Code38 type with posonlyargcount field Add Python versions 3.4.10, 3.7.4 and 3.6.9 script no longer works to install pydisasm; entry_points still works Add pypy 3.6 opcode formatting for MAKE_FUNCTION and EXTENDED_ARG Add format_CALL_function and use it or pypy36 Start using "blacken" to reformat Python files @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.9 2019/06/13 07:52:45 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.0.3 @ 1.9 log @py-xdis: updated to 4.0.2 4.0.2: To unicode strings in Python 2.x Try to convert to ascii, but if that doesn't work, leave as unicode. BUILD_TUPLE_UNPACK_WITH_CALL is a vararg @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.8 2019/05/02 08:32:15 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.0.2 d21 1 a21 1 ${MV} pydisasm.py pydisasm-${PYVERSSUFFIX}.py || ${TRUE} @ 1.8 log @py-xdis: updated to 4.0.1 release-4.0.1 Add magics.IS_PYPY3 and correct is_pypy() disassemble PyPY3 versions correctly @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.7 2019/04/17 12:16:05 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.0.1 @ 1.7 log @py-xdis: updated to 4.0.0 release-4.0.0 Expand is_jump_target to True, 'loop', False. This is the reason for the version bump Remove deprecated opcodes_pypyDD.py files. Use opcode_DDpypy instead. Fix bug in setting jump offset in wordcode (3.6+) relative jumps. Note that this works now in Python 3.8 (dev) Add 3.6{,.1}pypy version Dry opcodes 3.6 - 3.8 @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.6 2019/04/01 10:24:15 adam Exp $ d3 1 a3 1 DISTNAME= xdis-4.0.0 @ 1.6 log @py-xdis: updated to 3.9.1 3.9.1: * xdis/magics.py, xdis/version.py: Go over list of available Python versions * xdis/magics.py, xdis/op_imports.py: 3.8.0alpha3 tolerance @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.5 2019/03/26 20:57:37 adam Exp $ d3 1 a3 1 DISTNAME= xdis-3.9.1 @ 1.5 log @py-xdis: updated to 3.9.0 3.9.0: Correct instruction field inst_size in instructions that were build from EXTENDED_OP instructions. Add has_extended_arg field in instruction. @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.4 2019/03/10 13:52:36 adam Exp $ d3 1 a3 1 DISTNAME= xdis-3.9.0 @ 1.4 log @py-xdis: updated to 3.8.10 3.8.10: - 3.8 opcode support - Add Python 2.7.16 @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.3 2019/01/04 22:13:11 adam Exp $ d3 1 a3 1 DISTNAME= xdis-3.8.10 @ 1.3 log @py-xdis: updated to 3.8.9 3.8.9: - Add magic for 3.6.8, 3.7.2 - Dropbox-hacked bytecode fixes, and some typos - Go over stack effects for vararg ops - Fix CI for pypy - Work around wheel munging @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.2 2018/10/23 08:05:39 adam Exp $ d3 1 a3 1 DISTNAME= xdis-3.8.9 @ 1.2 log @py-xdis: updated to 3.8.8 3.8.8: * Add for 3.6.7 and 3.7.1 magic. * pytest/test_std.py: Dropped a test * pytest/test_std.py, xdis/op_imports.py, xdis/std.py: make_std_api accepts floating-point version number @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.1 2018/09/20 13:45:11 adam Exp $ d3 1 a3 1 DISTNAME= xdis-3.8.8 d20 2 a21 1 cd ${DESTDIR}${PREFIX}/bin && ${MV} pydisasm pydisasm-${PYVERSSUFFIX} || ${TRUE} @ 1.1 log @py-xdis: added version 3.8.7 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. Also, if you need to modfiy 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. @ text @d1 1 a1 1 # $NetBSD$ d3 1 a3 1 DISTNAME= xdis-3.8.7 @