Skip to content

v0.7.0#20

Merged
0vercl0k merged 15 commits intomainfrom
fbl_fixup_memview
Sep 30, 2025
Merged

v0.7.0#20
0vercl0k merged 15 commits intomainfrom
fbl_fixup_memview

Conversation

@0vercl0k
Copy link
Copy Markdown
Owner

@0vercl0k 0vercl0k commented Sep 14, 2025

This PR:

  • 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.

@0vercl0k 0vercl0k changed the title Misc improvements v0.7.0 Sep 19, 2025
@0vercl0k
Copy link
Copy Markdown
Owner Author

@mrexodia I think I'm kinda done tweaking things around; I'd love if you could give it a shot & let me know if anything breaks / have any feedback :)

Cheers

@mrexodia
Copy link
Copy Markdown
Contributor

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.

Otherwise the new interface works fine for me!

@0vercl0k
Copy link
Copy Markdown
Owner Author

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!

Will try to merge this tomorrow or something.

Cheers

@0vercl0k 0vercl0k merged commit f49c33d into main Sep 30, 2025
24 checks passed
@0vercl0k 0vercl0k deleted the fbl_fixup_memview branch September 30, 2025 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants