Hugal31 / yara-rust

Rust bindings for VirusTotal/Yara
Apache License 2.0
74 stars 29 forks source link

Read rules from memory #5

Closed rhaist closed 4 years ago

rhaist commented 4 years ago

It would be great if (compiled) rules could be loaded from memory instead of loading them from a file on disk:

[1] https://yara.readthedocs.io/en/v3.4.0/capi.html#saving-and-retrieving-compiled-rules [2] https://github.com/hillu/go-yara/blob/v1.1.0/rules_yara34.go#L95

Hugal31 commented 4 years ago

Sure! It should not be hard to add a YrReadStream and a YrWriteStream traits, and implement them for Read and Write.

Hugal31 commented 4 years ago

Rules::load_from_stream and Rules::save_to_stream are available in v0.4.1.