-
Notifications
You must be signed in to change notification settings - Fork 485
Description
I am experiencing an issue when scanning a variety of binary files for a regex pattern that I know exists in all of them. For one of those binary files (all are PE executables), the regex fails to find the full pattern (even though it's there), but does find the pattern when I shorten it; specifically when I remove the '.' at the end of the query. The '.' in the middle of the query work as expected.
Full query looks like this:
r"\x1E\x1F\x1E\x1F\x1E\x1E**..**\x1E\x1C\x1E\x1F\x1E\x1C..\x1E"
r"\x1E\x1F\x1E\x1F\x1E\x1E**..**\x1E\x1C\x1E\x1F\x1E\x1C" <== removed the (. .)
I want to believe I am doing something wrong in the structure of my very simple regex, since if I am not, that means I cannot trust the results of any scan. The full regex hits successfully and on a couple of files that contain the full pattern, it misses. Once I remove the "any 2 characters", it hits on the one that it misses - so it can definitely find them. Somehow these special characters appear to be the issue, but only for certain files, because on other files, everything works as expected.