Fix some rare edge cases in IPS patching#98
Open
pR0Ps wants to merge 2 commits intomarcrobledo:masterfrom
Open
Fix some rare edge cases in IPS patching#98pR0Ps wants to merge 2 commits intomarcrobledo:masterfrom
pR0Ps wants to merge 2 commits intomarcrobledo:masterfrom
Conversation
This would cause issues because the "EOF" in the patch would get interpreted as the end of the file, not as valid address.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IPS patches end with the bytes
EOF. In cases where an IPS patch defines a record with the offset of0x454F46(EOFin 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
0x454F46it'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.