Use the security sector's disk size when calculating the size of the data partition - #2
Open
InvoxiPlayGames wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This restricts the number of sectors used for the data partition to what the MS security sector says.
This matches the behaviour of the official, unpatched OS. There is a problem here, though...
If a drive has a legitimate security sector, and the drive's true ending LBA is greater than what is specified, (e.g. a larger SSD that has been flashed with a fake model/serial, and a real drive's secruity sector written to it), then pre-September 2026 xebuild patches (patched in J-Runner with Extras V3.4.0 r6) and libxtaf (before this PR) will see a completely different FAT from the drive compared to retail consoles, or newer hacked NAND images.
We're going to assume that, since if a security sector exists you want to use the drive on a retail console, that we should read the partition as if it is a retail console and use the same XTAF extents. There are no good solutions here, but I think using the retail OS behaviour is the most well-intentioned solution.
Testing is sorely needed to make sure that files are being read from the "correct" view of the XTAF filesystem so we aren't reading a possibly garbage FAT.
Expected behaviour: