From 58be4fb135f8fff8f0d192f09608317943447bd7 Mon Sep 17 00:00:00 2001 From: Faure Paul Date: Tue, 13 Jul 2021 17:27:44 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20ecran,=20clavier,=20chaine=20de=20carac?= =?UTF-8?q?t=C3=A8res,=20reste=20a=20tester=20et=20a=20faire=20la=20versio?= =?UTF-8?q?n=20non=20securis=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compilateur | 2 +- CrossAssembleur | 2 +- Interpreteur | 2 +- InterpreteurRegistres | 2 +- Processeur | 2 +- prog_vulnerable.c | 39 +++++++++++++++------------------------ 6 files changed, 20 insertions(+), 29 deletions(-) diff --git a/Compilateur b/Compilateur index 5eaffa4..012f46f 160000 --- a/Compilateur +++ b/Compilateur @@ -1 +1 @@ -Subproject commit 5eaffa4453e7258dd79040a10d7d7b7205eaefab +Subproject commit 012f46f03cec55c7bdd50376861bc6cf86fde4b5 diff --git a/CrossAssembleur b/CrossAssembleur index 712e317..475fb8d 160000 --- a/CrossAssembleur +++ b/CrossAssembleur @@ -1 +1 @@ -Subproject commit 712e317901212d1917739b90577e715154e09afe +Subproject commit 475fb8dbbad67f0e3118911d968d52d889440f3f diff --git a/Interpreteur b/Interpreteur index 9b91ac0..a035a53 160000 --- a/Interpreteur +++ b/Interpreteur @@ -1 +1 @@ -Subproject commit 9b91ac00367bf25679448763cbc02c132bcaf090 +Subproject commit a035a534e9af60372d695584389a547e9cb064cb diff --git a/InterpreteurRegistres b/InterpreteurRegistres index bc036e3..9e9dd66 160000 --- a/InterpreteurRegistres +++ b/InterpreteurRegistres @@ -1 +1 @@ -Subproject commit bc036e3c948c7efc893f07195dbec34e9e20c446 +Subproject commit 9e9dd66c3a5164987fc37082b69c62f28bd5784a diff --git a/Processeur b/Processeur index 8cac780..8b1dc18 160000 --- a/Processeur +++ b/Processeur @@ -1 +1 @@ -Subproject commit 8cac7807f08791ea9cb53befe1e7de175ac73d37 +Subproject commit 8b1dc18f3a1b93b760b560bca2c3e54a53de6ca0 diff --git a/prog_vulnerable.c b/prog_vulnerable.c index 67f2a9d..01a94d9 100644 --- a/prog_vulnerable.c +++ b/prog_vulnerable.c @@ -1,47 +1,38 @@ int lire_tableau() { int tab[5] = {0,0,0,0,0}; - printf(255); - stop(20); - printf(0); - stop(20); - printf(255); - stop(20); - printf(0); - stop(200); + print("Veuillez saisir une valeur\n"); int val = get(); int i = 1; - while (i<8) { + while (i<10) { tab[5-i] = val; i = i + 1; } + i = 0; + while (i < 5) { + print("tab["); + print(i); + print("] = "); + print(tab[i]); + print("\n"); + i = i + 1; + } } int youVeBeenHacked() { - while (1) { - printf(255); - stop(10); - printf(0); - stop(10); - } + print("YOU HAVE BEEN HACKED\n"); } int legitimeFunction() { - int val = 1; - int i = 0; - while (i<8) { - printf(val); - stop(20); - val = val * 2; - i = i + 1; - } + print("Fonction legitime\n"); } int main() { + print("Debut d'un programme\n"); int a = 0; int b = 0; lire_tableau(); legitimeFunction(); - printf(a); + print(a); }