Repository navigation
Call a dump encrypted with the original key encrypted - #2
Merged
Merged
Conversation
…ExeFS has no .code Crypto method 0 without NoCrypto is the original key, the one most games are encrypted with, so such a dump got through the check and failed later with "the ExeFS has no .code". It can also be a dump decrypted with its flags left as they were, which reads fine, so it still isn't turned away up front: only the message for a missing .code now says the dump is encrypted when NoCrypto is clear.
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.
A dump encrypted with the original key (crypto method
flags[3] == 0, NoCrypto clear) passes the encryption check inTitle::load. Most retail games are encrypted this way. Such a dump then fails withthe ExeFS has no .code, which doesn't tell the user what's wrong. We hit this in smt4-recomp (Invictus-potens/smt4-recomp#15).The check treated
flags[3] == 0as "never encrypted". A title that was never encrypted has NoCrypto set, though. Method 0 without NoCrypto is the original key, or a dump that was decrypted but kept its old flags.Change: nothing new is turned away, because the second case reads fine and still has to load. Only the error for a missing
.codechanges: when NoCrypto is clear, it saysthe dump is encrypted, it has to be decrypted first (the ExeFS has no .code). The early check for the 7.x/9.x methods is unchanged.Test:
rom::tests::an_encrypted_dump_says_so, built on the existingrom()fixture. It checks three cases:.code: the old message.It fails without the change.
cargo test --release --all-featurespasses on Windows (x86_64-pc-windows-gnu): 63 + 1.