-
Notifications
You must be signed in to change notification settings - Fork 85
feat: process scanning #384
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
base: main
Are you sure you want to change the base?
Conversation
I fixed the clippy errors (sorry about that). |
Ok, pretty sure I actually fixed the clippy errors now (switched to using the toolchain thats listed at the top of the clippy job). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for implementing this (as this was the main thing I was missing from yara-x so far).
Regarding MacOS: If you need something tested on a MacOS, I'd be glad to help out.
.set(self.wasm_store.as_context_mut(), Val::I32(1)) | ||
.unwrap(); | ||
|
||
// Set the global variable `filesize` to the size of the total memroy regions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly this should be something the caller can choose? YARA uses "memory iterators", which have a similar option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that sounds good, the only thing Im not sure about is how to set a wasm global to undefined.
adding a method to the DataIter trait is probably the way to do this.
If you could try compiling the branch for macos and inform me if any issues that arise that would be great (macos is not implemented so dont expect to be able to scan processes, I just want to make sure that it compiles). |
It compiles on MacOS. There are some warnings about unused code ( |
@plusvic would it be possible to run the checks now? |
I am happy to report that my hat is delicious. |
…f another process in order to scan it
… processes memory into our own memory at once
…ad moving on to next region
…ux (although of course, scan_proc wont be available)
…e now does not match itself
acb3a7e
to
8760d29
Compare
Hi @plusvic. |
Hi @JonathanAnbary, it will take me some time before I can look into this thoroughly. As this is a big feature with a lot of implications from the API standpoint, I want to be very careful with it. My preliminary assessment is that this is unlikely to be merged as is. I would like to avoid at all cost to have all the OS-dependent code merged into the |
Aupa @plusvic ! If you eventually add this feature, consider parsing |
After merging #459 we already have an API for scanning memory blocks that could support process memory scanning on top of it. For the time being I don't plan to implement the OS-dependent memory reading logic. If that's ever implemented, I envision it as a separate crate that abstracts you from the details of reading the memory of another process given the process ID. I guess some other Rust crates can benefit from having such an API in a stand-alone crate. With the new block scanning API, and some other crate that reads memory from external processes, implementing process scanning should be fairly trivial. |
Implemented Process scanning in lib (not accessible from cli yet) for linux and windows.
the semantics of the scan are as follows: