int3


Nameint3 JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryCompiler for position-independent assembly programs
upload_time2025-09-10 08:37:43
maintainerNone
docs_urlNone
authorNone
requires_python>=3.13
licenseNone
keywords assembly llvm compiler
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # int3

## Synopsis

`int3` is a Python toolkit for writing low-level, position-independent code featuring the following...

A high-level command-line interface for common assembly tasks:

```sh
$ echo -n "int3" | int3 assemble -a x86_64 | int3 format
b"\xcc"
```

A Python interface for writing your own position-independent programs with automatic bad byte avoidance ([`examples/linux/hello_world.py`](examples/linux/hello_world.py)):

```python
import sys

from int3 import Compiler

cc = Compiler.from_str("linux/x86_64", bad_bytes=b"\n\r")

with cc.def_func.main():
    num_written = cc.sys_write(fd=1, buf=b"Hello, world\n")
    cc.sys_exit(num_written)

sys.stdout.buffer.write(cc.compile())
```

Support for disassembling them:

```sh
$ python3 examples/linux/hello_world.py | python3 -m int3 disassemble | tail -10
0x0078: inc edx
0x007a: inc edx
0x007c: inc edx
0x007e: inc edx
0x0080: mov rax, rdi
0x0083: syscall
0x0085: mov rdi, rax
0x0088: mov eax, 0x3c
0x008d: syscall
0x008f: ret
```

And executing them:

```sh
$ python3 examples/linux/hello_world.py | python3 -m int3 execute ; echo $?
Hello, world
13
```

## Installation

int3 is tested on the latest major version of CPython. You can get the latest release from PyPI with:

```sh
pip install int3
```

## Features

* Write position-independent assembly code in a higher-level Python interface
* Builtin support for cross-compiling to various architectures
* Mutate generated machine code to remove bad bytes
* Command-line interface for common formatting and exploratory reversing tasks

## License & Usage

`int3` is intended for educational use. `int3`'s unique code is released under the [GNU LGPLv3](https://choosealicense.com/licenses/lgpl-3.0), as per the [`LICENSE.txt`](LICENSE.txt) file in the root of this repository. Code belonging to other open source projects is licensed under the respective licenses of those projects.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "int3",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.13",
    "maintainer_email": "Brian Welch <12776611+welchbj@users.noreply.github.com>",
    "keywords": "assembly, llvm, compiler",
    "author": null,
    "author_email": "Brian Welch <12776611+welchbj@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/52/50/7025cf9ae43a466fc4aa4b05faa6abadba62eac446c797e102a352cd45ab/int3-0.0.2.tar.gz",
    "platform": null,
    "description": "# int3\n\n## Synopsis\n\n`int3` is a Python toolkit for writing low-level, position-independent code featuring the following...\n\nA high-level command-line interface for common assembly tasks:\n\n```sh\n$ echo -n \"int3\" | int3 assemble -a x86_64 | int3 format\nb\"\\xcc\"\n```\n\nA Python interface for writing your own position-independent programs with automatic bad byte avoidance ([`examples/linux/hello_world.py`](examples/linux/hello_world.py)):\n\n```python\nimport sys\n\nfrom int3 import Compiler\n\ncc = Compiler.from_str(\"linux/x86_64\", bad_bytes=b\"\\n\\r\")\n\nwith cc.def_func.main():\n    num_written = cc.sys_write(fd=1, buf=b\"Hello, world\\n\")\n    cc.sys_exit(num_written)\n\nsys.stdout.buffer.write(cc.compile())\n```\n\nSupport for disassembling them:\n\n```sh\n$ python3 examples/linux/hello_world.py | python3 -m int3 disassemble | tail -10\n0x0078: inc edx\n0x007a: inc edx\n0x007c: inc edx\n0x007e: inc edx\n0x0080: mov rax, rdi\n0x0083: syscall\n0x0085: mov rdi, rax\n0x0088: mov eax, 0x3c\n0x008d: syscall\n0x008f: ret\n```\n\nAnd executing them:\n\n```sh\n$ python3 examples/linux/hello_world.py | python3 -m int3 execute ; echo $?\nHello, world\n13\n```\n\n## Installation\n\nint3 is tested on the latest major version of CPython. You can get the latest release from PyPI with:\n\n```sh\npip install int3\n```\n\n## Features\n\n* Write position-independent assembly code in a higher-level Python interface\n* Builtin support for cross-compiling to various architectures\n* Mutate generated machine code to remove bad bytes\n* Command-line interface for common formatting and exploratory reversing tasks\n\n## License & Usage\n\n`int3` is intended for educational use. `int3`'s unique code is released under the [GNU LGPLv3](https://choosealicense.com/licenses/lgpl-3.0), as per the [`LICENSE.txt`](LICENSE.txt) file in the root of this repository. Code belonging to other open source projects is licensed under the respective licenses of those projects.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Compiler for position-independent assembly programs",
    "version": "0.0.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/welchbj/int3/issues",
        "Documentation": "https://int3.readthedocs.io",
        "Homepage": "https://github.com/welchbj/int3",
        "Repository": "https://github.com/welchbj/int3"
    },
    "split_keywords": [
        "assembly",
        " llvm",
        " compiler"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2269d2ac2c31612fc91220d2d77c980505d382c136ff274fe12391b283c60a8b",
                "md5": "45c0705e623ab00426d6cdc4281cdde7",
                "sha256": "c21054a95360c5e142453ab80c5ce59e4260baddb206c1613bb312c470beeb07"
            },
            "downloads": -1,
            "filename": "int3-0.0.2-cp313-cp313-manylinux_2_38_x86_64.whl",
            "has_sig": false,
            "md5_digest": "45c0705e623ab00426d6cdc4281cdde7",
            "packagetype": "bdist_wheel",
            "python_version": "cp313",
            "requires_python": ">=3.13",
            "size": 35498262,
            "upload_time": "2025-09-10T08:37:59",
            "upload_time_iso_8601": "2025-09-10T08:37:59.982466Z",
            "url": "https://files.pythonhosted.org/packages/22/69/d2ac2c31612fc91220d2d77c980505d382c136ff274fe12391b283c60a8b/int3-0.0.2-cp313-cp313-manylinux_2_38_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "52507025cf9ae43a466fc4aa4b05faa6abadba62eac446c797e102a352cd45ab",
                "md5": "67ca94bba50f33f37a6e109d38bdb4cf",
                "sha256": "12cff32060fb4d3b20e3ace28f68a37f235031e87abf25f38f85a1fe5dc291ef"
            },
            "downloads": -1,
            "filename": "int3-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "67ca94bba50f33f37a6e109d38bdb4cf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.13",
            "size": 34856728,
            "upload_time": "2025-09-10T08:37:43",
            "upload_time_iso_8601": "2025-09-10T08:37:43.718322Z",
            "url": "https://files.pythonhosted.org/packages/52/50/7025cf9ae43a466fc4aa4b05faa6abadba62eac446c797e102a352cd45ab/int3-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-10 08:37:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "welchbj",
    "github_project": "int3",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "int3"
}
        
Elapsed time: 3.99665s