From 00cdecc530060219e09650cabc066d78d6d92c11 Mon Sep 17 00:00:00 2001 From: Reiko Asakura Date: Sat, 23 May 2020 12:33:10 -0400 Subject: kernel fast mutex: add and fix all related 1. Renamed sceKernelDeleteFastMutex to sceKernelFinalizeFastMutex. This matches the name found in 0.940 prototype firmware and the NID has not changed since then. 2. Unlike lightweight mutex, the work area is not required to be 8 byte aligned, but I have done so anyway. 3. The work area's size is 0x40, but only 0x28 is used. However it is not safe to use a smaller work area because sceKernelFinalizeFastMutex memsets 0x40 bytes to 0. 4. The last field of the work area, 4 bytes long at offset 0x24, contains the dummy value 0xA35DB473 when the fast mutex is initialised. Functions in SceKernelThreadmgr related to fast mutex will check this value and this allows us to find all functions related to fast mutex. --- nids/360/SceKernelThreadMgr.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nids/360/SceKernelThreadMgr.yml') diff --git a/nids/360/SceKernelThreadMgr.yml b/nids/360/SceKernelThreadMgr.yml index f5d4381..e33c75a 100644 --- a/nids/360/SceKernelThreadMgr.yml +++ b/nids/360/SceKernelThreadMgr.yml @@ -209,7 +209,6 @@ modules: sceKernelDeleteCallback: 0x3A7E17F6 sceKernelDeleteCond: 0xAEE0D27C sceKernelDeleteEventFlag: 0x71ECB352 - sceKernelDeleteFastMutex: 0x11FE84A1 sceKernelDeleteMsgPipe: 0xB3453F88 sceKernelDeleteMutex: 0x0A912340 sceKernelDeleteSema: 0x16A35E58 @@ -217,7 +216,10 @@ modules: sceKernelEnqueueWorkQueue: 0xE50E1185 sceKernelExitDeleteThread: 0x1D17DECF sceKernelExitThread: 0x0C8A38E1 + sceKernelFinalizeFastMutex: 0x11FE84A1 sceKernelGetCallbackCount: 0x0892D8DF + sceKernelGetFastMutexInfo: 0xD7AF2E58 + sceKernelGetFastMutexInfoById: 0xAF302193 sceKernelGetMutexInfo: 0x69B78A12 sceKernelGetProcessId: 0x9DCB4B7A sceKernelGetProcessIdFromTLS: 0xFA54D49A @@ -261,6 +263,7 @@ modules: sceKernelStartThread: 0x21F5419B sceKernelStartTimer: 0x84C4CE4D sceKernelStopTimer: 0x474F214B + sceKernelTryLockFastMutex: 0x741F4707 sceKernelTryLockMutex: 0x270993A6 sceKernelTryLockReadRWLock: 0xFC2B5A50 sceKernelTryLockWriteRWLock: 0xA96F2E5A -- cgit v1.2.3