Skip to content

Implement sceSysmoduleLoadModuleByNameInternal - #4830

Draft
kalaposfos13 wants to merge 10 commits into
shadps4-emu:mainfrom
kalaposfos13:load-module-internal
Draft

Implement sceSysmoduleLoadModuleByNameInternal#4830
kalaposfos13 wants to merge 10 commits into
shadps4-emu:mainfrom
kalaposfos13:load-module-internal

Conversation

@kalaposfos13

Copy link
Copy Markdown
Member

Force-LLEing stuff from sys_modules/title_id/ is already a thing, and this PR makes that possible for apps that use the internal function sceSysmoduleLoadModuleByNameInternal to load modules instead of the standard API for games, such as VSH. This by itself is not enough to satisfy module loading logic for that though, at least not in a clean way, as some modules ideally should be skipped without reporting an error, so it can both proceed, while at the same time we don't have to deal with having to emulate even more stuff for misc libraries.

I only tagged Stephen in one commit, but his contributions were more encompassing than just that one addition.

@StevenMiller123 StevenMiller123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good to me, just some minor nits.

Comment thread src/core/libraries/kernel/file_system.cpp
Comment thread src/core/libraries/sysmodule/sysmodule.cpp Outdated

@StevenMiller123 StevenMiller123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some more thoughts on this now that the blocking PR (my fixes for Media Player) are now merged.

std::string filename = std::string(name) + ".sprx";
s32 exists;
using namespace Kernel;
std::string system_base = std::string("/") + sceKernelGetFsSandboxRandomWord();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally think we should tie this into some allow/block list instead of relying on users making game-specific module folders for things calling this (even if it's only called by firmware stuff).
Maybe try to have this use the same array of allowed modules that's currently placed in the loadModule code, with a bypass for modules present in game-specific module folders?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine by me, do you have a list of safely LLEable modules loaded through this function perchance?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Been too long since I glanced at VSH, I forget what all it tries loading through this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants