Repository navigation
Conversation
|
Wow this is surprising, both the results (10x speed-up) and the price (5x compile time and 5x binary size). I did a little investigation and apparently the reason yara-x is so big is because it bundles in a wasm-runtime that has a JIT compiler. And that is a good chunk of the binary. The Not sure about the speed though. regex is pretty fast, so it could be competitive. As for syntax, I have never used yara, but it seems to have a pretty clean syntax for searching bytes, the regex crate seems to require using Just an idea |
|
I tested regex::bytes and it looks very promising indeed! We'd lose a few things such as nibble-level matching, but it sounds much better than increasing both compilation time and binary size a lot. EDIT: I forgot to disable caching. |
|
I have something :) #71 |
Faster than yara? very nice then! |
|
#71 prevailed. |

This PR is bold. :)
It adds an option enable case-insensitive search (
:set ignorecase, like in Vim) and adds to support hex pattern matches. This first version uses YARA-X for pattern matching, but will check how bmatcher performs before merging.YARA-X pros: negation, unlimited jumps, can use string modifiers with text matching if needed (
wide,nocase,fullword,xor, etc). cons: release binary went from 5.9MB (15.37s to compile in my machine) to 25MB (1m13s).bmatcher pros: both binary size and compilation time are nearly the same. However, a simple
FEC01F803F??07search on a 3.8GB file took ~22s while YARA-X completed in ~2s.PS.: the case-insensitive search is done with the new
find_nocaseandrfind_nocasefunctions that use memchr. So, no pattern matching is needed.