obliteration icon indicating copy to clipboard operation
obliteration copied to clipboard

Handle sys_open with mode != 0

Open SuchAFuriousDeath opened this issue 2 years ago • 6 comments

A follow-up on #473 https://github.com/obhq/obliteration/blob/332b70cf100552aba085710870a973b5a30a62b2/src/kernel/src/fs/mod.rs#L257

SuchAFuriousDeath avatar Dec 03 '23 10:12 SuchAFuriousDeath

Normally this argument must be ignored if O_CREAT is not supplied. Need to check how PS4 handled this case.

ultimaweapon avatar Dec 03 '23 10:12 ultimaweapon

@ultimaweapon Quite a number of games crash on this unwrap, by the way. I thought I put it in this issue, but it turns out I didn't. https://github.com/obhq/obliteration/blob/b5722ffe50df3cc3028c5c500f8efa4d722e043c/src/kernel/src/fs/mod.rs#L234

The PS4 seems to treat this as a dword pointer, ignoring the upper dword. Do we do the same?

SuchAFuriousDeath avatar Dec 10 '23 16:12 SuchAFuriousDeath

The PS4 seems to treat this as a dword pointer, ignoring the upper dword. Do we do the same?

Where is this on the PS4?

ultimaweapon avatar Dec 10 '23 17:12 ultimaweapon

when sys_open passes the arg to kern_openat, the is assembly mov r9d, dword ptr[ ...]

SuchAFuriousDeath avatar Dec 10 '23 18:12 SuchAFuriousDeath

The PS4 seems to treat this as a dword pointer, ignoring the upper dword. Do we do the same?

That is not a correct place to fix this. This argument will contains a garbage if the caller did not supplied to the kernel. What we should do is checking how the PS4 use this argument in the kern_openat.

ultimaweapon avatar Dec 10 '23 18:12 ultimaweapon

I think I understand. Thanks

SuchAFuriousDeath avatar Dec 10 '23 18:12 SuchAFuriousDeath