VirusTotal / yara-python

The Python interface for YARA
http://virustotal.github.io/yara/
Apache License 2.0
648 stars 179 forks source link

Allow a Py_buffer as data for Rules_match #152

Closed teskje closed 4 years ago

teskje commented 4 years ago

This makes rules matching compatible with data objects PyArg_ParseTuple does not consider read-only (even though they might actually be), such a memoryviews. The main change is replacing the s# formatter with s* and replacing the (pointer, length) pair with a Py_buffer object accordingly. Additional care must be taken to release the Py_buffer on every error path.

Resolves #147.

justanotheranonymoususer commented 4 years ago

I need this. Maintainers, please merge. Meanwhile, is there any workaround with the current version of the library?

justanotheranonymoususer commented 4 years ago

Wow, that was fast, thanks @plusvic! Now, when is a new version planned? :)

marnao commented 3 years ago

just wanted to say thanks for implementing and merging this! I came here looking to see if anyone else had run into this issue and you all did not disappoint!