Conex – single-header C++20 library for condition-based binary pattern matching
Conex is a C++20 library designed for condition-based binary pattern matching, allowing users to define match conditions using lambdas instead of hard-coded byte signatures. It provides a flexible syntax for specifying patterns and includes functions for scanning binary data to find matches. The library requires C++20 and has no dependencies beyond the standard library, making it easy to integrate into projects.
- ▪Conex allows for semantic matching of binary patterns using lambda functions.
- ▪The library supports various pattern syntaxes and quantifiers for flexible matching.
- ▪It includes functions to search for the first match or all non-overlapping matches in a binary blob.
Opening excerpt (first ~120 words) tap to expand
Conex Binary pattern matching usually means hard-coded byte signatures. Conex lets you express match conditions as lambdas instead — find structures by semantics, not magic bytes. auto result = conex::search_first(blob, "(c0:4)(c1:8)*", [](std::span<const uint8_t> s) { /* signature check */ }, [](std::span<const uint8_t> s) { /* page-aligned address */ } ); Requirements C++20 or later No dependencies beyond the standard library Installation Copy Include/conex.hpp into your project and include it.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.