mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 17:49:29 +01:00
HLE: 6.60 kernel NIDs for module loading, memset and strnlen
The firmware's POPS manager imports these by their 6.60 NIDs: sceKernelLoadModuleForKernel and sceKernelStartModule from ModuleMgrForKernel, SysMem's sceKernelMemset and sceKernelGetUIDcontrolBlock, Sysclib's strnlen, and sceKernelExtendKernelStack, which runs the callback like sceKernelExtendThreadStack does. sceKernelGetUIDcontrolBlock reports no such UID: the manager uses it to make a descriptor it opened in kernel mode usable from user mode, and ours aren't access-checked.
This commit is contained in:
1 parent
47c97b92aa
commit
e9515d0f8a
4 files changed
+34
-1
No files matched your search
@@ -844,6 +844,14 @@ static u32 sysclib_strlen(u32 src) {
|
||||
}
|
||||
}
|
||||
|
||||
static u32 sysclib_strnlen(u32 src, u32 maxLen) {
|
||||
u32 len = 0;
|
||||
while (len < maxLen && Memory::IsValidAddress(src + len) && Memory::ReadUnchecked_U8(src + len) != 0) {
|
||||
len++;
|
||||
}
|
||||
return hleLogVerbose(Log::sceKernel, len);
|
||||
}
|
||||
|
||||
static int sysclib_memcmp(u32 dst, u32 src, u32 size) {
|
||||
if (Memory::IsValidRange(dst, size) && Memory::IsValidRange(src, size)) {
|
||||
const int retval = memcmp(Memory::GetCharPointerUnchecked(dst), Memory::GetCharPointerUnchecked(src), size);
|
||||
@@ -1015,6 +1023,7 @@ const HLEFunction SysclibForKernel[] =
|
||||
{0x4C0E0274, &WrapU_UI<sysclib_strrchr>, "strrchr", 'x', "xx", HLE_KERNEL_SYSCALL },
|
||||
{0xCE2F7487, &WrapU_U<sysclib_toupper>, "toupper", 'x', "x", HLE_KERNEL_SYSCALL },
|
||||
{0XC2145E80, &WrapI_UIU<sysclib_snprintf>, "snprintf", 'i', "xx", HLE_KERNEL_SYSCALL },
|
||||
{0x90C5573D, &WrapU_UU<sysclib_strnlen>, "strnlen", 'x', "xx", HLE_KERNEL_SYSCALL },
|
||||
};
|
||||
|
||||
void Register_Kernel_Library()
|
||||
|
||||
Reference in new issue
Block a user