MITRECND/yaraprocessor — pull request #3 by Locker537 (2014-07-21 14:11:20+00:00)
Title: Add support for compiled rule files. Fix #2

@systemxcom and @wxs, if either of you have a moment, please test these changes report back! This commit adds support for compiled rule files.

If you are running `yaraprocessor.py` from a shell, you can now pass `--compiled` as an argument, which implies the rule file supplied to `--rules` is compiled.

Note that yara only supports loading rules from *one single compiled file*. This is reflected in yaraprocessor as well.

If you are using this library directly from your code, you can instantiate a `Processor` with compiled rules by passing the optional keyword argument:

```python
p = Processor(['/full/path/to/rules, relative/path/to/other/rules'], compiled=True)
```

I've tried to improve the exception handling when providing compiled rules *without* the appropriate configuration and vice versa.

If this works for you, just reply to this pull request and I will merge!