Browse Source

Version fonctionnelle et testée processeur Secu, taf : NS

Faure Paul 2 years ago
parent
commit
1664672bcf
5 changed files with 16 additions and 16 deletions
  1. 1
    1
      Compilateur
  2. 1
    1
      Interpreteur
  3. 1
    1
      InterpreteurRegistres
  4. 1
    1
      Processeur
  5. 12
    12
      prog_vulnerable.c

+ 1
- 1
Compilateur

@@ -1 +1 @@
1
-Subproject commit 012f46f03cec55c7bdd50376861bc6cf86fde4b5
1
+Subproject commit f1214cfd12d6735ba751f6f23dd61c79b92efe35

+ 1
- 1
Interpreteur

@@ -1 +1 @@
1
-Subproject commit a035a534e9af60372d695584389a547e9cb064cb
1
+Subproject commit b6f5abf852d3c35b48f409db7db3b3ef08e9aebf

+ 1
- 1
InterpreteurRegistres

@@ -1 +1 @@
1
-Subproject commit 9e9dd66c3a5164987fc37082b69c62f28bd5784a
1
+Subproject commit 084df4937324620a3651538fcf065d36353245fe

+ 1
- 1
Processeur

@@ -1 +1 @@
1
-Subproject commit 8b1dc18f3a1b93b760b560bca2c3e54a53de6ca0
1
+Subproject commit 4ca8c3ee9afecc51a0e186b854a16a203c0954b3

+ 12
- 12
prog_vulnerable.c View File

@@ -5,23 +5,21 @@ int lire_tableau() {
5 5
 	int val = get();
6 6
 
7 7
 	int i = 1;
8
-	while (i<10) {
8
+	while (i<8) {
9 9
 		tab[5-i] = val; 
10 10
 		i = i + 1;
11 11
 	}
12
-  i = 0;
13
-  while (i < 5) {
14
-    print("tab[");
15
-    print(i);
16
-    print("] = ");
17
-    print(tab[i]);
18
-    print("\n");
19
-    i = i + 1;
20
-  }
21 12
 }
22 13
 
23 14
 int youVeBeenHacked() {
24
-	print("YOU HAVE BEEN HACKED\n");
15
+	print("\0YOU HAVE BEEN HACKED\n\n");
16
+  print("    (__)\n");
17
+  print("(|) (00)\n");
18
+  print(" |--(__)  \n");  
19
+  print(" | _| _|\__/\n\n");
20
+	print("Yark Yark Yark");
21
+  while (1) {
22
+  }
25 23
 }
26 24
 
27 25
 int legitimeFunction() {
@@ -33,6 +31,8 @@ int main() {
33 31
 	int a = 0;
34 32
 	int b = 0;
35 33
 	lire_tableau();
36
-	legitimeFunction();
34
+	youVeBeenHacked();
35
+  print("a=");
37 36
 	print(a);
37
+  print("\n");
38 38
 }

Loading…
Cancel
Save