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.2.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.2-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

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

Uploaded PyPymanylinux: glibc 2.28+ ARM64

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

Uploaded PyPymanylinux: glibc 2.28+ x86-64

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

Uploaded PyPymanylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13tmanylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

crackers-0.6.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: crackers-0.6.2.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.2.tar.gz
Algorithm Hash digest
SHA256 ef5782c6d2d4a71901d638e5587191325936b2c44a7669ffff2ed1618e923d36
MD5 a95faada0968bb8ee5d5e88de6d14885
BLAKE2b-256 a98a93043e4b7c5483ed3c43cf57b0a1056940873f5683335e55310e6676ce51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 99534c81728c2dc9ca3ba346f959e30ce9441aaf42ce5dfa47f5ae3b44cf92b6
MD5 d96c2b744505e8e52ce1ab113f6dc87a
BLAKE2b-256 9a760e4e9cb80c98533ecc91b2a4d4409f1b50ba257a2ec4f50aea6757ab85ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 181e7f34610769ca41c7e0794c8a8fff6c6a008f8ca2c816da92e3e93b49071f
MD5 ac06ef3a4375e0ed9d5852b6fd979dc5
BLAKE2b-256 f6dcb461113171b3e8445170baba454a509b1af3d6dbd0d8f17c8a253f0d41ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 741cf6c54f4900c8a9accfef040088b3da95768c0a872a5337ccd69f7c6b9762
MD5 b54c1ecfaf2d7bd4a41b6e66fa20c83d
BLAKE2b-256 1f21166088f788df6d55b7d2f973e64d51cf7136f4d9107668c27e933ea95ea2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4db3b37900123323ca9ee4d0533f6a52f07d3a34e5f874c37f4145eaf28fd009
MD5 4448c252db090b9cd4129e3531733974
BLAKE2b-256 02d919044bf6c50b8447d4f83473eb49861aa11919f5f10d2b7a611f2ee26f62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp313-cp313t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d9da492f57ec9c0e596baa85ab4de78c95e94b4bd4f35ca511f01f5891ae112a
MD5 d7c1b7ed04fe31018641947d710825d0
BLAKE2b-256 24ef3ab57f7406959f37a85dad2764423a72b9ece2a199b48811f1f8974f4f0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp313-cp313t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7f37a8ad3772c5ef059b9af13065a6c58a4c62a3129f411b25d29673101c9ce9
MD5 1c2a4079dbb82cb180c7f73d0b4af772
BLAKE2b-256 6db130255b7a1ab0f09e15647744613ebad2730432cef3fc4a33b1d9ad2b11c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 44eb78875aebb8fd316d167ec5c7d136708cb3a0d7a1a5bc964761bcd46d953a
MD5 b25fbef52389be3f2c3eff310c282493
BLAKE2b-256 b50b801eb921af1f0b84ee8b9a716c0a430ebe5f7841a7ab7f542350ab99b93b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 37bf7217bcce002560809cfabae65fa0b1b74bfc1b8a75af4aea34368c9793bf
MD5 d6c639309ee94c1ae6cf4a85d716015b
BLAKE2b-256 885356e9ed2b86f622d2fd26da9d4dedd5a7818ecbbbc33e0dfe40c81f16fd8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 04c78dc6060eb02412cad5ed9558fa84b8b501f4909021b49581fb8f13e5b014
MD5 c502bbda14b87c66b0e9e6aa7395fa0a
BLAKE2b-256 a42b7d9f30ad6c5f78695491cc49a7452054d5fe1445b33100a4412b93e0f567

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87bc334b0b0bf4f6dad1163bdf99e116267496c6117bc668f56b17aeaf5c177a
MD5 9c4b78a7259d50f29a057bd0bf6bc4c2
BLAKE2b-256 f7ccde2f613e8c9700354cacf36124b5829bd5b48bb042060308fcbe6f791f03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 550923781a0f01ebd704a7f4bcae9f644440057f84d8c47d9d1402768b0bc120
MD5 0b586225e82c1844c3808dcd4f87999b
BLAKE2b-256 9068cd53cd20b2287615ae260bcafdb696da1fb095eee25b0edf802b8f0cefce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6da1cba4fbbfc6ef903fc5f3ba5489920882fa2cc507014ffde4799917a35d0a
MD5 fd0f42edf3f0d53138e02b12043c6ca4
BLAKE2b-256 87d7b3cb0783752c9a72736edb96083b659095bf26f647a8ca72782359b88d6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 257d7abb6dc623ed8f9324ec2827a5b2f2f1fad4ed09252516847d4a9eba764c
MD5 d0a00494ef56918d0fcee259865506dc
BLAKE2b-256 614a46b38e0684bb5bfed5e0b4d6f21728b2330c5101b26f1910d58ebb013516

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a047cc3ca4e12386c44c48b6c97cceb984d19524c92cda99a0bf386dd68789e2
MD5 3f0c44c2c3d244ae735e7c6dd1d7918a
BLAKE2b-256 92e701f59d25b3b5677abffe0c09a44ba1431203a376ebb3928fc4770dcecc3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e6e47d36ced65806b7bc455663e1c25fc2cff3bcafee6175b106ecd171522a15
MD5 57457788c01ef9b260c8b0bec652e5a4
BLAKE2b-256 7c4bd79136cb62da1eb6da91ef5a603fb509204ce3eaba26b5b7997499dd3310

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f0e0fe1cc36b66897b03db44893ac7367cd62c142cf49e3b2a0a0113f10e92a6
MD5 111917bda61995082282bf64ea4b055a
BLAKE2b-256 4140711c38488c0220b7b0d92f6eae6313a15ecb8a7a451b5028637b6773f5a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 21f4d66f20248d88e82fed4e8cfbc63128e0b85e8ad25aca02ad725303390ac7
MD5 0e50760f96e6ef2f3b782a4e8abbe047
BLAKE2b-256 da282a2a443a9b75c3fd013e0896dc4425c0fc134cceb10c37bab57f54633e2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 581af141338536d0d7f58cfc23f4c9e27483e396926cdd8aae6b2340b6dfaaf9
MD5 5b09cb572efccf5a1212ffd11c699ccd
BLAKE2b-256 2e72e2c31f5b85d937f983c348ed952ab5a30402b54aa8ed57f17ddde2faa805

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5a20b64590c37238316429608704dc331df7d84cbaf1c1f6820e609b8134f214
MD5 522af1515d3082a9a8a53ff8e4d93f1b
BLAKE2b-256 9fc65af39f30ca1afa77a699bc33d54d542ae53740812606b6fa1b9097784362

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crackers-0.6.2-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 438dc743dffe87e762aa3fcc5fd361ce1caec4c88d021359f1ed2b69fb336d72
MD5 985354364908e3ba0fdb67dd561c7283
BLAKE2b-256 4801b2289ac47533bbadc574b4a78606a93c064b421d56de17a7963ba80f384a

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