Skip to main content

A modified version of mrab-regex with added cpytraceafl instrumentation

Project description

cpytraceafl-regex

This is a thinly modified version of Matthew Barnett's mrab-regex regular expression library with added instrumentation for use when fuzzing python code with cpytraceafl.

The intention is for fuzzing harnesses to be able to substitute the builtin re module library with this, highly compatible, module and thereby allow AFL to generate examples which pass regular expressions used in the target or explore their limits in interesting ways.

See the original README.mrab-regex.rst for more general information in this library's extended regex features.

Recommended usage

Early in the startup of the fuzzing harness, (though after the call to install_rewriter()):

import regex
from sys import modules
modules["re"] = regex

code later importing/referencing the re module should instead be using this instrumented regex code. Note that before evaluating any regexes, cpytraceafl.tracehook.set_map_start() will need to have been initialized with a memory region to write its intrumentation data into. Otherwise you'll get segfaults.

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

cpytraceafl-regex-0.2.0.tar.gz (679.0 kB view details)

Uploaded Source

File details

Details for the file cpytraceafl-regex-0.2.0.tar.gz.

File metadata

  • Download URL: cpytraceafl-regex-0.2.0.tar.gz
  • Upload date:
  • Size: 679.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200601 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for cpytraceafl-regex-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5b6382d2d1329ed278d82d63e8d4b2e02250102fcead5d6897d86ea9b2ede8d9
MD5 27d01097bbac96da780ba521a8dc325e
BLAKE2b-256 5933a1921272e4a6d47125fdb1a183463d3103e8423cce764335710335172e13

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