Skip to content

Conversation

@ReverseTelnet
Copy link

@ReverseTelnet ReverseTelnet commented Dec 31, 2025

I began developing a script to do an any-to-any conversion of JSON, SHN, and MC4 cheats.

As bulk imports to test my script logic, I used the cheat files in this repository.
During development, I noticed there were many files that caused various Exceptions, almost always due to some formatting issue in the file, generally with SHN (XML).

This Pull Request fixes those files which had issues.

Issue - Ampersands

A primary issue is the use of '&' in the Cheat Text tag in SHN Files.
As a note for future Pull-Requests, may I please suggest that these are either always escaped or (better) use the word 'and' instead.


Issue - XML Junk Data (Hidden Trailing Characters)

Another common issue was XML junk data such as trailing form feed characters and STX characters (oddly enough).


Issue - Invalid XML Declaration

A third issues found was a leading question mark in the XML declaration.
Example:

?<?xml version="1.0" encoding="utf-16"?>

Issue - Invalid XML Format

A fourth issues found was XML files that contained a single line of text.
They did not contain proper formatting, indents, or carriage returns.

This made it very difficult to find other issues, as several files had multiple problems.
Once formatted correctly, it became much easier to identify if the three issues above in the same file.


Issue - Plain-Text Not Padded Before Encryption

There were multiple MC4 files that would not properly decrypt due to ValueErrors of not have padding to the 16B mark. Details on this are included with this doc-string.

A clear indication of this was that the mc4.xml file did not have cheat codes populated, only XML tags.

These files had to be fixed almost completely manually, a true labor of love more than anything.

Once the file was decrypted to SHN, I re-encrypted back to MC4 and updated both the mc4 and corresponding mc4.xml file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant