-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Injected library lifecycle management? #150
Comments
what do you mean by "library exited"? Do you mean when the library is unloaded? |
I suppose yes, though what I really mean is when the injected loader "agent" exits. I'd love to have better terminology. Imagine I use I want some way to synchronize shutdown of frida in my code with these agents being unloaded. I can't figure out what APIs to use to do that. |
Generally you can use |
I think you're talking about something quite different from what I'm talking about. You're talking about the script APIs in Frida where the javascript runtime stays loaded. I'm talking about the lower-level library injection APIs. |
What you're looking for is frida-core/lib/pipe -- we should expose this in the Rust bindings. |
Can you say more about how I'd use that if it were exposed? These pipe APIs seem to be about connecting to the injected agent. Let me know if I'm misunderstanding. As it stands, I'm not using I have a follow-up goal to figure out how to recover from a case where the injector process crashes, and still to be able to clean-up the injected state. I've avoided talking about this goal up to this point because it feels certain that it'll need more code/APIs. |
@ajwerner Do you mean something like in this python example on_uninjected ? I have been working with something similar and noticed this hasn't been implemented in Rust yet. I also wonder if there is a way I can tell Frida when to "eject" the injected lib. |
How does one detect when an injected library has exited? Looking at the implementation of the injector, it seems like upon exit, at least in theory, the code will deallocate the memory in the target that it allocated.
In practice I never see the code run even though the library does exit. Also, there's not a way as far as I can tell to wait for or detect the state of the injected library. All you're handed is an JD that seems like it can only be used with demonitor (which is not a clear concept to me).
I think I'd want some way to wait for the library to exit and be deallocated.
It's possible that this is a request for new APIs in frida-core. It seems to me that the Vala API has an uninjwcted signal, but I don't know how to use that.
The text was updated successfully, but these errors were encountered: