-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add start module handler #70
Comments
It might be a good idea to capture both start and stop of a module, so that we can easily hook/release specific patches. |
Realistically I won't have the time to implement (& test) this feature. |
If you describe how you imagine the implementation of this feature, I can do it. |
I'm not sure what you want though. A callback before and after module_stop/module_stop? |
Exactly |
Isn't it possible to just hook the |
The idea is that we invoke our callback at If you still can't imagine what I'm meaning, there exists the same API for PSP CFW: |
I see. Can we generalize it and not worry about module_start/stop? So we currently have hooks and injections. How about we add a third category called "events" and we can have Then we have typedef enum _tai_event {
TAI_EVENT_MODULE_LOAD,
TAI_EVENT_MODULE_START,
TAI_EVENT_MODULE_STOP,
TAI_EVENT_MODULE_UNLOAD,
TAI_EVENT_MAX
} tai_event_t;
typedef struct _tai_event_module_start {
tai_event_t event;
SceUID modid;
// other useful params
SceSize args; // from module_start
void *argp; // from module_start
} tai_event_module_start_t;
typedef struct _tai_event_module_stop {
tai_event_t event;
SceUID modid;
// other useful params
SceSize args; // from module_stop
void *argp; // from module_stop
} tai_event_module_stop_t;
// and so on...
typedef union _tai_event_args {
tai_event_t event;
tai_event_module_load_t module_load_event;
tai_event_module_start_t module_start_event;
tai_event_module_stop_t module_stop_event;
tai_event_module_unload_t module_unload_event;
} tai_event_args_t;
typedef void (*tai_event_callback_t)(tai_event_args_t *args); Implementation wise, I think we can have a hashmap of PID to event handler mappings. Each value will point to a static array of size To trigger an event, we just look up the PID in O(1), and then index in the array in O(1) and then call each O(N) handlers. You can use the same callback function to handle multiple events. |
Provide kernel and user export for registering handlers that capture the moment a module is started.
Here is an example of how this can be done: TheOfficialFloW@f864363
(This however does not capture kernel module loads yet)
The text was updated successfully, but these errors were encountered: