You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Makes the MemoryReader_t interface safer. You can't access its raw buffer anymore, you have to go through ReadMemory which will enforce memory safety. On top of that, the MemBlock_t has been updated to not expose a raw Data pointer anymore but instead an offset. This allows us to kinda make sure somebody won't keep a pointer around after the dump instance has been destructed & run into UaFs. As long as the buffer is kept alive by the MemoryReader_t, this interface should be hard to misuse.
Also the MemoryReader_t interface has been designed such that, if somebody wanted, they could also read a user-mode dump directly from a FILE* and not necessarily use a memory-mapped file. I haven't implemented it, but it should be doable with this new interface.
Also the MemoryReader_t interface has been designed such that, if somebody wanted, they could also read a user-mode dump directly from a FILE* and not necessarily use a memory-mapped file.
I don't see how this would work? The MemoryReader_t still exposes the raw pointers via ViewBase and ViewEnd and Read is not a virtual function, so a derived class wouldn't be able to override it.
Oh yes you're right, but making Read virtual is one line change; none of the algorithm need changing, which was the annoying part :)
And yes you're also right about ViewBase / ViewEnd but this will become an implementation details of the memory readers, not the future reader interface (whenever somebody asks for the file implementation); but right now again the algorithm don't use the base / end (nor the py bindings) so it'll be an easy fix as well.
Hope it makes sense, and really appreciate you taking a look, thank you!
This file contains hidden or 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
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.
This PR:
MemoryReader_tinterface safer. You can't access its raw buffer anymore, you have to go throughReadMemorywhich will enforce memory safety. On top of that, theMemBlock_thas been updated to not expose a rawDatapointer anymore but instead an offset. This allows us to kinda make sure somebody won't keep a pointer around after the dump instance has been destructed & run into UaFs. As long as the buffer is kept alive by theMemoryReader_t, this interface should be hard to misuse.MemoryReader_tinterface has been designed such that, if somebody wanted, they could also read a user-mode dump directly from aFILE*and not necessarily use a memory-mapped file. I haven't implemented it, but it should be doable with this new interface.