Hugal31 / yara-rust

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

Question: Feature Implementations #6

Open dfirence opened 4 years ago

dfirence commented 4 years ago

Hi

What is the possible estimate on ur implementation of these features from the REDAME?

Implement the scanner API. Add process scanning.

Hugal31 commented 4 years ago

As I am not working actively on the project, I cannot say when I will be able to deliver those features. For instance, I give some of my spare time to work on the stream API, which is almost done.

dfirence commented 4 years ago

Hi Hugal31, one final question, by using the bindgen with your crate, does the Yara binary get compiled with my program as a resource to {{ my.exe }}?

Or does your crate provide wrappers and I need to have Yara binaries deployed on the target machine?

I ask because my needs are to deploy a rust compiled binary {{ my.exe }} that can offer Yara scanning without having to deliver additional payloads.

Hugal31 commented 4 years ago

Hum, if you look at this line in the yara-sys build.sh (rustc-link-lib=yara), I do not specify the link type with Yara.

So, IIRC, if the linker finds only a static library (.a or .lib), it will link statically, and if it finds a shared library (.so or .dll), it will prefer to link dynamically. In the first case, yara will be embedded in your executable, otherwise, you will need to have it in your library path, or near your executable on Windows.

You can force rustc to link statically by replacing the option in the build.sh by rustc-link-lib=static=yara (see the rustc documentation for more information about how to link with libraries).

I might add a feature flag to the crate to specify the link type.

I hope that respond to your question !

Hugal31 commented 4 years ago

Related: #7

ikrivosheev commented 2 years ago

@Hugal31 If I understand correctly, can we close this one?