Add support for large-address aware applications #21
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.
Large-address aware applications linked with the
/LARGEADDRESSAWARE
flag can have a user-mode address with its upper bit set. The current code sign-extends the pointer, e.g.87aaeb58
toffffffff87aaeb58
, leading to an invalid pointer and likely to a crash.I discovered this due to a bug report for Windhawk:
ramensoftware/windhawk#3
I came up with a small program which triggers the bug most of the time:
https://gist.github.com/m417z/7177d820252ab42f4d86c905589b6f05
Also, a similar notice regarding 32-bit to 64-bit pointer casting can be found here: