From 4a80f918fe6e2c983ea079bcabf1548cc05a5346 Mon Sep 17 00:00:00 2001 From: DH Date: Sat, 11 Nov 2023 20:53:49 +0300 Subject: [PATCH] [orbis-kernel] stub sys_get_self_auth_info --- orbis-kernel/include/orbis/sys/sysproto.hpp | 6 +++-- orbis-kernel/src/sys/sys_sce.cpp | 29 +++++++++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/orbis-kernel/include/orbis/sys/sysproto.hpp b/orbis-kernel/include/orbis/sys/sysproto.hpp index 09e7c90bb..2afe9c964 100644 --- a/orbis-kernel/include/orbis/sys/sysproto.hpp +++ b/orbis-kernel/include/orbis/sys/sysproto.hpp @@ -706,7 +706,8 @@ SysResult sys_rdup(Thread *thread, sint a, sint b); SysResult sys_dl_get_metadata(Thread *thread /* TODO */); SysResult sys_workaround8849(Thread *thread /* TODO */); SysResult sys_is_development_mode(Thread *thread /* TODO */); -SysResult sys_get_self_auth_info(Thread *thread /* TODO */); +SysResult sys_get_self_auth_info(Thread *thread, ptr path, + ptr result); SysResult sys_dynlib_get_info_ex(Thread *thread, SceKernelModule handle, ptr unk, ptr destModuleInfoEx); @@ -729,7 +730,8 @@ SysResult sys_get_gpo(Thread *thread /* TODO */); SysResult sys_get_vm_map_timestamp(Thread *thread /* TODO */); SysResult sys_opmc_set_hw(Thread *thread /* TODO */); SysResult sys_opmc_get_hw(Thread *thread /* TODO */); -SysResult sys_get_cpu_usage_all(Thread *thread, uint32_t unk, ptr result); +SysResult sys_get_cpu_usage_all(Thread *thread, uint32_t unk, + ptr result); SysResult sys_mmap_dmem(Thread *thread, caddr_t addr, size_t len, sint memoryType, sint prot, sint flags, off_t directMemoryStart); diff --git a/orbis-kernel/src/sys/sys_sce.cpp b/orbis-kernel/src/sys/sys_sce.cpp index 65ba47ccd..fde1fdf0c 100644 --- a/orbis-kernel/src/sys/sys_sce.cpp +++ b/orbis-kernel/src/sys/sys_sce.cpp @@ -927,8 +927,33 @@ orbis::SysResult orbis::sys_workaround8849(Thread *thread /* TODO */) { orbis::SysResult orbis::sys_is_development_mode(Thread *thread /* TODO */) { return ErrorCode::NOSYS; } -orbis::SysResult orbis::sys_get_self_auth_info(Thread *thread /* TODO */) { - return ErrorCode::NOSYS; +orbis::SysResult orbis::sys_get_self_auth_info(Thread *thread, + ptr path, + ptr result) { + ORBIS_LOG_ERROR(__FUNCTION__, path, result); + thread->where(); + + return uwrite( + result, { + .unk0 = 0x3100000000000001, + .caps = + { + ~0ull, ~0ull, ~0ull, ~0ull, + // 0x2000038000000000, + // 0x000000000000FF00, + // 0x0000000000000000, + // 0x0000000000000000, + }, + .attrs = + { + 0x4000400040000000, + 0x4000000000000000, + 0x0080000000000004, // lower byte is application type + 0xF0000000FFFF4000, + }, + }); + + return {}; } orbis::SysResult orbis::sys_dynlib_get_info_ex(Thread *thread, SceKernelModule handle,