✨sigmatch - Modern C++ 20 Signature Match / Search Library

logo
sigmatch

Modern C++ 20 Signature Match / Search Library

Features

  • 🍃 Header-only, no dependencies, no exceptions.
  • Compile-time literal signature string parsing.
  • ❄️ Supports full-byte wildcards (?? or **) and semi-byte wildcards (1? or *B).
  • 🚀 Supports blocking (chunking) and multi-threaded for fast search.
  • 🎯 Supports searching in the current process, external processes and files.
  • 🍄 Customizable reader and target allow you to search on more targets (e.g. network traffic packets).

🌠 Examples

A quick example:

using namespace sigmatch_literals;

sigmatch::this_process_target target;
sigmatch::search_result result = target.in_module("**module_name**").search("1A ?? 3C ** 5* ?F"_sig);
for (const std::byte *address : result.matches()) {
    std::cout << "matched: " << address << '\n';
}

See /examples for more.

🍰 Todo

  • Complete CI for testing and documentation deployment.
  • Host the documentation on GitHub Pages.
  • Statistical tests coverage.
  • Complete benchmarks.
  • Test compilers other than MSVC.
  • Implement class executable_file_target.
  • Port to Linux.

📜 License

sigmatch is licensed under the Apache-2.0 License.

Owner
Sprite
C/C++ Windows desktop & kernel driver developer, reverse engineer.
Sprite
Similar Resources

The QuantLib C++ library

QuantLib: the free/open-source library for quantitative finance The QuantLib project (http://quantlib.org) is aimed at providing a comprehensive softw

Sep 20, 2022

A C++ header-only library of statistical distribution functions.

StatsLib StatsLib is a templated C++ library of statistical distribution functions, featuring unique compile-time computing capabilities and seamless

Sep 14, 2022

SymEngine is a fast symbolic manipulation library, written in C++

SymEngine SymEngine is a standalone fast C++ symbolic manipulation library. Optional thin wrappers allow usage of the library from other languages, e.

Sep 16, 2022

nml is a simple matrix and linear algebra library written in standard C.

nml is a simple matrix and linear algebra library written in standard C.

Sep 12, 2022

RcppFastFloat: Rcpp Bindings for the fastfloat C++ Header-Only Library

RcppFastFloat: Rcpp Bindings for the fastfloat C++ Header-Only Library

Converting ascii text into (floating-point) numeric values is a very common problem. The fast_float header-only C++ library by Daniel Lemire does this very well, and very fast at up to or over to 1 gigabyte per second as described in more detail in a recent arXiv paper.

May 2, 2022

📽 Highly optimized 2D|3D math library, also known as OpenGL Mathematics (glm) for `C

📽 Highly optimized 2D|3D math library, also known as OpenGL Mathematics (glm) for `C

Highly optimized 2D|3D math library, also known as OpenGL Mathematics (glm) for `C`. cglm provides lot of utils to help math operations to be fast and quick to write. It is community friendly, feel free to bring any issues, bugs you faced.

Sep 17, 2022

C++ library for solving large sparse linear systems with algebraic multigrid method

AMGCL AMGCL is a header-only C++ library for solving large sparse linear systems with algebraic multigrid (AMG) method. AMG is one of the most effecti

Sep 18, 2022

Header only FFT library

dj_fft: Header-only FFT library Details This repository provides a header-only library to compute fourier transforms in 1D, 2D, and 3D. Its goal is to

Sep 1, 2022

C++ Mathematical Expression Parsing And Evaluation Library

C++ Mathematical Expression Toolkit Library Documentation Section 00 - Introduction Section 01 - Capabilities Section 02 - Example Expressions

Sep 16, 2022
Comments
  • Fix two compiler errors

    Fix two compiler errors

    VS: 17.1.2 MSVC: 19.31.31105

    Missing header <array>

    (E2500 is a false positive error from the editor, it doesn't affect the compiler)

    Fix:

    #include <array>
    

    Missing appropriate constructor for msvc_c7599_false_positive_workaround

    1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xmemory(676,18): error C2672: 'std::construct_at': no matching overloaded function found
    1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(602): message : see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,std::thread,std::span<const std::byte,18446744073709551615>>(_Alloc &,_Objty *const ,std::thread &&,std::span<const std::byte,18446744073709551615> &&)' being compiled
    1>        with
    1>        [
    1>            _Alloc=std::allocator<sigmatch::multi_threaded_searcher::thread_info>,
    1>            _Ty=sigmatch::multi_threaded_searcher::thread_info,
    1>            _Objty=sigmatch::multi_threaded_searcher::thread_info
    1>        ]
    1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(607): message : see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,std::thread,std::span<const std::byte,18446744073709551615>>(_Alloc &,_Objty *const ,std::thread &&,std::span<const std::byte,18446744073709551615> &&)' being compiled
    1>        with
    1>        [
    1>            _Alloc=std::allocator<sigmatch::multi_threaded_searcher::thread_info>,
    1>            _Ty=sigmatch::multi_threaded_searcher::thread_info,
    1>            _Objty=sigmatch::multi_threaded_searcher::thread_info
    1>        ]
    1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\vector(620): message : see reference to function template instantiation '_Ty &std::vector<_Ty,std::allocator<_Ty>>::_Emplace_back_with_unused_capacity<std::thread,std::span<const std::byte,18446744073709551615>>(std::thread &&,std::span<const std::byte,18446744073709551615> &&)' being compiled
    1>        with
    1>        [
    1>            _Ty=sigmatch::multi_threaded_searcher::thread_info
    1>        ]
    1>C:\sigmatch\include\sigmatch/sigmatch.hpp(2159): message : see reference to function template instantiation '_Ty &std::vector<_Ty,std::allocator<_Ty>>::emplace_back<std::thread,std::span<const std::byte,18446744073709551615>>(std::thread &&,std::span<const std::byte,18446744073709551615> &&)' being compiled
    1>        with
    1>        [
    1>            _Ty=sigmatch::multi_threaded_searcher::thread_info
    1>        ]
    1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xmemory(676,18): error C2783: '_Ty *std::construct_at(_Ty *const ,_Types &&...) noexcept(<expr>)': could not deduce template argument for '<unnamed-symbol>'
    1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(134): message : see declaration of 'std::construct_at'
    1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xmemory(680,47): error C2440: 'initializing': cannot convert from 'initializer list' to 'sigmatch::multi_threaded_searcher::thread_info'
    1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xmemory(680,47): message : Invalid aggregate initialization
    

    Test code:

    1>C:\sigmatch\include\sigmatch/sigmatch.hpp(2165,1): error C2665: 'sigmatch::impl::msvc_c7599_false_positive_workaround::msvc_c7599_false_positive_workaround': none of the 3 overloads could convert all the argument types
    1>C:\sigmatch\include\sigmatch/sigmatch.hpp(955,1): message : could be 'sigmatch::impl::msvc_c7599_false_positive_workaround::msvc_c7599_false_positive_workaround(sigmatch::impl::msvc_c7599_false_positive_workaround &&)'
    1>C:\sigmatch\include\sigmatch/sigmatch.hpp(955,1): message : or       'sigmatch::impl::msvc_c7599_false_positive_workaround::msvc_c7599_false_positive_workaround(const sigmatch::impl::msvc_c7599_false_positive_workaround &)'
    1>C:\sigmatch\include\sigmatch/sigmatch.hpp(955,1): message : or       'sigmatch::impl::msvc_c7599_false_positive_workaround::msvc_c7599_false_positive_workaround(void)'
    1>C:\sigmatch\include\sigmatch/sigmatch.hpp(2165,1): message : or       'sigmatch::impl::msvc_c7599_false_positive_workaround::msvc_c7599_false_positive_workaround<const std::byte,18446744073709551615>(const std::span<const std::byte,18446744073709551615> &)', which inherits 'std::span<const std::byte,18446744073709551615>::span(const std::span<_OtherTy,_OtherExtent> &) noexcept' via base class 'std::span<const std::byte,18446744073709551615>'
    1>C:\sigmatch\include\sigmatch/sigmatch.hpp(2165,1): message : while trying to match the argument list '(std::span<const std::byte,18446744073709551615>)'
    

    I'm not sure whether this is a bug of MSVC, but there is no harm to add a constructor to fix it:

    class msvc_c7599_false_positive_workaround : public std::span<const std::byte>
    {
    public:
        using std::span<const std::byte>::span;
        
        msvc_c7599_false_positive_workaround(const std::span<const std::byte>& span) : std::span<const std::byte>(span) {}
    };
    
Kraken is an open-source modern math library that comes with a fast-fixed matrix class and math-related functions.

Kraken ?? Table of Contents Introduction Requirement Contents Installation Introduction Kraken is a modern math library written in a way that gives ac

Aug 26, 2022
Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)

KFR - Fast, modern C++ DSP framework Compiler support: https://www.kfr.dev KFR is an open source C++ DSP framework that focuses on high performance (s

Sep 19, 2022
Random for modern C++ with convenient API

Random for modern C++ with convenient API Design goals Supported compilers Integration Five-minute tutorial Number range Common type number range Char

Sep 22, 2022
MIRACL Cryptographic SDK: Multiprecision Integer and Rational Arithmetic Cryptographic Library is a C software library that is widely regarded by developers as the gold standard open source SDK for elliptic curve cryptography (ECC).

MIRACL What is MIRACL? Multiprecision Integer and Rational Arithmetic Cryptographic Library – the MIRACL Crypto SDK – is a C software library that is

Sep 20, 2022
A C library for statistical and scientific computing

Apophenia is an open statistical library for working with data sets and statistical or simulation models. It provides functions on the same level as t

Sep 11, 2022
P(R*_{3, 0, 1}) specialized SIMD Geometric Algebra Library

Klein ?? ?? Project Site ?? ?? Description Do you need to do any of the following? Quickly? Really quickly even? Projecting points onto lines, lines t

Sep 18, 2022
linalg.h is a single header, public domain, short vector math library for C++

linalg.h linalg.h is a single header, public domain, short vector math library for C++. It is inspired by the syntax of popular shading and compute la

Sep 23, 2022
LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C.

libtommath This is the git repository for LibTomMath, a free open source portable number theoretic multiple-precision integer (MPI) library written en

Sep 20, 2022
a lean linear math library, aimed at graphics programming. Supports vec3, vec4, mat4x4 and quaternions

linmath.h -- A small library for linear math as required for computer graphics linmath.h provides the most used types required for programming compute

Sep 18, 2022
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.

OpenBLAS Travis CI: AppVeyor: Drone CI: Introduction OpenBLAS is an optimized BLAS (Basic Linear Algebra Subprograms) library based on GotoBLAS2 1.13

Sep 22, 2022