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.

171 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
561 views

recover.c recovers all jpgs but fails check50 “expected xxx.jpg to exist” for all jpgs

I have checked out other posts and none seem to deal with this exact problem. My code recovers all jpgs correctly, names them as per the pset instructions however fails check50 with the error being "...
0
votes
1answer
178 views

Recover Infinite Loop

I have been working on the "recover", however although it compiles but it tend to run into an infinite loop when searching for the start of the jpgs. Here are my coding for searching the start of the ...
0
votes
1answer
298 views

pset4 recover: Code works 3/4 times. Sometimes gives segmentation fault. Doesn't pass check50

I'm having trouble figuring out what is going on. 3/4 times I run ./recover, it produces all 16 pictures correctly. Other times, I get a segmentation fault. When I run valgrind it gives me two "Use of ...
0
votes
0answers
105 views

pset5 picture problems: jpg recovery

I have two main problems with recover: Does not recover 049.jpg - Is this because my program is getting a freak EOF? check50 hates me - Although my program recovers 000.jpg through 048.jpg fine, ...
0
votes
1answer
121 views

i++ doesn't work as expected

This is for pset5, reading card.raw - but I think this is general issue. int i = 0; while(true) { i++; } Example above works just fine - it counts 0,1,2,3 etc. But example below doesn't count. ...
0
votes
0answers
149 views

All pictures recovered, Valgrind OK, but Check50 won´t accept the pictures

I was thrilled to see that all the pictures were recovered to the jpg-folder with the correct filenames, but shocked to see that my program was still running! I had to Ctrl + C to end it. I managed ...
0
votes
1answer
176 views

pset5 recover video

In the video offering tips for the "Recover" assignment, a graphic is shown, which depict the blocks of memory containing the jpeg files. The last block of memory is shown as "EOF" and appears to not ...
0
votes
2answers
240 views

Seg fault in recover.c pset5

I don't know why it's showing seg fault. Could anyone please tell me what I've done wrong? #include<stdio.h> #include<stdint.h> #include<stdlib.h> typedef uint8_t BYTE; ...
0
votes
1answer
483 views

Error: double free or corruption when running recover

After a very long time, I finally managed to find out why my version of recover.c only managed to recover 1 image (recover.c only recovers 1 image) Anyway, now I face a new problem. What I've ...
0
votes
1answer
376 views

Recover pset5 scope?

I'm almost there, but one more question about recover.. In my code, I open a file inside an if condition, but how do I acces that file later? It's getting out of scope and I'm getting use of ...
0
votes
1answer
45 views

CS50 ~/pset4/recover Seg Fault

I have been trying to edit this code multiple times and keep getting a segmentation fault. I've tried debug50 and narrowed down the incorrect line to be on line 53 fwrite(block,sizeof(int),512,image) ...
0
votes
1answer
363 views

Recover cs50 Please help!

Can somebody please help with this question? ... and also I tried to debug and apparently it doesn't run my while loop and i don't understand why. while (fread(buffer, 512, 1, fraw) == 1) so ...
0
votes
1answer
339 views

Recovers jpg correctly, but .jpg not found [Recover]

When running my code for recover (attached below) I'm bouncing back and forth between a segmentation fault and another error when running check50. My code runs without issue on card.raw But when I ...
0
votes
1answer
60 views

PSET4 recover doesn't find jpg

I'm trying to make PSET4 recover work but for some reason my program does not enter the if statement (which checks whether a block starts with jpg magic numbers). I also used printf("%x", block[0]) to ...
0
votes
2answers
85 views

In recover.c, how do you name each image file a seperate name?

Is this even necessary? Will the computer automatically name each file? Or will it use the name designated in fopen()?
-1
votes
0answers
7 views

My Program is not recovering the jpegs correctly

My program is compiling properly it is even recovering the images but when I am opening the image to view, it is not opening. It is showing "Invalid or Unsupported file format". Please look ...
-1
votes
1answer
132 views

Recover creates 16 corrupt images

Not Sure why my program is not making valid Jpegs! I am almost done!! Anyways, here is my code. I suspect it has something to do with the first write from buffer (the ones that detect jpeg file). #...
-1
votes
1answer
170 views

How to read the next sector in recover?

Below is the code that i have written when i execute the code i get jpg images but they are corrupted.Any help regarding it? //reading the sector and checking the condition do { fread(from ...
-1
votes
1answer
294 views

double free or corruption (top)

I have a problem for recover.c in pset4. And my error is: *** Error in `./recover': double free or corruption (top): 0x0000000002716250 *** Aborted And it only returned one single picture(per the ...
-1
votes
3answers
330 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 ...
-2
votes
1answer
300 views

What is wrong with this approach to reading first 512 bytes in recover.c?

I'm trying to use an iterative loop to read the first 512 byes for comparison in pset4 recover.c. This makes sense to me. Unfortunately the computer doesn't feel same typedef int32_t LONG; typedef ...

1 2 3
4