Skip to content
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

report 0x0xADDR as invalid #388

Merged

Conversation

Jamiras
Copy link
Member

@Jamiras Jamiras commented Dec 6, 2024

There are currently 21 achievement sets with rich presence containing memory reads in the form 0x0xADDR.

This currently "works" because the leading 0x is discarded

if (aux[0] == '0') {
if (aux[1] != 'x' && aux[1] != 'X')
return RC_INVALID_MEMORY_OPERAND;
aux += 2;

Then it does a hex parse of the remaining string

value = strtoul(aux, &end, 16);

which detects and ignores the second 0x.

While this doesn't generate an error in the existing runtime, it does cause issues with some external parsers, and should be reported as an error. This PR causes it to be reported as an error.

The rich presence scripts for the following games should be updated to prevent the error from being reported after this code is published.

> select ID from GameData where RichPresencePatch like '%0x0x%';
+-------+
| ID    |
+-------+
|  1234 |
|  1572 |
|  2689 |
|  2739 |
|  2831 |
|  3217 |
|  5323 |
|  5376 |
|  6762 |
|  9088 |
|  9966 |
| 10173 |
| 10481 |
| 13049 |
| 13431 |
| 14117 |
| 16276 |
| 20812 |
| 26986 |
| 28593 |
| 28618 |
+-------+

There are no occurrences of the pattern in existing achievement or leaderboard definitions.

Also now reporting an error when RP conditionals don't full parse: https://discord.com/channels/310192285306454017/1314383114960633918/1314760614803017778

@Jamiras Jamiras added this to the 11.7.0 milestone Dec 6, 2024
@Jamiras Jamiras merged commit 93eca32 into RetroAchievements:develop Dec 21, 2024
7 checks passed
@Jamiras Jamiras deleted the bugfix/memref_double_prefix branch December 21, 2024 14:41
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