Skip to content

Fix some rare edge cases in IPS patching#98

Open
pR0Ps wants to merge 2 commits intomarcrobledo:masterfrom
pR0Ps:bugfix/ips-eof
Open

Fix some rare edge cases in IPS patching#98
pR0Ps wants to merge 2 commits intomarcrobledo:masterfrom
pR0Ps:bugfix/ips-eof

Conversation

@pR0Ps
Copy link

@pR0Ps pR0Ps commented Mar 5, 2026

IPS patches end with the bytes EOF. In cases where an IPS patch defines a record with the offset of 0x454F46 (EOF in ascii), this offset would be misread as the end-of-file marker and the rest of the file would be ignored.

This PR fixes this by updating the IPS patch parsing logic to peek forward at the rest of the file to determine if the 0x454F46 it's seeing is actually the end-of-file marker or is just an address. A test was also added to verify the behavior is correct.

Also, since the issue only appeared when exporting and importing the patch file, I updated the existing tests to roundtrip the patch data through their respective binary formats as well.

pR0Ps added 2 commits March 5, 2026 01:28
This would cause issues because the "EOF" in the patch would get
interpreted as the end of the file, not as valid address.
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