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

Disc games handling fixes, PKG SDATA Decryption, PARAM.SFO Formatter, Other System.cpp fixes #10849

Merged
merged 8 commits into from
Sep 17, 2021

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Sep 10, 2021

Known to fix PSN version of Demon's Souls after reinstalling PKG. (PKG SDATA decryption was implemented which was used here)
Also fixes White Knight Chronicles II [NPJA00104] PKG installation. After reinstallation of its PKG with this PR and settting "/dev_bdvd" to an empty directory contains an empty "PS3_DISC.SFB" file allows it to get out of "nothing" section.

Fixes:

  • Fixed Emulator::IsPathInsidePath when directory does not exist.
  • Fixed moving of truly disc games from dev_hdd0/game to dev_hdd0/disc.

Implemented:

  • Emulator::GetFakeCat() was implemented to handle special cases of disc games insode hdd0.
  • Drag-and-Drop PARAM.SFO to read its content, PARAM.SFO is used in PS3 to tell features about nearly any data type such as games, savedata, trophy data and more.
  • PKG SDATA Decryption, previosuly encrypted PKG (used by PSN Demon Souls for example) was not decrypted resulting in bugs.

image

Also, exmaple of PARAM.SFO formatter:https://user-images.githubusercontent.com/18193363/133619396-d5e9d6df-7078-4e54-8033-00396e721c21.png

Fixes #6342

@elad335
Copy link
Contributor Author

elad335 commented Sep 10, 2021

Seems to match with https://man7.org/linux/man-pages/man2/rename.2.html ENOENT description.

@elad335
Copy link
Contributor Author

elad335 commented Sep 10, 2021

Added 2 more fixes for it:

  • Fix case if executable is at a subdirectory inside /USRDIR.
  • Fix case if sfb_dir is not a subdirectory of dev_hdd0/game/ but may be a sub-sub...-directory of it.

@AniLeo
Copy link
Member

AniLeo commented Sep 11, 2021

This is a digital game but officially packaged with ISO2PKG, it thinks it's a disc game internally but shouldn't be moved outside of dev_hdd0/game. The other game that does this is Demon's Souls Digital Version.

@elad335
Copy link
Contributor Author

elad335 commented Sep 12, 2021

Upload a log.

@Megamouse
Copy link
Contributor

You're working based on super old log files.
These games don't have an sfb file, since they're not discs. RPCS3 doesn't try to move them to the disc dir anymore.

They just have the param.sfo ID of a disc game and are probably encrypted in some different way.
So moving them to dev_hdd0/disc/ does nothing.

@Megamouse
Copy link
Contributor

WKC2 log
Demon's Souls log

@elad335 elad335 force-pushed the rename-disc branch 9 times, most recently from 896af00 to c6a9704 Compare September 16, 2021 08:50
@elad335
Copy link
Contributor Author

elad335 commented Sep 16, 2021

PSN DES after PKG reinstallation with this pr.
image

@elad335 elad335 changed the title Emu: Try to fix disc game move from hdd0/game [TEST] Disc games handling fixes, PKG SDATA Decryption, Other System.cpp fixes Sep 16, 2021
@elad335 elad335 changed the title Disc games handling fixes, PKG SDATA Decryption, Other System.cpp fixes Disc games handling fixes, PKG SDATA Decryption, PARAM.SFO Formatter, Other System.cpp fixes Sep 16, 2021
@elad335 elad335 changed the title Disc games handling fixes, PKG SDATA Decryption, PARAM.SFO Formatter, Other System.cpp fixes Disc games handling fixes, PKG SDATA Decryption + Mult-threading, PARAM.SFO Formatter, Other System.cpp fixes Sep 16, 2021
@elad335 elad335 force-pushed the rename-disc branch 2 times, most recently from cec115d to 9118043 Compare September 16, 2021 11:18
@elad335 elad335 marked this pull request as draft September 16, 2021 11:37
@elad335 elad335 changed the title Disc games handling fixes, PKG SDATA Decryption + Mult-threading, PARAM.SFO Formatter, Other System.cpp fixes Disc games handling fixes, PKG SDATA Decryption, PARAM.SFO Formatter, Other System.cpp fixes Sep 16, 2021
@elad335 elad335 marked this pull request as ready for review September 16, 2021 12:12
@elad335 elad335 force-pushed the rename-disc branch 2 times, most recently from 5fedc0f to e430fc3 Compare September 16, 2021 12:26
@elad335 elad335 force-pushed the rename-disc branch 2 times, most recently from 1cbe459 to 888c3eb Compare September 16, 2021 13:00
@elad335
Copy link
Contributor Author

elad335 commented Sep 16, 2021

image
Example of PARAM.SFO formattter.

rpcs3/Crypto/unpkg.h Outdated Show resolved Hide resolved
@Megamouse Megamouse added the Loader Involving the load of PS3 file formats label Sep 16, 2021
rpcs3/Loader/PSF.cpp Outdated Show resolved Hide resolved
rpcs3/Crypto/unpkg.cpp Outdated Show resolved Hide resolved
@Megamouse
Copy link
Contributor

What happened to the wkc2 fix?

@elad335 elad335 force-pushed the rename-disc branch 2 times, most recently from 8d4a379 to 4d1f922 Compare September 17, 2021 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Loader Involving the load of PS3 file formats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Demon's Souls[NPEB01202] Run psn versions as disc and decrypt extension-less sdat files fix request
3 participants