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
0
votes
1answer
79 views

Problem Set 4 Recover Issues. I can't figure out why my code doesn't work

I'm busy with problem set 4, and I can't figure out why my code doesn't work. What seems odd is that the first line or two of a new jpeg will seem partially or fully correct, but thereafter the images ...
0
votes
1answer
181 views

recover pset4 file handling

I got this code to work, but I have a few questions for my own clarification. On line 68 where I define the jpg title, why is it a single character? The actual title 001.jpg is much longer than a ...
0
votes
1answer
696 views

Pset4 Recover: Program creates segmentation fault

I'm new to writing programs that read or write files and I am totally stuck as to the reason I keep getting a segmentation fault. I feel like it might have to do with one of my file pointers or newly ...
0
votes
2answers
45 views

CS50 , PSET 4 , Recover , segmentation fault

I reviewed my code 10 times and still not know why it gives segmentation fault when I run , I could use a help of an expert , thanks in advance. #include <cs50.h> #include <stdio.h> #...
0
votes
1answer
268 views

pset4 recover images do not match

I ran my code through the compiler and the recovered images are all blank. The images do not match when I ran my code through check50 as well. I can't identify the problem with my code. I would ...
0
votes
1answer
69 views

Pset4 cannot recover images

I am not sure what is the problem in my code that is preventing the images from being recovered from the card.raw file. I've looked through my code and can't find the problem. Really appreciate it if ...
0
votes
1answer
101 views

PSet4 recover: recovered files start with a wrong sequence

My recover program creates 50 files, but they do not open (it says "Invalid or Unsupported Image Format"). I opened some of the JPEGs with a hexadecimal editor and found out that they start with 00 d8 ...
0
votes
1answer
94 views

Pset4 recover.c compiles but fails to create any file

can't figure out what's going wrong with my code. It's compiling without any errors but still it doesn't create any jpg file or any file at all. Here's my code: int main (int argc, char* argv []) { ...
0
votes
1answer
41 views

Pset 4- Recover. Issues with properly formatting code

I have a problem where I need to check if I have an open file on my loop, so I properly close the previous file before writing a new one. But my check only works if I fclose(img) if my counter > 0. ...
0
votes
1answer
48 views

Recover - “recovered photo does not match”

So I'm nearly finished with recover. It recovers 50 jpegs but I can't open any of them. I just can't seem to figure out what is causing the issue looking through my code. Any help would be appreciated ...
0
votes
1answer
86 views

Pset4 Recover - Error using fclose

(This was also posted on reddit, but I think it's been lost, sorry) Hi guys, currently doing recover. I'm having trouble with using fclose on my output file pointer (jpegptr) - every time I try to ...
0
votes
2answers
148 views

Character array values return 4 bytes instead of 1

I'm helping my son work on the recover.c assignment trying to recover JPEGs from card.raw disk image file. I'm running into a strange behavior trying to display bytes from my 512-byte buffer which is ...
0
votes
1answer
138 views

Recover - images are blurry and incomplete

The images are created but come back as blurry messes. I can't see my bug so I'm hoping to get a hint. int main(int argc, char *argv[]){ // take in single card name if(argc > 2){ fprintf(...
0
votes
1answer
42 views

pset4 recover, cannot open jpg

Can somebody please help me with the code, I couldnt figure out why the pictures cannot open. It's didn't show any error. Thanks. #include <cs50.h> #include <stdio.h> #include <stdlib....
0
votes
1answer
67 views

my recover is not able to read card.raw

I have some problem with my recover code. I based it on copy.c so the beggining lines are : int main(int argc, char *argv[]) { // ensure proper usage if (argc != 2) { fprintf(...
0
votes
1answer
258 views

pset 4 recover : all images are grey and white boxes

My recover program compiles and runs (finds 27 images). While opening them they all seem to be different at least in shape. However the copying seems to be problematic (all made of white and grey ...
0
votes
1answer
30 views

Recover pset : cannot manage to check jpg signature

I am having many troubles with the recover problem but for the moment the most important one seems to be that my code doesn't even pass the step to go through my if loop to find the jpeg start. Here ...
0
votes
1answer
442 views

pset4: Recover. Double free or corruption(top) error

I am getting the following output whenever I run my program: Error in `./recover': double free or corruption (top): 0x0000000002a75250 Aborted Also, when the program is executed, it does create the ...
0
votes
1answer
169 views

PSET4 Recover images not showing correctly

Here is updated code with answer. #include <stdio.h> #include <stdlib.h> #include <stdint.h> int main(int argc, char *argv[]){ if (argc != 2){ ...
0
votes
2answers
2k views

PSET 4 Recover Help with reading 512 byte blocks.

I'm having some trouble trying to read and loop through the card.raw file. I'm not running into any errors though I can't figure out why when I call fread I continually get 0 as a return value. My ...
0
votes
1answer
220 views

CS50 Recover did not pass check50

I am currently struggling to pass pset4, specifically on Recover. I already search other questions in forum and it seems there were no solutions to my problem, so I am stuck. From card.raw i could ...
0
votes
1answer
56 views

recover.c doesn't create any file

Please have a look at my recover.c and please help me #include <cs50.h> #include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { char *infile=argv[1]; if(argc!=...
0
votes
1answer
74 views

CS50 Pset 4/Recover-retains 50 broken JPEGs

My code compiles/executes and retains 50 JPEGs, however, these JPEGs are broken, I have gone through my code many of times, have discarded other versions, I seem to be missing something I can't spot ...
0
votes
1answer
30 views

recover more than 1000 jpg

#include <stdio.h> #include <stdlib.h> //int main(int argc, char* argv[]) int main(void) { // TODO int count=0; char name[8]; unsigned char buffer[512]={0}; FILE * ...
0
votes
2answers
64 views

The IF in recover

do not understand why the "if" statement offered by zamyla in the recover problem works. I can see the first three conditions but the last one is confusing. if (array[0] == 0xff && array[...
0
votes
2answers
93 views

recover pset4 does not pass first of jpeg condition

the recover program I've implemented runs and compiles but does not produce any images.To debug the program I put a few "printf"s in different parts of it and realized it never passes "first of jpeg" ...
0
votes
1answer
570 views

Pset4 recover.c check50 error: timed out while waiting for program to exit

My code is able to generate images from card.raw dataset, but fails with the check50 dataset, giving the following error: :) recover.c exists. :) recover.c compiles. :) handles lack of forensic image ...
0
votes
1answer
151 views

Pset4 Recover: Able to recover all images except first!

I find this behaviour really strange, please help! My code shows a segmentation fault when I compile and run it and just opens a blank 000.jpg, recovering no other image. But when I run debug50 to ...
0
votes
1answer
48 views

Pset4 recover compiles but crashes during implementation

The program compiles, but once run it crashes. I believe there is a logic in its structure and have no idea what makes it crash. Any hint will be highly appreciated. /** Recovers deleted jpeg files */...
0
votes
1answer
145 views

Pset4 problem with recover: check50 expected exit code 0, not 3

I know this question has been asked many times before on this forum, but none of the problems addressed so far seem to be the issue in my program. As for many people, my program seems to be working ...
0
votes
1answer
109 views

recover compiles and runs but no jpeg is saved

I save the name of the picture in picname and open it in img and do the rest of the copying from memory card on img , the program compiles and runs fine but no image is saved in the current directory....
0
votes
1answer
118 views

For pset 4, recover. I am not able to use the %i function to generate image name

enter code here/** * Recovers JPG files 512 B at a time . */ include include include include int main(int argc, char *argv[]) { // ensure proper usage if (argc != 2) { ...
0
votes
1answer
440 views

Pset4 Recover - Segmentation fault using while loop (fgetc function)

When I ran the program, it said that there was a segmentation fault. I tried using debug50 to identify the source of the fault and it pointed to the line of code that I have bolded. I don't understand ...
0
votes
1answer
88 views

Pset4 - Recover: Reveals all 50 images, but can't pass chech50

I lost a couple of hours struggling to find what might be causing my program to not pass the check, but to reveals all the 50 images from the test set. I even compiled else's passing code just to get ...
0
votes
1answer
83 views

Recover (PSET4) segmentation fault

Really struggling with this one hope someone can help! I'm getting a segmentation fault with this code and despite fiddling around with it, debugging and checking other answers on this site I can't ...
0
votes
1answer
61 views

PSET4 Recover - Problem with my code

I'm Samuel and currently working on problem set 4 of CS50x recover. I have given it my best shot but came across an error: error: using the result of an assignment as a condition without parentheses [...
0
votes
2answers
76 views

Recover - Code Generating images but failing check

Looked at some of the other posts on this issue. For me it seems like I'm taking the correct size of (not buffer pointer but actual buffer). Can't seem to figure out why this is failing check50. ...
0
votes
1answer
99 views

My code recover all the 50 photos but doesn't pass last test in check50

I can see the all 50 images but I have this error when i check with the check50: :) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :) recovers 000.jpg correctly :) ...
0
votes
1answer
119 views

cs50: pset 4: Recover. Check50 gives following error: 'expected exit code 0, not 1'

I have completed the task and can view the .jpg images but when I run check50 I get the following error message: :) recover.c exists. :( recover.c compiles. expected exit code 0, not 1 ...etc. When ...
0
votes
1answer
97 views

PSet4 Recover - Last file corrupted and check50 finds no correct JPG file

I've spend many hours on CS50's problem set 4 until now and I also searched for my issue in multiple other threads here - still, I couldn't solve my problems. So I would be glad for anyone looking at ...
0
votes
1answer
40 views

Not handling check50 test data

I've now sunk ~20 hours into recover, and still can't get my code to work on the check50 data. The issue I've seen on here that other people have been having was with checking the jpeg headers, but I ...
0
votes
1answer
71 views

Recover suffering segmentation fault

I have searched through other questions on PSET4-Recover but I could not find the problem with my code that makes it go through a segmentation fault. Here's my code: #include <stdio.h> #include ...
0
votes
1answer
426 views

recover.c “ recovered image does not match”

My program generated the 50 images (000 to 049) from the card.raw file. When I opened each one, it was just a checkered (which i assume is blank) image. I'm not getting a "unsupported image" error btw....
0
votes
1answer
301 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
69 views

Image not recovering completely in recover.c(in pset4)

I am currently working on recover(pset4).I have recovered all 50 images but partially.Don't know what is wrong with the code...Any help is appreciated.Here is the link to the code https://gist.github....
0
votes
1answer
147 views

Pset4 recover only partially passing check50

I can see all the images from the card.raw file but Check50 keeps giving me the following when running it on Pset 4 Recover: :) recover.c exists. :) recover.c compiles. :) handles lack of forensic ...
0
votes
1answer
141 views

recover giving blank/ blurry pictures, pset4

I've been staring at this for a couple hours and I still can't figure out what's wrong with it! After executing it, it gives me 50 pictures but they're either blurry or black and white checkered. I ...
0
votes
1answer
470 views

recover -got all the pics recovered but ONE wrong in check50

I was able to recover the jpeg's (49 of them)...but running check50 shows ONE RED (wrong)..I've tried very hard to figure what went wrong...please help me find my mistake or please give an hint to ...
0
votes
1answer
404 views

pset4 recover always getting segmentation fault

I've checked and reread my code a million times but I can't understand why I'm always getting a segmentation fault. I don't even know where the segmentation fault is. Any help is greatly appreciated! ...
1
vote
1answer
166 views

PSET4 Recover produces JPGs, but passes CS50 check only partially

My PSET 4 Recover code is able to recover the 50 jpg's from the raw file. However, when checking the code with the check50 it only partially passes. I checked a lot other related issues on SE CS50 ...

1
5 6
7
8 9
18