Open nikhilh-20 opened 2 years ago
I've had a need for this in the past and just ended up doing a long or
chain. If @plusvic agrees with this or has a better idea I'd be happy to take a shot at making it work.
I think it makes sense that iterators work on lists of strings too. It's more intuitive than a long sequence of or
statements.
OK, I'll take a shot at implementing this in the coming weeks.
I've taken a shot at this and am having a hard time getting it to work correctly in the grammar. It seems there is a conflict with the way integer sets are built.
Also there is https://github.com/VirusTotal/yara/pull/1338, which might make this issue obsolete. As such, I'm going to put this on hold until I can come up with a way to make it work or someone with more knowledge than me can do it.
After being shown the path by @plusvic I've got this implemented and up for review now.
Thanks, again, Victor!
Hello,
I recently had a use-case where I wanted to have a list of strings in the
conditions
block in a yara rule. I'm using yara v4.0.5. A minimal example is: comparing the SHA1 of a file with a known set of hashes. This is a working yara rule:test.yar
:For readability, this is alright when there are, say, 5 hashes. But if there are 100 hashes, then the rule file becomes messy. Is there a way in yara to have non-search strings in one variable? And I'm not referring to the
strings
block because those strings are searched in the file. I'm referring to a string variable (containing a list of strings) which is not searched in the file and can purely be used in theconditions
block. Also, I assumehash.sha1
will be computed only once? (caching: https://github.com/VirusTotal/yara/issues/592)Something like:
The above doesn't work:
Thanks for the help!