Skip to main content

No project description provided

Project description

crackers: A Tool for Synthesizing Code-Reuse Attacks from p-code Programs

Build docs.rs

This package contains the Python bindings for crackers, a tool for synthesizing code-reuse attacks (e.g., ROP) built around the Z3 SMT Solver and Ghidra's SLEIGH code translator.

For more details, please refer to the GitHub project.

Usage

PyPI

The easiest way to use crackers is through the PyPI package. For every release, we provide wheels for [MacOS, Windows, Linux] x [3.10, 3.11, 3.12, 3.13].

A simple usage looks like the following:

import logging

from crackers.crackers import DecisionResult
from crackers.jingle import ModeledBlock, State

logging.basicConfig(level=logging.INFO)

from z3 import BoolRef, BoolVal, simplify

from crackers.config import (
    MetaConfig,
    LibraryConfig,
    SleighConfig,
    ReferenceProgramConfig,
    SynthesisConfig,
    ConstraintConfig,
    CrackersConfig,
)
from crackers.config.constraint import (
    RegisterValuation,
    RegisterStringValuation,
    MemoryValuation,
    PointerRange,
    CustomStateConstraint,
    CustomTransitionConstraint,
    PointerRangeRole,
)
from crackers.config.log_level import LogLevel
from crackers.config.synthesis import SynthesisStrategy


# Custom state constraint example
def my_constraint(s: State, _addr: int) -> BoolRef:
    rdi = s.read_register("RDI")
    rcx = s.read_register("RCX")
    return rdi == (rcx ^ 0x5A5A5A5A5A5A5A5A)


# Custom transition constraint example
def my_transition_constraint(block: ModeledBlock) -> BoolRef:
    # Dummy: always true
    return BoolVal(True)


meta = MetaConfig(log_level=LogLevel.INFO, seed=42)
library = LibraryConfig(
    max_gadget_length=8, path="libz.so.1", sample_size=None, base_address=None
)
sleigh = SleighConfig(ghidra_path="/Applications/ghidra")
reference_program = ReferenceProgramConfig(
    path="sample.o", max_instructions=8, base_address=library.base_address
)
synthesis = SynthesisConfig(
    strategy=SynthesisStrategy.SAT,
    max_candidates_per_slot=200,
    parallel=8,
    combine_instructions=True,
)

constraint = ConstraintConfig(
    precondition=[
        RegisterValuation(name="RDI", value=0xDEADBEEF),
        MemoryValuation(space="ram", address=0x1000, size=4, value=0x41),
        RegisterStringValuation(reg="RSI", value="/bin/sh"),
        CustomStateConstraint.from_callable(my_constraint),
    ],
    postcondition=[
        RegisterValuation(name="RBX", value=0x1337),
    ],
    pointer=[
        PointerRange(role=PointerRangeRole.READ, min=0x80_0000, max=0x80_8000),
        CustomTransitionConstraint.from_callable(my_transition_constraint),
    ],
)
config = CrackersConfig(
    meta=meta,
    library=library,
    sleigh=sleigh,
    specification=reference_program,
    synthesis=synthesis,
    constraint=constraint,
)
r = config.run()
match r:
    case DecisionResult.AssignmentFound(a):
        for g in a.gadgets():
            for i in g.instructions:
                print(i.disassembly)
            print()
        for name, bv in a.input_summary(True):
            print(f"{name} = {simplify(bv)}")

Research Paper

crackers was initially developed in support of our research paper, Synthesis of Code-Reuse Attacks from p-code Programs, presented at Usenix Security 2025.

If you found the paper or the implementation useful, you can cite it with the following BibTeX:

@inproceedings{denhoed2025synthesis,
  title={Synthesis of ${Code-Reuse}$ Attacks from p-code Programs},
  author={DenHoed, Mark and Melham, Tom},
  booktitle={34th USENIX Security Symposium (USENIX Security 25)},
  pages={395--411},
  year={2025}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crackers-0.6.1.tar.gz (79.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

crackers-0.6.1-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

crackers-0.6.1-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ ARM64

crackers-0.6.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

crackers-0.6.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ ARM64

crackers-0.6.1-cp313-cp313t-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.28+ x86-64

crackers-0.6.1-cp313-cp313t-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.28+ ARM64

crackers-0.6.1-cp313-cp313-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

crackers-0.6.1-cp313-cp313-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

crackers-0.6.1-cp313-cp313-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

crackers-0.6.1-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

crackers-0.6.1-cp312-cp312-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

crackers-0.6.1-cp312-cp312-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

crackers-0.6.1-cp312-cp312-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

crackers-0.6.1-cp311-cp311-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.11Windows x86-64

crackers-0.6.1-cp311-cp311-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

crackers-0.6.1-cp311-cp311-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

crackers-0.6.1-cp311-cp311-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

crackers-0.6.1-cp310-cp310-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

crackers-0.6.1-cp310-cp310-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

File details

Details for the file crackers-0.6.1.tar.gz.

File metadata

  • Download URL: crackers-0.6.1.tar.gz
  • Upload date:
  • Size: 79.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for crackers-0.6.1.tar.gz
Algorithm Hash digest
SHA256 4fa8a8ba1ae3e1ffc6fba680dc8ccc031f72cf9b9007d244bf5e2ea00d20d8ba
MD5 314ca559e9849e55f3c4709bad19fe60
BLAKE2b-256 8c2220c6817d8410f7d96fd030457022ed4ba9b11e708456e87310f9dd02eade

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 31dd53fd79e4431f9d27b327e7f1b82106571ff41f7dc5866b1e5ade4ad3946a
MD5 8eafef9cb755bea6ecb12af05e16d976
BLAKE2b-256 84c6253ae3fe7a46e1211c01373baab08ce0f1294f3453c4998db9d9977762f1

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cbb0ab53c9fae093cd187ed74558c761b1ea2d31d989470f0400dc55a6f134e6
MD5 68d46726f7eff5055e242004c34e5ea1
BLAKE2b-256 21168f65d23cd999b10eea25575c7995f678df50477eedf99c21021f4a794f36

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b1ec9dcff06b356587a9f277a71353ff8d22907b81d29b15f152a984bae55353
MD5 4c78efea20bb31e46b17645f336dc8e6
BLAKE2b-256 c9352588546a1e15ef4e004d4695cdd76b39837f07b1b7444e8401afabedbd2c

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 543c8b46213672d27cb170be376494aa7af91f7870c5da1449d76aced4635445
MD5 f9f4d8abd26bd1aeb2393e2c0fd18ef0
BLAKE2b-256 dcb8adcec8cb8f5943f0488190a26a4ed0fed5684ddb3833a608d643acf1d906

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp313-cp313t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp313-cp313t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 57e40e0cd263214974b846734a500c193c9d71adc6360ed5267b8bc5ff378b18
MD5 0741af7f22585aa2064fade2c49faf20
BLAKE2b-256 a00befa78ce5d92b2ad0e2c9794633acb697c0e63f8053f840231f014559aea9

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp313-cp313t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp313-cp313t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c839f52ad6e106c6364069dc89edc5c81f54bb98c7af51c27891bba6a45a2d6c
MD5 f78601e6aa1ace68c33aa587c27f408f
BLAKE2b-256 42e181c58bd6c9bc8a7e49bfd0867ee16e8df50bdfaf78c5d94a8d7ef8161a1f

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 86d504739b7ad858423d289d0fe545c4603deffb1aeeb3c6f810ab8341183a99
MD5 21d5358a7a0cbf29f59a43c0e0ceadef
BLAKE2b-256 9a280360d6e09c94bc1682d8cd87e765e6facb6f15db1faa97379b18ad99b6cb

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 54fed8ecf73e07540822e938c138b0ef4e03ecc9d6edf50334fed471b41806dd
MD5 fd0edd6f793f8b845988f28699600fab
BLAKE2b-256 dd710cd47deccc522935e53ae27e16378c1c7df5e995b34c3ad78f423e305d41

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a457cbac30026bc22be79802ac1453e51f119e69f231a7ae7acd5d433c5fc0ea
MD5 b247ba004a3570c0135a29cd8cad3162
BLAKE2b-256 e413d3d86211aa40a8a8ad3e8d2322d5c45e85e8f1835f75a5a2b03ea29e2813

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 151e9b3396955b5eee4dd92f7b19e3f06f679d3327f154250a43c3a64432d433
MD5 348d8d1ab0ad139f01d02f56d1e9b755
BLAKE2b-256 77c1f68b5cfd6c4e608f5326a63c9b4f3859d9408485b4629f8b37f4d2cb20c0

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 baa72e9f385eaa54f9a7f9e543b8d3f9e4d5db85f4e135c72a1bd422740f7ac7
MD5 a95eced8643bd9bf0fb0065f090fb4ff
BLAKE2b-256 e2b35d050638a9bae954a18c43999ccdb130720988a41c7a14fb75426d17046c

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f0d044fb2840bcacb89350b65ed30588a9ce16e9f7022256ad5f5aa58e81dd16
MD5 0e5ad607835dd9f580f018c44470ba99
BLAKE2b-256 4c2ea78ba2339bc3eb7629087ea55044ebc700ae679375c1cb3afc7c9e08de76

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8b3d2cd119f36410ab5288918d432b27172cc06d6e9efb9901a608a938ba9823
MD5 7b96c11232bab4eef2dd87737e8c03c8
BLAKE2b-256 318e51aa8c6af0480dc0f8f38cc2cca01303e8656ebc73e8251fbe496370e73d

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 341f48e60bff84a73d5bfdf99a659a572ef13bdf8ba58a482724c4068d9da6fb
MD5 ee48ad9154526c8b2da429a0c29c15df
BLAKE2b-256 3fbd9cc281f35e45b008e93d78e746b96ec85e531b79322431d634ffcf9c89f2

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 899b9f88868fd7dd983772ecc21e8b8d0828d6c207dbb7bc67bf6770b72db587
MD5 77546c35c948b8d750835a93f82faf72
BLAKE2b-256 fd5f0fb7ce41b5a46d8e2a30508e93068d9d2f9344f74f0eb200294a93d5430d

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 45d5bccffefa7f46e33dda5385a3e1f6b33dd2e5bf9ffc1ccb213f3d2c0d1ef4
MD5 097ecf626016d952a9424520e07691a6
BLAKE2b-256 6f9a017243e9a3ef178f9f3ab88d8969327916b20ddd9fb4b6c37d509af9104f

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 01333db005960897858bef0138b5f43f1328f3c6f5413da7a1965286661a6d2b
MD5 fe8e442eb4b73b91dc9d6c571cbbabd7
BLAKE2b-256 5640032e0361c87da46ce581b08ea8415edf6c216b98682ecbe879ac431f5f78

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 563eec6124f8544443e6a33d8b168dc0f213da1df309f34b186bd185bbf48652
MD5 819217ce77231b9258387de8685ea443
BLAKE2b-256 fce2df113ba6753d2a69ace321aca39098a70b6f00a874395d3ffce531d22791

See more details on using hashes here.

File details

Details for the file crackers-0.6.1-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for crackers-0.6.1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ef607c269e848f5781e4ee7bd80173c567238449152b16abcca643d847a8b454
MD5 e7d223c702a8927a874bddc6965bbf58
BLAKE2b-256 5045894bedf40eca83d1d66223d6fd7a9fcda926f2c7ca1ddfa9f01d2b60db08

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page