Skip to content

A library that provides multiple signature matching techniques

License

Notifications You must be signed in to change notification settings

tomerb/sigmatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

        .__                       __         .__                  
   _____|__| ____   _____ _____ _/  |_  ____ |  |__   ___________ 
  /  ___/  |/ ___\ /     \\__  \\   __\/ ___\|  |  \_/ __ \_  __ \
  \___ \|  / /_/  >  Y Y  \/ __ \|  | \  \___|   Y  \  ___/|  | \/
 /____  >__\___  /|__|_|  (____  /__|  \___  >___|  /\___  >__|   
      \/  /_____/       \/     \/          \/     \/     \/       

Various signature matching algorithms.

Usage

You can look in the test directory to check out a few examples of how to use sigmatcher. In general, the following exmpale depict a common usage pattern:

#include "signature_matcher_factory.h"

int main()
{
    // Create a signature matcher instance. See SignatureMatcherType for a list
    // of supported matchers.
    auto sig_matcher =
        sigmatcher::SignatureMatcherFactory::Create(sigmatcher::SignatureMatcherType::SMT_CRC32);

    // Add a file to the sigmatcher. Each sigmatcher implementation is free to store the file's
    // signature in whatever way it sees fit.
    sig_matcher->Add("/path/to/some/file");

    // Check if a file matches a known one
    if (sig_matcher->Check("/path/to/another/file"))
    {
        // Match!
    }

    // Store the matcher's internal DB into persistent sotrage
    if (!sig_matcher->Serialize("signatures.db"))
    {
        // Failure
        return -1;
    }

    // Load a DB into memory
    if (!sig_matcher->Deserialize("signatures.db"))
    {
        // Failure
        return -1;
    }

    return 0;
}

Pre-requisite:

  • boost/crc
  • boost/test
  • openssl
  • CMake

About

A library that provides multiple signature matching techniques

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published