Last active
October 23, 2021 13:19
-
-
Save metametaclass/12543c58b0f33ec910381810977eb6ad to your computer and use it in GitHub Desktop.
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
#include <stdio.h> | |
int main(){ | |
int x[1]; | |
int i = 3; | |
asm("int $3"); // force debugger break | |
x[i] = 123; // corrupt stack | |
printf("%d\n",x[i]); // check if this really "works" | |
return 0; | |
} | |
$ gcc -fstack-protector-all -o t.exe t.c | |
$ ./t.exe | |
123 | |
$ echo $? | |
0 | |
>file t.exe | |
t.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment