recover_local_secret.c 893 Bytes
#include <inttypes.h>
#include <stdbool.h>
#include <unistd.h>

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "util.h"

#include "stage3.h"

const uint64_t MIN_CHOICE = 'A' - 1;
const uint64_t MAX_CHOICE = 'Z' + 1;
const uint64_t SECRET_LENGTH = 5;

static inline page_t *init_pages() {
    return calloc(MAX_CHOICE, sizeof(page_t));
}

static inline void flush_all_pages(page_t *pages) {
    // TODO: Copy me from the previous stage
}

static inline size_t guess_accessed_page(page_t *pages) {
    // TODO: Copy me from the previous stage
    return 0;
}

static inline void do_access(page_t *probe_array, size_t idx) {
    // TODO: Implement me using force_read.  I am a very short function.
}

int main() {
    page_t *probe_array = init_pages();

    // TODO: Copy me from the previous stage and edit me so I loop over SECRET_LENGTH characters.

    printf("\n");
}