Questions tagged [recover]

recover.c, one of the assignments for Problem Set 4, will challenge you to search through the raw bytes of a camera's digital memory to recover a bunch of "deleted" JPEG images.

Filter by
Sorted by
Tagged with
2
votes
1answer
1k views

Can't recover 049.jpg successfully

The 049.jpg file is created but not recovered! I have used the fread function to detect the EOF as told in the walk through by Zamyla. Here is a link to the check50 sandbox output. # Checks 0 ...
0
votes
1answer
135 views

JPEG output files are blank

All of my program seems to be functioning but my JPEG images are completely blank. I'm not sure, but I think the error is somewhere in this code: if ((buffer[0] == 0xFF) && (buffer[1] == 0xD8)...
0
votes
1answer
649 views

pset5 recover error with jpeg file

I keep getting "error interpreting jpeg image file (Not a jpeg file: starts with 0x00 0xd8)", even though gdb tells me buffer[0] is 0xff. A similar question has been posted on reddit, but I couldn't ...
1
vote
1answer
118 views

Can anyone tell why is this giving me a SEGFAULT?

typedef uint8_t BYTE; int main(void) { FILE* memcard = fopen("card.raw", "r"); if (memcard == NULL) { printf("something went wrong and file could not be opened"); return ...
0
votes
1answer
775 views

Seg Fault in Recover.c

I cannot seem to get to get rid of this seg fault. In my loop I basically have this (semi-pseudo code): fread(in); if(nf == 0xffd8ffe0 || nf == 0xffd8ffe1) { f++; fclose(out); ...
1
vote
1answer
866 views

Pset 5 - Recover

Having problems with recover (pset5) now. This is what I'm doing: Opening File Until the end of file Reading 512 bytes to buffer Checking first 4 bytes of buffer to see if a jpg has just ...
1
vote
1answer
377 views

Recover.c Segmentation Fault

Pseudocode: declare counter declare filename[8] main Open input Declare buffer do read(512 bytes into buffer from input) while (not start of jpeg) do write filename open ...
0
votes
1answer
1k views

segmentation fault - pset5 recover.c

I have spent a long time looking through my code for a segmentation fault, but have not been able to find it. #include <stdio.h> #include <stdlib.h> #include <stdint.h> #define ...
1
vote
1answer
3k views

Cannot figure out what is wrong with recover - “Improper call to JPEG library in state 201”

Does anyone know why I might be receiving this error in my recover program? I've used xxd to confirm that the first four bytes are correct and signal that each is a jpeg. However, I am still receiving ...
1
vote
2answers
175 views

Trouble incrementing the number in jpeg filenames

I've gotten recover to work... sort of. The problem is difficult to describe without posting my code, but here's an attempt: My program can find all the jpg signatures (in GDB, my jpeg-finding line ...
3
votes
3answers
898 views

Proper use of fread function

I have declared a buffer as follows : unsigned int buffer[512]; Now, later on in my code I used fread in the following manner fread(buffer, 512, 1, infile) and everything worked as expected. Note ...
0
votes
1answer
72 views

How on Earth can this variable change without any commands? Please help!

As you can see, the value of buffer[0] changes when the line sprintf(tittle, %03d.jpg", images);, which has nothing to do with the buffer. All of the values in buffer are changed. I went through my ...
2
votes
2answers
403 views

Is it possible to see the actual bytes of card.raw?

Is it possible to see the actual bytes of card.raw from pset5?
1
vote
1answer
120 views

Why is this condition true if the characters in the buffer do not match?

As you can see, the if statement on the line 35 is false. Why is the body of the if statement being executed?
1
vote
2answers
155 views

How to build a “.raw ” image of a storage media?

In pset 5 David gave us his SD card's card.raw file to recover deleted JPEG images from. What are these .raw disk images and how can we build them to create practice problems similar to pset 5 for ...
-1
votes
3answers
329 views

Why Doesn't check50 Recognize My Recovered Images?

when I use check50 to check my recover program for pset 5, it says that the pictures are not recovered, but when I look in the file directory, all of the 50 pictures are perfectly recovered. How could ...
0
votes
1answer
595 views

recover.c recovers all images successfully, but check50 says it fails to recover the last. Any ideas why this is happening?

I have a while (!feof(infile)) loop, so that exits only when the eof is reached. And it closes all files upon exit. Here's the code: // scan input file while (!feof(infile)) { // read four bytes ...

1
14 15 16 17
18