summaryrefslogtreecommitdiff
path: root/attack_code/victim_v10/victim_v10.c
diff options
context:
space:
mode:
Diffstat (limited to 'attack_code/victim_v10/victim_v10.c')
-rw-r--r--attack_code/victim_v10/victim_v10.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/attack_code/victim_v10/victim_v10.c b/attack_code/victim_v10/victim_v10.c
new file mode 100644
index 000000000..193ac750d
--- /dev/null
+++ b/attack_code/victim_v10/victim_v10.c
@@ -0,0 +1,17 @@
+/* code from https://www.paulkocher.com/doc/MicrosoftCompilerSpectreMitigation.html */
+
+#include <stdlib.h>
+#include <stdint.h>
+
+extern size_t array_size;
+extern uint8_t array1[];
+extern uint8_t array2[];
+extern uint8_t temp;
+
+void victim_function_v10(size_t x, uint8_t k)
+{
+ if (x < array_size) {
+ if (array1[x] == k)
+ temp &= array2[0];
+ }
+}