commit 55dd6701c64dcaf46416dc0ab87dbb53e7e7d6de Author: Ward Wouts Date: Thu Jan 16 08:42:45 2020 +0100 Import diff --git a/Stack_Overflow_2.png b/Stack_Overflow_2.png new file mode 100644 index 0000000..b9ec508 Binary files /dev/null and b/Stack_Overflow_2.png differ diff --git a/Stack_Overflow_3.png b/Stack_Overflow_3.png new file mode 100644 index 0000000..98bf0b9 Binary files /dev/null and b/Stack_Overflow_3.png differ diff --git a/Stack_Overflow_4.png b/Stack_Overflow_4.png new file mode 100644 index 0000000..b1c8c27 Binary files /dev/null and b/Stack_Overflow_4.png differ diff --git a/code/Makefile b/code/Makefile new file mode 100644 index 0000000..8087812 --- /dev/null +++ b/code/Makefile @@ -0,0 +1,9 @@ +.PHONY: all + +demo: + gcc -ggdb -fno-stack-protector -z execstack -z norelro -m32 -no-pie -mpreferred-stack-boundary=2 demo.c -o demo + +diy: + gcc -ggdb -fno-stack-protector -z execstack -z norelro -m32 -no-pie -mpreferred-stack-boundary=2 diy.c -o diy + +all: demo diy diff --git a/code/demo b/code/demo new file mode 100755 index 0000000..dbfe40a Binary files /dev/null and b/code/demo differ diff --git a/code/demo.c b/code/demo.c new file mode 100644 index 0000000..00f730d --- /dev/null +++ b/code/demo.c @@ -0,0 +1,16 @@ +#include +#include +#include + +int main(int argc, char * argv[]){ + char buf[128]; + + if(argc == 1){ + printf("Usage: %s argument\n", argv[0]); + exit(1); + } + strcpy(buf,argv[1]); + printf("%s", buf); + + return 0; +} diff --git a/code/diy b/code/diy new file mode 100755 index 0000000..43db7f7 Binary files /dev/null and b/code/diy differ diff --git a/code/diy.c b/code/diy.c new file mode 100644 index 0000000..0880db3 --- /dev/null +++ b/code/diy.c @@ -0,0 +1,22 @@ +#include +#include + +void winner() +{ + printf("You win\n"); +} + +void whoareyou() +{ + char name[250]; + + printf("What's your name? "); + gets(name); + printf("\nHello, %s\n", name); +} + +int main() +{ + whoareyou(); + printf("You lose\n"); +} diff --git a/code/narnia2 b/code/narnia2 new file mode 100755 index 0000000..c9fb593 Binary files /dev/null and b/code/narnia2 differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..5418b18 --- /dev/null +++ b/index.html @@ -0,0 +1,438 @@ + + + + Old skool stack smashing + + + + + + + + +