-
Notifications
You must be signed in to change notification settings - Fork 11
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
[Unity] Automatic pointer path resolution for Mono games #60
Conversation
For the purposes of using functions like this with Edit: and if I'm using |
Either way should probably be fine. I'm just not sure which is the most sound approach. I'll see what I can do later. |
To stay within no A Edit: another idea: could |
A |
For storing multiple |
No, A second Also the idea of using a normal constructor with |
I think this would be better if it didn't require a lifetime parameter I see 2 ways to avoid it, either using I also think it would be better if the That would allow a pointer with a type like |
Although I believe the lifetime parameter is not a big issue in this specific case (they're never gonna change anyway, as long as the game isn't closed), you're right, but I didn't have time to think a lot about it. I REALLY don't want to use alloc unless absolutely needed, as all the rest of the stuff we implement for Unity is not using it. |
The code has been rewritten again. This time I'm kinda abusing |
Closing this as the changes are included in #67 |
This commit adds a new
Pointer
struct that allows for automatic resolution of pointer paths in Unity games, instead of relying to callingget_class()
,get_field()
,get_parent()
orget_static_table()
separatedly, simplifying the writing of autosplitters.It is needed to specify the depth when creating a new instance. For example,
Pointer<2>
will dereference the path up to the 2nd offset.The
try_find()
function is safe to leave in the main update loop, as it will immediately return if a pointer path has been found already. This serves as a workaround to solve issues with some Mono classes not getting instantiated when the game starts, which might block the execution of the autosplitter.Example: