Processeur securisé
This commit is contained in:
parent
3fd5d3fbef
commit
1ec8f84f21
4 changed files with 50 additions and 3 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 95409eb5bff39457f161a6b93c2024d2fe8a90d1
|
Subproject commit 725e0125079b6bde8ad032a3be21910980900ec4
|
|
@ -1 +1 @@
|
||||||
Subproject commit a4ecb5505dc66b71aee4d3d9ccccdbe17079f3d9
|
Subproject commit bff261fa01129da9135f95f16bf4124366ea24fe
|
|
@ -1 +1 @@
|
||||||
Subproject commit f25ee2735abfbaf0cd46ea0236f2ef267e752ec7
|
Subproject commit a70b442150f8ff4e8974c10559c3db47109a5609
|
47
prog_vulnerable.c
Normal file
47
prog_vulnerable.c
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
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);
|
||||||
|
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]);
|
||||||
|
i = i + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int youVeBeenHacked() {
|
||||||
|
while (1) {
|
||||||
|
printf(0);
|
||||||
|
stop(20);
|
||||||
|
printf(255);
|
||||||
|
stop(20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int legitimeFunction() {
|
||||||
|
int val = 1;
|
||||||
|
int i = 0;
|
||||||
|
while (i<8) {
|
||||||
|
printf(val);
|
||||||
|
stop(20);
|
||||||
|
val = val * 2;
|
||||||
|
i = i + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
lire_tableau();
|
||||||
|
legitimeFunction();
|
||||||
|
}
|
Loading…
Reference in a new issue