{ "info": { "author": "Rocky Bernstein", "author_email": "rb@dustyfeet.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Debuggers", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "|Pypi Installs| |Latest Version| |Supported Python Versions|\n\nxasm\n====\n\n*NOTE: this is in beta*\n\nA Cross-Python bytecode Assembler\n\n\nIntroduction\n------------\n\nThe Python `xasm` module has routines for assembly, and has a command to\nassemble bytecode for several different versions of Python.\n\nHere are some potential uses:\n\n* Make small patches to existing Python bytecode when you don\u2019t have source\n* Craft custom and efficient bytecode\n* Write an instruction-level optimizing compiler\n* Experiment with and learn about Python bytecode\n* Foil uncompyle6_ so that it can\u2019t disassemble bytecode (at least for now)\n\nThis will support bytecodes from Python version 1.0 to 3.8 or so.\n\nThe code requires Python 2.7 or later.\n\nAssembly files\n--------------\n\nMore detail will be filled in, but some principles:\n\n* Preferred extension for Python assembly is `.pyasm`\n* assembly is designed to work with the output of `pydisasm --asm`\n* Assembly file labels are at the beginning of the line\n and end in a colon, e.g. `END_IF`\n* instruction offsets in the assembly file are ignored and don't need\n to be entered\n* in those instructions that refer to offsets, if the if the\n operand is an int, exactly that value will be used for the operand. Otherwise\n we will look for labels and match up with that\n\n\nInstallation\n------------\n\nThe standard Python routine:\n\n::\n\n pip install -e .\n pip install -r requirements-dev.txt\n\nA GNU makefile is also provided so :code:`make install` (possibly as root or\nsudo) will do the steps above.\n\n\nTesting\n-------\n\n::\n\n make check\n\nA GNU makefile has been added to smooth over setting running the right\ncommand, and running tests from fastest to slowest.\n\nIf you have remake_ installed, you can see the list of all tasks\nincluding tests via :code:`remake --tasks`.\n\n\nExample Assembly File\n---------------------\n\nFor this Python source code:\n\n::\n\n def five():\n return 5\n\n print(five())\n\nHere is an assembly for the above:\n\n::\n\n # Python bytecode 3.6 (3379)\n\n # Method Name: five\n # Filename: /tmp/five.pl\n # Argument count: 0\n # Kw-only arguments: 0\n # Number of locals: 0\n # Stack size: 1\n # Flags: 0x00000043 (NOFREE | NEWLOCALS | OPTIMIZED)\n # First Line: 1\n # Constants:\n # 0: None\n # 1: 5\n 2:\n LOAD_CONST (5)\n RETURN_VALUE\n\n\n # Method Name: \n # Filename: /tmp/five.pl\n # Argument count: 0\n # Kw-only arguments: 0\n # Number of locals: 0\n # Stack size: 2\n # Flags: 0x00000040 (NOFREE)\n # First Line: 1\n # Constants:\n # 0: \n # 1: 'five'\n # 2: None\n # Names:\n # 0: five\n # 1: print\n 1:\n LOAD_CONST 0 ()\n LOAD_CONST ('five')\n MAKE_FUNCTION 0\n STORE_NAME (five)\n\n 3:\n LOAD_NAME (print)\n LOAD_NAME (five)\n CALL_FUNCTION 0\n CALL_FUNCTION 1\n POP_TOP\n LOAD_CONST (None)\n RETURN_VALUE\n\n\nThe above can be created automatically from Python source code using the `pydisasm`\ncommand from `xdis`:\n\n::\n\n pydisasm --asm /tmp/five.pyc\n\nIn the example above though, I have shortend and simplified the result.\n\n\nUsage\n-----\n\nTo create a python bytecode file from an assemble file, run:\n\n::\n\n pyc-xasm [OPTIONS] ASM_PATH\n\n\nFor usage help, type `pyc-xasm --help`.\n\n\nTo convert a python bytecode from one bytecode to another, run:\n\n::\n\n pyc-convert [OPTIONS] INPUT_PYC [OUTPUT_PYC]\n\n\nFor usage help, type `pyc-convert --help`.\n\n\nSee Also\n--------\n\n* https://github.com/rocky/python-xdis : Cross Python version disassemble\n* https://github.com/rocky/python-xasm/blob/master/HOW-TO-USE.rst : How to write an assembler file\n* https://rocky.github.io/pycon2018-light.co/ : Pycolumbia 2018 Lightning talk showing how to use the assembler\n\n\n.. _uncompyle6: https://github.com/rocky/python-uncompyle6\n.. |Latest Version| image:: https://badge.fury.io/py/xasm.svg\n\t\t :target: https://badge.fury.io/py/xasm\n.. |Pypi Installs| image:: https://pepy.tech/badge/xasm\n.. |Supported Python Versions| image:: https://img.shields.io/pypi/pyversions/xasm.svg\n.. _remake: http://bashdb.sf.net/remake\n\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rocky/python-xasm/", "keywords": "", "license": "GPL-2.0", "maintainer": "", "maintainer_email": "", "name": "xasm", "package_url": "https://pypi.org/project/xasm/", "platform": "", "project_url": "https://pypi.org/project/xasm/", "project_urls": { "Homepage": "https://github.com/rocky/python-xasm/" }, "release_url": "https://pypi.org/project/xasm/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Python cross-version byte-code assembler", "version": "1.0.0" }, "last_serial": 6000308, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6a916136f0b8f79617482dce23c8e5e4", "sha256": "861d31cfbcf9dccc0a8c9b6917016b2c5a48a0baf8d6387f91175ef061f343eb" }, "downloads": -1, "filename": "xasm-0.1.0-py2.7.egg", "has_sig": false, "md5_digest": "6a916136f0b8f79617482dce23c8e5e4", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 14023, "upload_time": "2017-07-15T04:09:43", "url": "https://files.pythonhosted.org/packages/ce/fd/dcfe19b1de1c8eb561c90f6aa01568bf8aee7ae665a475f78d2ba13edb9b/xasm-0.1.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "caa0825307e059ad56759441ae2fece6", "sha256": "14ec4c2a7bf7e360a922b9af1339b6244b0858e4b50bd049742b8a228f8dbf86" }, "downloads": -1, "filename": "xasm-0.1.0-py3.5.egg", "has_sig": false, "md5_digest": "caa0825307e059ad56759441ae2fece6", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 14269, "upload_time": "2017-07-15T04:09:44", "url": "https://files.pythonhosted.org/packages/b5/ec/c96b1f3186ed54607f05085a66498b0e48c8d22205d4f9bc3c5124c82256/xasm-0.1.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "dfb15bf3c91f0fbf5f687581af32f530", "sha256": "2e036826207cc7432ccd42b7aca210170f9ce54deb1c49c22d4cd4a652a782f7" }, "downloads": -1, "filename": "xasm-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "dfb15bf3c91f0fbf5f687581af32f530", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9195, "upload_time": "2017-07-15T04:09:41", "url": "https://files.pythonhosted.org/packages/12/a0/c132b5cb2aa1b8bf0a513cc0e73aefb77afada5e63981b6958e617025c6c/xasm-0.1.0-py3-none-any.whl" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "b2c8f5a14e0289955a632ce12b193696", "sha256": "f13ea65f681f1abd258d777a63b84d07426b6722196b4ea176bb21500906dddd" }, "downloads": -1, "filename": "xasm-1.0.0-py2.7.egg", "has_sig": false, "md5_digest": "b2c8f5a14e0289955a632ce12b193696", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 23770, "upload_time": "2019-10-19T16:26:13", "url": "https://files.pythonhosted.org/packages/a0/f6/823390588471db4c9deb00703311b674130d933b98caf1972a5f4ed113a4/xasm-1.0.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "9374c689722485a93ffdc3bf9b8788bc", "sha256": "de0a29965fd6a7bbed0d959cfaa4ab4f757328a07dac4d0517f04eb907ca8228" }, "downloads": -1, "filename": "xasm-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "9374c689722485a93ffdc3bf9b8788bc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 18893, "upload_time": "2019-10-19T16:25:20", "url": "https://files.pythonhosted.org/packages/a9/37/a96092286af127e09db09286561138080bc43bdab4f1de61ff38eced41d4/xasm-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac3775d973083ccecda3da84b61811ea", "sha256": "0b456030eabb6de11221a26d9500a718dc601ae53f05b5b98735f5e1dd367d23" }, "downloads": -1, "filename": "xasm-1.0.0-py3.4.egg", "has_sig": false, "md5_digest": "ac3775d973083ccecda3da84b61811ea", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 24082, "upload_time": "2019-10-19T16:26:14", "url": "https://files.pythonhosted.org/packages/cd/f3/32de4143b33181c0ce6421b4b8124e398a1c7fd370a8751144dbd055b06e/xasm-1.0.0-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "06ee1466c5269a66648ccaf6e3dbd8aa", "sha256": "6544a49ceb106f621623cf73d969c9ef78f3c699023ca7c968b1591a14108ece" }, "downloads": -1, "filename": "xasm-1.0.0-py3.5.egg", "has_sig": false, "md5_digest": "06ee1466c5269a66648ccaf6e3dbd8aa", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 24008, "upload_time": "2019-10-19T16:26:16", "url": "https://files.pythonhosted.org/packages/f0/9a/5e89d756b857f0d424f32ba7a9a04d4ba2611cc8457803d55c0d2b51536c/xasm-1.0.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "8745eb67b16bae38c2acadf9a0bc0a5e", "sha256": "eea9ccd9a44cf111fd9ca9f13b57a6d39818353f09eac038bb7b8baf4f43bc7f" }, "downloads": -1, "filename": "xasm-1.0.0-py3.6.egg", "has_sig": false, "md5_digest": "8745eb67b16bae38c2acadf9a0bc0a5e", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 23586, "upload_time": "2019-10-19T16:26:18", "url": "https://files.pythonhosted.org/packages/0d/6c/da9d9557a5cb4df50125a70c3b6c63da38719cffab97ae65430494aa0052/xasm-1.0.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "a116f80bda9956c549ce220df55ee612", "sha256": "50b55fafa3e4cb2af95c9b71dd0d3f7e6547e79623b5746e39877b9943ed59e8" }, "downloads": -1, "filename": "xasm-1.0.0-py3.7.egg", "has_sig": false, "md5_digest": "a116f80bda9956c549ce220df55ee612", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 23609, "upload_time": "2019-10-19T16:26:19", "url": "https://files.pythonhosted.org/packages/a9/67/384aa6d7d458da4bc9f4c0fb33b0d951c27de087fdf792fba218bba3a1f0/xasm-1.0.0-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "f8f9e71e3c07ab787abdaa8c787ca9ce", "sha256": "27a1ca171b2bc9cfc3ea182a77db60cc1879eab1b2763dbafe2ca133bed4557e" }, "downloads": -1, "filename": "xasm-1.0.0-py3.8.egg", "has_sig": false, "md5_digest": "f8f9e71e3c07ab787abdaa8c787ca9ce", "packagetype": "bdist_egg", "python_version": "3.8", "requires_python": null, "size": 23642, "upload_time": "2019-10-19T16:26:21", "url": "https://files.pythonhosted.org/packages/0b/4f/0d3ed80235982e4d5cbc21d3b165584bb5384c846d3c4bd4e6934f534e00/xasm-1.0.0-py3.8.egg" }, { "comment_text": "", "digests": { "md5": "d5374f0b97b8549e469a899985aa2cd5", "sha256": "5ea729471baae0eb94c22f2681c3c0bc1c7b45309a1ae062e0ed6c6b54aaa9a5" }, "downloads": -1, "filename": "xasm-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d5374f0b97b8549e469a899985aa2cd5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18894, "upload_time": "2019-10-19T16:25:23", "url": "https://files.pythonhosted.org/packages/cb/76/47f941c70d515ebb32561ec6aface1db517541184bba38ba088f1da9363a/xasm-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5dc3a90e735361639325544298cf70b1", "sha256": "f27a6370e589efc75c15d43729d6e4c027934acc0bf8562d42da60782ef947be" }, "downloads": -1, "filename": "xasm-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5dc3a90e735361639325544298cf70b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41750, "upload_time": "2019-10-19T16:26:23", "url": "https://files.pythonhosted.org/packages/6a/34/cb6a790fd185ff544244bb586b8784652037a9bd25933df237ae8323bc9d/xasm-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b2c8f5a14e0289955a632ce12b193696", "sha256": "f13ea65f681f1abd258d777a63b84d07426b6722196b4ea176bb21500906dddd" }, "downloads": -1, "filename": "xasm-1.0.0-py2.7.egg", "has_sig": false, "md5_digest": "b2c8f5a14e0289955a632ce12b193696", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 23770, "upload_time": "2019-10-19T16:26:13", "url": "https://files.pythonhosted.org/packages/a0/f6/823390588471db4c9deb00703311b674130d933b98caf1972a5f4ed113a4/xasm-1.0.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "9374c689722485a93ffdc3bf9b8788bc", "sha256": "de0a29965fd6a7bbed0d959cfaa4ab4f757328a07dac4d0517f04eb907ca8228" }, "downloads": -1, "filename": "xasm-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "9374c689722485a93ffdc3bf9b8788bc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 18893, "upload_time": "2019-10-19T16:25:20", "url": "https://files.pythonhosted.org/packages/a9/37/a96092286af127e09db09286561138080bc43bdab4f1de61ff38eced41d4/xasm-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac3775d973083ccecda3da84b61811ea", "sha256": "0b456030eabb6de11221a26d9500a718dc601ae53f05b5b98735f5e1dd367d23" }, "downloads": -1, "filename": "xasm-1.0.0-py3.4.egg", "has_sig": false, "md5_digest": "ac3775d973083ccecda3da84b61811ea", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 24082, "upload_time": "2019-10-19T16:26:14", "url": "https://files.pythonhosted.org/packages/cd/f3/32de4143b33181c0ce6421b4b8124e398a1c7fd370a8751144dbd055b06e/xasm-1.0.0-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "06ee1466c5269a66648ccaf6e3dbd8aa", "sha256": "6544a49ceb106f621623cf73d969c9ef78f3c699023ca7c968b1591a14108ece" }, "downloads": -1, "filename": "xasm-1.0.0-py3.5.egg", "has_sig": false, "md5_digest": "06ee1466c5269a66648ccaf6e3dbd8aa", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 24008, "upload_time": "2019-10-19T16:26:16", "url": "https://files.pythonhosted.org/packages/f0/9a/5e89d756b857f0d424f32ba7a9a04d4ba2611cc8457803d55c0d2b51536c/xasm-1.0.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "8745eb67b16bae38c2acadf9a0bc0a5e", "sha256": "eea9ccd9a44cf111fd9ca9f13b57a6d39818353f09eac038bb7b8baf4f43bc7f" }, "downloads": -1, "filename": "xasm-1.0.0-py3.6.egg", "has_sig": false, "md5_digest": "8745eb67b16bae38c2acadf9a0bc0a5e", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 23586, "upload_time": "2019-10-19T16:26:18", "url": "https://files.pythonhosted.org/packages/0d/6c/da9d9557a5cb4df50125a70c3b6c63da38719cffab97ae65430494aa0052/xasm-1.0.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "a116f80bda9956c549ce220df55ee612", "sha256": "50b55fafa3e4cb2af95c9b71dd0d3f7e6547e79623b5746e39877b9943ed59e8" }, "downloads": -1, "filename": "xasm-1.0.0-py3.7.egg", "has_sig": false, "md5_digest": "a116f80bda9956c549ce220df55ee612", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 23609, "upload_time": "2019-10-19T16:26:19", "url": "https://files.pythonhosted.org/packages/a9/67/384aa6d7d458da4bc9f4c0fb33b0d951c27de087fdf792fba218bba3a1f0/xasm-1.0.0-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "f8f9e71e3c07ab787abdaa8c787ca9ce", "sha256": "27a1ca171b2bc9cfc3ea182a77db60cc1879eab1b2763dbafe2ca133bed4557e" }, "downloads": -1, "filename": "xasm-1.0.0-py3.8.egg", "has_sig": false, "md5_digest": "f8f9e71e3c07ab787abdaa8c787ca9ce", "packagetype": "bdist_egg", "python_version": "3.8", "requires_python": null, "size": 23642, "upload_time": "2019-10-19T16:26:21", "url": "https://files.pythonhosted.org/packages/0b/4f/0d3ed80235982e4d5cbc21d3b165584bb5384c846d3c4bd4e6934f534e00/xasm-1.0.0-py3.8.egg" }, { "comment_text": "", "digests": { "md5": "d5374f0b97b8549e469a899985aa2cd5", "sha256": "5ea729471baae0eb94c22f2681c3c0bc1c7b45309a1ae062e0ed6c6b54aaa9a5" }, "downloads": -1, "filename": "xasm-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d5374f0b97b8549e469a899985aa2cd5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18894, "upload_time": "2019-10-19T16:25:23", "url": "https://files.pythonhosted.org/packages/cb/76/47f941c70d515ebb32561ec6aface1db517541184bba38ba088f1da9363a/xasm-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5dc3a90e735361639325544298cf70b1", "sha256": "f27a6370e589efc75c15d43729d6e4c027934acc0bf8562d42da60782ef947be" }, "downloads": -1, "filename": "xasm-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5dc3a90e735361639325544298cf70b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41750, "upload_time": "2019-10-19T16:26:23", "url": "https://files.pythonhosted.org/packages/6a/34/cb6a790fd185ff544244bb586b8784652037a9bd25933df237ae8323bc9d/xasm-1.0.0.tar.gz" } ] }