Conversation
ko1N
left a comment
There was a problem hiding this comment.
Thank you for the contribution! I have a couple smaller nitpicks but then we can merge it 👍
| } | ||
| ); | ||
| //implement for Plain Old Data, this transmutes the read to the structure. | ||
| unsafe impl Pod for _EPROCESS {} |
There was a problem hiding this comment.
Is this required to manually implement Pod? What is the actual size of the struct? Maybe it would be nice if we could specify that as well (e.g. when you want to read arrays)
There was a problem hiding this comment.
Is this required to manually implement Pod?
I found that using `#[derive(Pod)] was fiddly with the macro expansion
There are other examples of memflow internally using unsafe impl Pod for T {} as its a required trait bound for Pointer<U, T>
What is the actual size of the struct? Maybe it would be nice if we could specify that as well (e.g. when you want to read arrays)
Currently offseter doesnt provide a method to pass in the size. its something i could look at getting put in later.
As a workaround usually i just add the last field of a struct or pad it with bytes at the end
|
I now have a fork of offsetter that supports sizing of struct fields rather than padding. It was mentioned this morning in the discord about switching from dataview to bytemuck for the Pod type so id assume for now this can wait until then |
5454125 to
ab8d7d3
Compare
83f316e to
04978ac
Compare
Simple example showing how you can use Pod to transmute easily into given structures.
I think its a good demo of how flexible memflow is