diff --git a/InterpreteurRegistres b/InterpreteurRegistres index bff261f..cf119a9 160000 --- a/InterpreteurRegistres +++ b/InterpreteurRegistres @@ -1 +1 @@ -Subproject commit bff261fa01129da9135f95f16bf4124366ea24fe +Subproject commit cf119a9a257d0885c86920f0cd6945cbbf4134fa diff --git a/prog_vulnerable.c b/prog_vulnerable.c index 41e4555..67f2a9d 100644 --- a/prog_vulnerable.c +++ b/prog_vulnerable.c @@ -1,5 +1,6 @@ int lire_tableau() { int tab[5] = {0,0,0,0,0}; + printf(255); stop(20); printf(0); @@ -9,24 +10,20 @@ int lire_tableau() { printf(0); stop(200); int val = get(); - int i = 0; - while (i<7) { - tab[5-i] = i; - i = i + 1; - } - int i = 0; - while (i<5) { - printf(tab[i]); + + int i = 1; + while (i<8) { + tab[5-i] = val; i = i + 1; } } int youVeBeenHacked() { while (1) { - printf(0); - stop(20); printf(255); - stop(20); + stop(10); + printf(0); + stop(10); } } @@ -42,6 +39,9 @@ int legitimeFunction() { } int main() { + int a = 0; + int b = 0; lire_tableau(); legitimeFunction(); + printf(a); }