-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Boot: Do a better job of preserving certain parts of settings.txt #8673
Conversation
126cf35
to
53bc508
Compare
I just ran a script through the Wiimmfi database to grab all the existing serial number prefixes that ever connected to Wiimmfi, and it looks like the letters R and S can also exist as second char in the serial number. R is Argentina (NTSC-U). I don't know what country S is. From the logs it looks a lot like NTSC-U, but I'm not 100% sure. |
53bc508
to
c4dff25
Compare
I've added those two as NTSC-U. |
…gion This is a part of fixing https://bugs.dolphin-emu.org/issues/11930.
It doesn't necessarily start with RVL-001.
c4dff25
to
3614e9f
Compare
For curiosity's sake, I checked the setting.txt file of my Middle Eastern Wii, and it has the following: AREA=USA So the text in parentheses in MODEL isn't necessarily the same as AREA. Interesting... |
Yeah, it looks like "UAE" wouldn't be a valid value for AREA. Or the tool I'm using doesn't know that UAE would be valid. The "SettingEdit" I used to look at the settings.txt file only has JPN, USA, EUR, AUS, BRA, TWN, ROC, KOR, HKG, ASI, LTN and SAF in the dropdown for AREA. The "Model" value is a free text field. Maybe Nintendo decided on the UAE model region after they've already finalized the list of valid / possible AREAs? Although it could just be that UAE is missing from the tool by accident, but then why would an UAE wii not have UAE as AREA ... |
I just tested this PR, but there is still a bug somewhere. After importing the NAND backup, the settings are looking correct. Printing "decoded" to the console results in an output like this (assume my real serial number being LEH123456789):
Then, when I quit the game and start it again, it prints this instead:
Then, in any subsequent runs, it prints this:
So the last part of the serial number, and the VIDEO and GAME entries, are just gone. Is it running into a size limit somewhere? Some part of Dolphin seems to corrupt the setting.txt again, and I haven't (yet?) been able to figure out where that happens. Do you have any idea? |
@JosJuice Okay, either I am reading this piece of code wrong (I don't think that's the case), or there is a fairly stupid bug in the Take a look at this code block that does the decryption:
Am I understanding this correctly that "str" is a pointer to the encoded / obfuscated data? This means that "str" is pointing to binary data, not to a string. When I replace the That would mean that currently, while decrypting a setting.txt, there is a 1/256 chance for each byte in the file, that the decryption just randomly stops because the encrypted value is a 0. That wouldn't just break the Wiimmfi console identification, but would break everything that relies on reading correct console data from the setting.txt and should (in my opinion) be fixed ASAP. I'll open a new bug report for that because that doesn't really have anything to do with this PR. Please wait with merging this PR until this bug is fixed. |
I just opened issue 12019 for this decryption bug. |
This is a part of fixing https://bugs.dolphin-emu.org/issues/11930.
PR #8672 should be merged before this one, otherwise Wiimmfi users may run into a situation where a 7-day wait isn't necessary at first but becomes necessary later after playing a game from a different region, which I think would be rather confusing for them.
EDIT: By request from @Leseratte10 (see comments below), do not merge this PR before PR #8680.