Last active
June 26, 2022 04:46
-
-
Save m1lkweed/3583408dad9dc7b9b50f54554f6642af to your computer and use it in GitHub Desktop.
Returns true for addresses on the stack
This file contains 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
[[gnu::noinline]] _Bool on_stack(void *addr){ | |
char stack_check[1]; | |
return (addr >= (void*)&stack_check[1]); // stack_check[1] is OoB but it produces better assembly | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment