Skip to main content

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:

$ 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):

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:

$ 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:

$ 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:

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, as per the 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.

Release files for int3 0.0.2

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

Source distribution (sdist)

Source distribution for int3 0.0.2
File Size Uploaded
int3-0.0.2.tar.gz 34.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for int3 0.0.2
File Interpreter ABI Platform
int3-0.0.2-cp313-cp313-manylinux_2_38_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.38+ x86-64 Details

Total release size: 70.4 MB

Release files / int3-0.0.2.tar.gz

Download URL int3-0.0.2.tar.gz
Size 34.9 MB
Tags Source
SHA-256 checksum
How to use checksums
12cff32060fb4d3b20e3ace28f68a37f235031e87abf25f38f85a1fe5dc291ef
BLAKE2b-256 checksum
How to use checksums
52507025cf9ae43a466fc4aa4b05faa6abadba62eac446c797e102a352cd45ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.15

Release files / int3-0.0.2-cp313-cp313-manylinux_2_38_x86_64.whl

Download URL int3-0.0.2-cp313-cp313-manylinux_2_38_x86_64.whl
Size 35.5 MB
Tags CPython 3.13 Linux glibc 2.38+ x86-64
SHA-256 checksum
How to use checksums
c21054a95360c5e142453ab80c5ce59e4260baddb206c1613bb312c470beeb07
BLAKE2b-256 checksum
How to use checksums
2269d2ac2c31612fc91220d2d77c980505d382c136ff274fe12391b283c60a8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.15

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 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