--citra option can't handle comments #12

Closed
opened 2026-01-29 22:29:15 +00:00 by claunia · 3 comments
Owner

Originally created by @smesgr9000 on GitHub (Feb 18, 2024).

on Version 0.2.5 on linux

$ strace ./NDecrypt d --citra ~/test.3ds

part of my aes_keys.text

generator=12345
# Some usefull comment
slot0x18KeyX=12345

according to strace the first generator line was read but than stopped on the file
if I remove the comment. The file is read as expected.

I think the following change could fix the issue, but can't test due to not having a Visual Studio setup atm.

                    while (reader.ReadNextLine())
                    {
                        if (reader.KeyValuePair == null || string.IsNullOrWhiteSpace(reader.KeyValuePair?.Key))
                            break; // replace the break with continue;```
Originally created by @smesgr9000 on GitHub (Feb 18, 2024). on Version 0.2.5 on linux ``` $ strace ./NDecrypt d --citra ~/test.3ds ``` part of my aes_keys.text ``` generator=12345 # Some usefull comment slot0x18KeyX=12345 ``` according to strace the first generator line was read but than stopped on the file if I remove the comment. The file is read as expected. I think the following change could fix the issue, but can't test due to not having a Visual Studio setup atm. ``` while (reader.ReadNextLine()) { if (reader.KeyValuePair == null || string.IsNullOrWhiteSpace(reader.KeyValuePair?.Key)) break; // replace the break with continue;```
Author
Owner

@mnadareski commented on GitHub (Feb 18, 2024):

Strictly speaking, lines with # at the start are not treated as comments in INI files. That being said, I can try to handle that case for nonstandard INIs like the one you have.

@mnadareski commented on GitHub (Feb 18, 2024): Strictly speaking, lines with `#` at the start are not treated as comments in INI files. That being said, I can try to handle that case for nonstandard INIs like the one you have.
Author
Owner

@smesgr9000 commented on GitHub (Feb 18, 2024):

thanks for looking into this. What makes you think this is an INI file? The documentation of the file is rather limited, but if you have a look at the CITA source code they clearly handle "#" stuff. See Line 221 cbe8987036/src/core/hw/aes/key.cpp (L221)

@smesgr9000 commented on GitHub (Feb 18, 2024): thanks for looking into this. What makes you think this is an INI file? The documentation of the file is rather limited, but if you have a look at the CITA source code they clearly handle "#" stuff. See Line 221 https://github.com/citra-emu/citra/blob/cbe898703631b404dfc430a60050fd8d0956a62f/src/core/hw/aes/key.cpp#L221
Author
Owner

@mnadareski commented on GitHub (Feb 18, 2024):

It's formatted as key-value pairs similar to a headless INI file. That's why I think it's an INI file internally. I understand they specifically have handling for that, but as per the spec for INI, it's not valid.

@mnadareski commented on GitHub (Feb 18, 2024): It's formatted as key-value pairs similar to a headless INI file. That's why I think it's an INI file internally. I understand they specifically have handling for that, but as per the spec for INI, it's not valid.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SabreTools/NDecrypt#12