Open yifanlu opened 7 years ago
Maybe that's a crazy question but when you say "shared modules" you mean shared between what and what ? Also does this limit also applies to taiHookModuleExportForKernel() ? Thanks for the clarification.
Between processes. Like SceLibKernel is used in every process.
Currently, hooking an export from a shared module returns TAI_ERROR_NOT_FOUND
which is not explicit enough in my opinion. I suggest that a special error code be added, for instance TAI_ERROR_SHARED_MODULE
, with a comment linking to this issue.
No that's another issue. You can hook shared modules but it might crash another app.
I see. Unfortunately I don't have the code to reproduce this anymore.
It would be great if it failed and returned an error, rather than returning a valid hook and then crashing other apps.
Yeah see if I could easily detect when it's a shared module then I would just hook it differently and resolve this ticket...
Right now you cannot hook anything in the >=
0xE0000000
region because the pages mapped there are shared between processes. It increases the complexity as we would have to map the trampoline pages to all processes that use a specific module. Right now, I believe that most plugins would not need to hook any shared modules (they can make do with hooking imports from the main module). If we want to support this going forward, it would make sense to hook modulemgr to always allocate 1-2 additional pages at the end of the.text
segment for any shared module. That would serve as the trampoline for the hooks as well as metadata for hooks.