Skip to content

Instantly share code, notes, and snippets.

@0xTowel
Created November 13, 2017 20:48
Show Gist options
  • Save 0xTowel/5c6ff800760dd78e1e104594ad83e0b0 to your computer and use it in GitHub Desktop.
Save 0xTowel/5c6ff800760dd78e1e104594ad83e0b0 to your computer and use it in GitHub Desktop.
Simple program that prints the stack pointer. Useful for manual ASLR checking.
/* 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