Project

General

Profile

Actions

Emulator Issues #12019

closed

Improper handling of null bytes in encrypted setting.txt data

Added by Leseratte10 about 4 years ago. Updated about 4 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
5.0-11934

Description

Game Name?

Any game that tries to read stuff from the setting.txt

What's the problem? Describe what went wrong.

Take a look at the file Source/Core/Common/SettingsHandler.cpp, at the function SettingsHandler::Decrypt.

str is a pointer to the encrypted data, and the data uses a XOR shuffle with a rotating key.
Right at the beginning of the function is the while condition *str != 0 - which is true at the end of the file, but it's also true when there is a NULL byte in the middle of the encrypted data, which can happen - then, the decryption stops in the middle of the file and the decrypted data is incomplete.

See my comment on pull request 8673 for more information: https://github.com/dolphin-emu/dolphin/pull/8673#issuecomment-601696961

What steps will reproduce the problem?

Find a setting.txt that contains a nullbyte, decrypt using this function, notice that the decryption is wrong.
If necessary, I can provide such a file

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

Yes, 5.0-11788

Is the issue present in the latest stable version?

Probably, but I can't test that since 5.0-stable doesn't work properly for me.

Actions

Also available in: Atom PDF