I'd like to explain some of the new things I've added to YARA which will be in the next release. This is in addition to the stuff I've written about here, which are already in 3.2.0. If you have not read that I suggest you start there as it will tie in nicely with some of the things I'm going to mention here. Lastly, some of these things are not yet merged into master but I expect them to be very soon.
There is a new module in YARA called
math. The intention of this module is to expose some functions which you can use in your rules to calculate specific properties.
In particular it provides these functions for calculating different values: