Created
November 13, 2017 20:48
-
-
Save 0xTowel/5c6ff800760dd78e1e104594ad83e0b0 to your computer and use it in GitHub Desktop.
Simple program that prints the stack pointer. Useful for manual ASLR checking.
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
/* SeeSP: Print the value of the stack pointer. | |
* Build: gcc SeeSP.c -o SeeSP | |
* | |
* Towel - 2017 | |
*/ | |
#include <stdio.h> | |
#include <inttypes.h> | |
int main(void) | |
{ | |
register uintptr_t sp asm ("sp"); | |
printf("SP: 0x%016" PRIxPTR "\n", sp); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment