-
Notifications
You must be signed in to change notification settings - Fork 720
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
[FFMQ] Fix all checks sending on hard reset + stronger read validation check #4242
Conversation
Co-authored-by: Exempt-Medic <[email protected]>
Co-authored-by: Exempt-Medic <[email protected]>
I want to merge this but I'm not 100% sure how to validate that this |
The rando adds a function called at boot up that write 1 state byte (0 outside gameplay loop, 1 inside gameplay loop), then 5 bytes for "FFMQR" |
@@ -47,6 +47,17 @@ def get_flag(data, flag): | |||
bit = int(0x80 / (2 ** (flag % 8))) | |||
return (data[byte] & bit) > 0 | |||
|
|||
def validate_read_state(data1, data2): | |||
validation_array = bytes([0x01, 0x46, 0x46, 0x4D, 0x51, 0x52]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validation_array = bytes([0x01, 0x46, 0x46, 0x4D, 0x51, 0x52]) | |
validation_array = b"\x01FFMQR" |
another way this could be written (not saying one should be preferred over the other)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>>> a = bytes([0x01, 0x46, 0x46, 0x4D, 0x51, 0x52])
>>> b = b"\x01FFMQR"
>>> a == b
True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to know, i'll keep that in mind for next time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good enough for me
What is this fixing or adding?
SNIClient's task will die sometime (like on hard resets) and FFMQ's client will pass the validation check when it's not supposed to on some emulator. This fix the issue by checking None type and adding a stronger validation check.
How was this tested?
Test was done on a known seed that would reliably trigger the behaviour on hard reset.