Skip to content
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

Implement hooking of shared modules #6

Open
yifanlu opened this issue Nov 6, 2016 · 6 comments
Open

Implement hooking of shared modules #6

yifanlu opened this issue Nov 6, 2016 · 6 comments

Comments

@yifanlu
Copy link
Owner

yifanlu commented Nov 6, 2016

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.

@CelesteBlue-dev
Copy link

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.

@yifanlu
Copy link
Owner Author

yifanlu commented Jul 30, 2017

Between processes. Like SceLibKernel is used in every process.

@devnoname120
Copy link

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.

@yifanlu
Copy link
Owner Author

yifanlu commented Sep 27, 2017

No that's another issue. You can hook shared modules but it might crash another app.

@devnoname120
Copy link

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.

@yifanlu
Copy link
Owner Author

yifanlu commented Sep 27, 2017

Yeah see if I could easily detect when it's a shared module then I would just hook it differently and resolve this ticket...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants