sec-pentesting-toolkit/Memory_Exploits/C-codes/get_stack_pointer.c
2015-02-12 13:50:03 -08:00

8 lines
175 B
C

/* Get stack pointer of the system(Unix/Linux) */
#iclude <stdio.h>
unsigned long get_sp(void) {
__asm__("movl %esp,%eax");
}
void main() {
printf("0x%x\n", get_sp());
}