-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add process scanning, implement it on Linux and Windows #88
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1ee5a21
to
a1219cc
Compare
The linux32 conformance test fail was a bit of a pain to track down, but the fix is in review on YARA's side: VirusTotal/yara#2005 |
vthib
added a commit
to vthib/yara-rust
that referenced
this pull request
Nov 22, 2023
vthib
added a commit
to vthib/yara-rust
that referenced
this pull request
Nov 23, 2023
aba43e3
to
4f38334
Compare
6d2b6b7
to
b2f371e
Compare
This will make it possible to implement this trait differently for each OS handling process scanning.
Make it possible to return None when fetching memory. This could have been a Result as well, but the error would have just been ignored. Another possiblity I played with was returning two kinds of errors, either recoverable (we keep scanning) or unrecoverable (we abort the scan). This is however a bit shaky on the semantics, since during evaluation, we may fetch regions, but we have no way of bubbling up the unrecoverable error in that case. So for the moment, just use an Option. If a more complex usecase arises in the future, this could change.
Instead of listing every region at the start, and then fetching them, reduce the time between the listing of one region and its fetch. This is useful as regions of a live process can change size, and if the size becomes smaller, the read can entirely fail (this happens on windows for example).
Add a new crate used for process scanning tests. This will allow much more freedom on how to write those tests, and will avoid issues related to self scanning. This binary is now used for some tests, and more are coming.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First draft of process scanning. Implemented on linux and windows. Not exposed for the moment as it still needs some work.