Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loader/cellGame: Do not crash on invalid PSF files #10041

Merged
merged 2 commits into from Apr 9, 2021

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Mar 30, 2021

Previously it crashed the whole emulator if you renamed any random file to PARAM.SFO and place it inside the game/ELF directory.
Now even with hex editor modifying any bit from a valid PARAM.SFO you won't succeed in crashing the emulator. Includes checks from #9998 as well.
Reminder that games technically have permission to (over)write PARAM.SFO files bitwise in /dev_hdd0 game data directories for example so this is a fix for emulation as well. I have used this "feature" in hw tests in the past. cellGame already supports the appropriate error codes for invalid PARAM.SFO.

@elad335 elad335 changed the title PSF: Do not crash on invalid PSF files Loader/cellGame: Do not crash on invalid PSF files Mar 30, 2021
rpcs3/Loader/PSF.cpp Outdated Show resolved Hide resolved
@Nekotekina
Copy link
Member

Looks like you could keep load_object as an alias of load, but with old interface, and keep save_object naming as is.

rpcs3/Loader/PSF.cpp Outdated Show resolved Hide resolved
@elad335 elad335 force-pushed the psf branch 3 times, most recently from 9f90355 to 4b47a84 Compare April 3, 2021 15:05
@Nekotekina
Copy link
Member

I meant, you could leave psf::load_object to return only psf::registry unconditionally and crash inside if it's loaded with error, this way a bunch of changes in various files may become unnecessary.

@elad335 elad335 force-pushed the psf branch 2 times, most recently from e7a4529 to 0f97fe6 Compare April 9, 2021 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants