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.3.tar.gz (79.6 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.3-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

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

Uploaded PyPymanylinux: glibc 2.28+ ARM64

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

Uploaded PyPymanylinux: glibc 2.28+ x86-64

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

Uploaded PyPymanylinux: glibc 2.28+ ARM64

crackers-0.6.3-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.3-cp313-cp313t-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.28+ ARM64

crackers-0.6.3-cp313-cp313-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.13Windows x86-64

crackers-0.6.3-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.3-cp313-cp313-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

crackers-0.6.3-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.3-cp312-cp312-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

crackers-0.6.3-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.3-cp311-cp311-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

crackers-0.6.3-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.3-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.3.tar.gz.

File metadata

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

File hashes

Hashes for crackers-0.6.3.tar.gz
Algorithm Hash digest
SHA256 da103baded924ecf61ac1af2ef245deceb681a371df1fb1510a2cef78d8ce186
MD5 6bcc062e89f31c74a2f9e96274b55cd5
BLAKE2b-256 a53f7d077867ba0c945022c3353d3203c926702567fedc2a1339b87063382560

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0d2f5a26febb1a10537fc439bb82a5602b3ca74e3271304fb905c6e064d9e2fe
MD5 7cfda37d5a54a9ca430d3f5bd1bd3151
BLAKE2b-256 1d64a8bb96863f12b4a6adacbe66705789fdaa86e3b9cb4520dab3717ad775b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bfbeeef7d5921a91fa189cdbc866a6aa3e1c94d5cd392ceb5b94af60d442010a
MD5 8755c7c83282840b912646468b3b19a3
BLAKE2b-256 337a3903467678422e58d2035122a7a54531186a8fb4767a17464ca04cefe7b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ee9761bf77737ae278dc8dd615a804d74e05ed1edc65c48dae6b77cb19e86da0
MD5 5553e76d7de5aa337a97cc9d43e1d5ed
BLAKE2b-256 a0fde2506303d4a61c1f97f06d2e27be2146a1000cccdbbc337a3d89a73d02fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e223923920b803c83a35df75fc03b4d6046c2c98999130c7f7239c4f5fccccd1
MD5 7601e4f9f08b49fb195348e82ab05813
BLAKE2b-256 978073cefc7befcfdbb1463bd64c2e0c11a03299b31635da347d50f163f22fa5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp313-cp313t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b30ed6d95e2d77a74bdf3de165a1912bb01edb075d62cd4ec97b956b63144673
MD5 38d735780d2d86534bc04d36ab180498
BLAKE2b-256 c8384c8c20f5142d95ecc37a8bef2cf4ea77f0823dcc8fe3ffa63a6167a34be9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp313-cp313t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 577042a683811c2799de2e8e70f55d0cf262382c8937161b811dad45587200c1
MD5 6459738841a96381700a227e9e8c160a
BLAKE2b-256 b268f47889f6beff426b11ce8a4f175a70482bcf158f2eab214abfc1c36865df

See more details on using hashes here.

File details

Details for the file crackers-0.6.3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for crackers-0.6.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0f1e9b2eb7ba1bac14fd2c2e18b765b7111866a9501f67be485ec4ca6379c3e1
MD5 5cfd279ad2b3537cacaab4cc124d8b95
BLAKE2b-256 9e36b11ee73a8d5400b217625235dc22f995feb9c36e41f0b9ee112359e5cc24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a0c08796c456212fcf883fb9d4c5b19911d3e65e9018e27cbe52a3a967f0c416
MD5 f23ecbd49d9b55c8b8a643b2fff37561
BLAKE2b-256 f2db5c9c5433c102c0985480fbf3654fa6af7603e24874b70daa0c962125dbc4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fac504681dc4fe4757509e9de945a280f962c5fbadcc6325ea5670de36654989
MD5 3259df905f8a1cf0e2481f21085fdd5f
BLAKE2b-256 a82a76fd41cb4bbe792d79495066315b402c3a38dd64e31443f7b4e2810275cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f0d6c6b333513768d0f2710a4c01d5ac7de3faaa7546e83bcb1f73c9d3091aef
MD5 249493802f9aa4040f08069c7eb2f4ff
BLAKE2b-256 22172b33cff055acac1fbc12254eb9eefaad5a456241af6e14956a216951f9be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f6e8d9da91cf68e39922e8f96d552c8854e11f377354a67122972ac348f38314
MD5 d2cd420424a0e277a90a9624c75f7eaa
BLAKE2b-256 7ca4af3845c9b8f49bac62926ddb04924f8a0fcfabc81fcdeb42e14d294d5320

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 939e4c33f9e822c6e0ba8a06814cb1508940ffd8ce289e48169f675ba0f6d02b
MD5 0043949fbbc538e192a21eac2a413fb5
BLAKE2b-256 dd29a5d898cb7c4a4b851920ec3a170f1a4f3187faa3222118f3700fa194231f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5fb84dfe973a71929e5e61108bdd893ee4cb743161469942dc6d884beddb9e6b
MD5 7c92a7b5b53c0d2a806eb50e54285ab7
BLAKE2b-256 a88ad6e978fde504ee211e3723de0ec11696e2477c47065ee66d45cb6d234618

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 46bcc79851234c6cb91e792eee3d99b0147ebb4c6147dacaf718540ae29248ed
MD5 c1f62c1a351f7123886dd5526831713a
BLAKE2b-256 b8886758a2c525e59800e89698a1e44b32a415c898881fd7b7a20c3154b5ef8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c4823f89f35585b2aa6c8e0f2bf9e9990bc7ba640cb011969d2d24a81ee4a032
MD5 a81d971b400d058c2f0d99d51a70a41d
BLAKE2b-256 1212bea500d8169defa4764bd34d723e61fed94c4328cb6026a24bd428c76092

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b4cabc1eeb0dfa84e61474d340584516b2b64479680dd858f6a49ad2f476bdcd
MD5 28bfe3384535eb823bd49476caa36aa6
BLAKE2b-256 5d8bec0fcc72799f5609f85c76e007f55865e89d7b7db82d0757cece355c55d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d2ea2d0fc5c53c7f27b4cb6c0e7fb310f68435a1cbd42c89cebb3659e97012b9
MD5 98f995f3859a24bb59c4dafc01e9678c
BLAKE2b-256 a132d543d2514db593086d1eb6aa0b930492af82793fdc4f9b9428a095ef5556

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed9d916e2433714568bebf6634a562e2802de46f3452b0e509b63605ae2251ae
MD5 863b8053ff23b74610ac207c6d083435
BLAKE2b-256 23d3562a64392b972999de7f19667373a0a046a748a593d3587bb7efa23e0cfa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ed772c195fc72062b90cbcadebdfbdb65053c272a274357363ae46b5d45de102
MD5 388e8ae8f714b6ff65eabb0fad7933bf
BLAKE2b-256 ebca351a23f11e1e05b526bdca6e9bb86a5c5fcef8e4de8149adf7210255a204

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.3-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9b450eb1df6db5f46fe265c334b3c3a96cd5d7f14f62cf128d32e29d3e8f9029
MD5 3f9489f08aead7b07227ae078831410f
BLAKE2b-256 0bd969b01defbb01bed86de9cbe28b5a206bddb2aad41b701719a29bc1a47501

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