sceIoClose
A kernel module and test app to demonstrate a potential taiHEN issue when trying to hook sceIoClose().
Compilation
cd module
make
cd ../test
make
Then copy logger.skprx
from the module/
directory to ux0:tai/ and install the io_logger.vpk
app from test.
Note: You do not need to load the skprx
in tai/config.txt
since the test application takes care of loading
and unloading the kernel module (which of course you want, since overriding sceIoClose() seems to crash the kernel).
Testing
- Run the io_logger app. You should observe a crash.
- If you look at
ux0:data/io.log
, which is generated by the kernel module, you will see logging up to the section of the code that callsTAI_CONTINUE(int, close_ref, fd, args);
inhook_user_close()
, which seems to indicate that the issue is in taiHEN. - If you comment out the
close_id = taiHookFunctionExportForKernel(...)
line inmodule_start()
, and run the test everything is fine, confirming that the issue is puerly with tryuing to overridesceIoClose()
.
Things I tried
- Removing logging altogether, in case the problem had to do with calling
ksceIoClose()
→ Still crashes! - Overriding
sceIoCloseForDriver()
insteadsceIoClose()
→ This doesn't crash but of course the override I need issceIoClose()
. This does seem to confirm that the problem appears to be only withsceIoClose()
override however. - Using the actual
SceIofilemgr
NID (0xF2FF276E
) instead ofTAI_ANY_LIBRARY
→ Same issue. - Updating VitaSDK to latest → Still crashes!
- Not calling
sceIoClose()
in the test app, but waiting to unload the module → Still crashes as soon as a background app calls sceIoClose(). - Adding
void *args
as extra parameters tosceIoClose()
andTAI_CONTINUE()
just in case → Same issue. - Using
SceUID
as return value instead of int → Same issue.