obhq / obliteration

Experimental PS4 emulator written in Rust for Windows, macOS and Linux
https://obliteration.net
MIT License
586 stars 17 forks source link

Uses process credential on main thread #805

Closed ultimaweapon closed 3 months ago

ultimaweapon commented 3 months ago

This should be a correct one. I don't think the PS4 will allow the application main thread to use SceSysCore credential because it is a privileged one. We can find the correct answer without guessing in the function that do thread switching but the problem is I don't know where it is.

SuchAFuriousDeath commented 3 months ago

Now we instantly fail on syscall 147 :(

ultimaweapon commented 3 months ago

Now we instantly fail on syscall 147 :(

The good news about this is it is a correct path for the games.

SuchAFuriousDeath commented 3 months ago

image

ultimaweapon commented 3 months ago

image

Strange. Why you got int44. For me it is end up in sys_write.

SuchAFuriousDeath commented 3 months ago

And what happens after you implement it? Or rather, after you fake it and just return the len right away?

SuchAFuriousDeath commented 3 months ago

"Scepthread: Fatal error 'Can't set session id to 2 (errno = 1)'" is what it's trying to write for me btw

SuchAFuriousDeath commented 3 months ago

image

Strange. Why you got int44. For me it is end up in sys_write.

Sorry, I myself didn't realize that I had sys_write stubbed. I merged main into my WIP branch. By the way, we should be thinking about sys_mmap_dmem, that seems to be the main obstacle that's ahead of us. Mikusp said he already has some ideas.

ultimaweapon commented 3 months ago

I'll let you guys handle that. What I'm currently focus on is moving the application to run inside a VM.

SuchAFuriousDeath commented 3 months ago

Where do we even begin? 👀

ultimaweapon commented 3 months ago

Wait, you said @mikusp already have some ideas.

SuchAFuriousDeath commented 3 months ago

He has some ideas for dmem, but not for the privilege issue, that's what I was talking about.

ultimaweapon commented 3 months ago

image

Strange. Why you got int44. For me it is end up in sys_write.

You mean you got int44 after this?

SuchAFuriousDeath commented 3 months ago

yup

SuchAFuriousDeath commented 3 months ago

I guess I didn't actually say that 😅 Yeah, I get it right after. And from the description, it seems that it's the sys_setid. However, that means that is_system has to be true, doesn't it? 🤔

ultimaweapon commented 3 months ago

However, that means that is_system has to be true, doesn't it?

It should not. I'm confused why it raise int44. It seems like the PS4 expect the process to be a system process somehow.