diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | src/stack1.c | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cba7efc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +a.out diff --git a/src/stack1.c b/src/stack1.c new file mode 100644 index 0000000..fdc2f14 --- /dev/null +++ b/src/stack1.c @@ -0,0 +1,17 @@ +#include <stdio.h> + +// http://community.coresecurity.com/~gera/InsecureProgramming/stack1.html +// +int main(int argc, const char *argv[]) +{ + int cookie; + char buf[80]; + printf("buf: %08x cookie: %08x\n", &buf, &cookie); + gets(buf); + + if (cookie == 0x41424344) { + printf("you win!\n"); + } + + return 0; +} |
