I'm attempting recover.c and I'm interested in clearing up a few things about
I tried to sample the first few bytes of the
card.raw file but I keep getting the same two errors: Segmentation Fault 11, or the data I read from the file prints as either
0 or some seemingly random number.
Given the small snippet below, can someone walk me through the correct way to
fread() into allocated memory then write that data to either a
FILE * or
// debug - write a few bytes from the raw file to the logfile uint32_t *pattern = malloc(sizeof(uint32_t)); fread(pattern, sizeof(uint32_t), 1, card); fprintf(logfile, "%x\n", *pattern); free(pattern);