From 2a540de892413bd8b4237a603536515be33060c5 Mon Sep 17 00:00:00 2001 From: cmirnov Date: Tue, 1 Dec 2015 22:20:27 +0300 Subject: [PATCH] Create exploit.c --- exploit.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 exploit.c diff --git a/exploit.c b/exploit.c new file mode 100644 index 0000000..cd1241e --- /dev/null +++ b/exploit.c @@ -0,0 +1,34 @@ +#include +int adrMain; +int i; +int input() +{ + int a[3] = {0}; + int i; + for (i = 0; i < 10; i++) + { + printf("a[%d] = %p\n", i, a[i] - adrMain); + } + printf("enter your num\n"); + i = 0; + int stop = 1; + while (stop != 0) + { + printf("a[%d] = ", i); + scanf("%p", &stop); + a[i] = stop; + i++; + } +} +int other() +{ + printf("SUCCESS!!!"); +} + +int main() +{ + adrMain = &main; + printf("other = %p\n", &other); + input(); + system("pause"); +}