Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/libs/prx/libSceSysmodule/ModuleTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ inline const std::unordered_map<std::uint32_t, const char*> kModuleTable = {
{0x0000011a, "libSceNpPartner001"},
{0x00000120, "libSceAudioPropagation"},
{0x0000012f, "libSceFontGs"},
{0x00000132, "libSceProprietaryVoiceChatHelperPrx"},
{0x00000135, "libSceFontGsm"},
{0x00000137, "libScePsml"},
{0x00000138, "libSceNpPartnerSubscription"},
Expand Down
8 changes: 8 additions & 0 deletions core/libs/tests/GuestSysmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ constexpr std::uint32_t kInternalFlag = 0x80000000u;
constexpr std::uint16_t kAcmModuleId = 0x010b;
constexpr std::uint16_t kTrophy2ModuleId = 0x0110;
constexpr std::uint16_t kVoiceChatModuleId = 0x0114;
constexpr std::uint16_t kProprietaryVoiceChatHelperModuleId = 0x0132;
constexpr std::uint16_t kPsmlModuleId = 0x0137;
constexpr std::uint32_t kAgcModuleId = 0x80000094;

Expand Down Expand Up @@ -264,6 +265,13 @@ int main() {
Require(sceSysmoduleUnloadModule(kPsmlModuleId) == 0);
Require(sceSysmoduleIsLoaded(kPsmlModuleId) == kModuleUnloaded);

Require(sceSysmoduleIsLoaded(kProprietaryVoiceChatHelperModuleId) == kModuleUnloaded);
Require(sceSysmoduleUnloadModule(kProprietaryVoiceChatHelperModuleId) == kModuleUnloaded);
Require(sceSysmoduleLoadModule(kProprietaryVoiceChatHelperModuleId) == 0);
Require(sceSysmoduleIsLoaded(kProprietaryVoiceChatHelperModuleId) == 0);
Require(sceSysmoduleUnloadModule(kProprietaryVoiceChatHelperModuleId) == 0);
Require(sceSysmoduleIsLoaded(kProprietaryVoiceChatHelperModuleId) == kModuleUnloaded);

Require(sceSysmoduleUnloadModuleInternal(kAgcModuleId) == kModuleUnloaded);
Require(sceSysmoduleLoadModuleInternal(kAgcModuleId) == 0);
Require(sceSysmoduleLoadModuleInternal(kAgcModuleId) == 0);
Expand Down
4 changes: 4 additions & 0 deletions docs/dev/debt/libSceSysmodule.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- [sceSysmoduleIsLoaded, sceSysmoduleLoadModule, sceSysmoduleUnloadModule](../../../core/libs/prx/libSceSysmodule/Export.cpp) (libSceSysmodule) accept a module id missing from the module table: they log it and return 0 without loading anything, so `sceSysmoduleIsLoaded` reports an unknown module as loaded and unloading it succeeds, because titles that load or unload such an id aborted otherwise. The internal variants (`sceSysmoduleLoadModuleInternal`, `sceSysmoduleUnloadModuleInternal`, `sceSysmoduleLoadModuleInternalWithArg`, `sceSysmoduleGetModuleHandleInternal`) throw for an unknown id. What the console returns for an id it does not know is not verified.

### Unknown function info

- [kModuleTable](../../../core/libs/prx/libSceSysmodule/ModuleTable.hpp) (libSceSysmodule) - module id 0x00000132 is named `libSceProprietaryVoiceChatHelperPrx`, the name of the built module, because `sceSysmoduleGetModuleHandleInternal` opens `libs/<table name>.prx`. The name the console's table uses for this id is not verified

### Functional

- [sceSysmoduleGetModuleInfoForUnwind](../../../core/libs/prx/libSceSysmodule/Export.cpp) (libSceSysmodule) - on Windows the region and file name of an address inside a loaded image are cached after the first lookup, because `VirtualQuery` on a large image section is slow. An entry is used only while the loader still reports the same image for the address (same base, time stamp and size). A page protection change inside the image after the first lookup, which would split or merge the region `VirtualQuery` reports, is not noticed. Addresses outside loaded images are queried every time
Loading