Closed eve-mem closed 2 months ago
Also, we test then we merge. Much better than merging and breaking... 5;P It's kinda the whole reason for making these PRs in the first place... 5;D
Oh vmayarascan is the linux one? Yeah, sorry, I forgot we had a linux specific one now. Yep, we can update that too...
Oh, hmmm, it looks like even though it should be combining a bunch of the data to make a chunk, it's not necessarily doing that... 5:S Ugh, not an area of the code I really want to wade into, but it's definfinitely not working the way it was supposed to (and therefore getting pretty ugly and inefficient in the process). 5:S
Also, we test then we merge. Much better than merging and breaking... 5;P It's kinda the whole reason for making these PRs in the first place... 5;D
... Yes totally! I need to work on my wording there :D
Maybe I've misunderstood the yarascanning bits, i only did some very basic tests which is quite amateur of me... Let me come back with a solid example and test case for us.
Maybe I've misunderstood the yarascanning bits, i only did some very basic tests which is quite amateur of me... Let me come back with a solid example and test case for us.
No, I just need to look into the scanning mechanism and make sure it chunks together suitable sized pieces.
Ok, having taken a few hours to dig into this, I believe the scanner is doing the correct thing, which is taking a segment of memory, pulling out all the mapped chunks and scanning each one chunk by chunk where the chunks are not contiguous. This doesn't fit with how people expect yara to work, because they assume that they can just read the entire vma and anywhere that isn't mapped will just come up as 0. So I'm not sure whether/how to fix yarascan? Are people's expectations incorrect, or should yara be scanning pages padded with 0s when there's no mapped pages in the middle? The idea behind the scanner chunking is to make sure scanning processes are reading through reams and reams of pointless 0s. Since yara is C code under the hood, and we're pretty efficient at padding things, perhaps we should just read the whole layer and take the memory hit.
One other option would be to build an file-like class that reads from the layer as much/as little as yara asks for, letting it handle the buffering. I'll probably try and mock that up later, but for now yarascan (and more importantly, the scanning framework) are staying as they are at the moment.
Once https://github.com/volatilityfoundation/volatility3/pull/1193 is merged successfully and tested to be working we will also need to update vmayarascan for the same reasons.
Vmayarascan won't be scanning as people expect, but only 4096 bytes at a time.