diff options
| author | mo khan <mo@mokhan.ca> | 2014-10-28 08:59:02 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-10-28 08:59:02 -0600 |
| commit | 6ad7d85101d7504d91fdceb23aa3816b4922b0e6 (patch) | |
| tree | 5535488af0b50fdf19c78cde26a75e8ebc51bf42 | |
| parent | a34ed751375bc5c1bbbb8eae3a1cd6f31103592b (diff) | |
start with problem 1.
| -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; +} |
