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
116 views

recover.c:43:34: error: use of undeclared identifier 'out' fwrite(temp, 1, 512, out);: WHAT?

When I compile my program, clang is probably not working. I get this when I compile: ~/pset3/recover/ $ make recover clang -fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11 -...
0
votes
1answer
141 views

PSET 4 recover doesn't pass check50 - “recovered images do not match”

All images are recovered, and when I open them, they all display correctly (I checked every one of them in the IDE), yet my program is not passing check50. Why? Here's my code: #include <stdio.h&...
0
votes
1answer
70 views

cs50 Recover — Segmentation fault and too many jpegs

I'm stuck with the debugging the below code. I keep getting way too many jpg files written and a segmentation fault. Thanks in advance for the help. I'm new to programming and this one is kicking ...
0
votes
1answer
158 views

Pset4 - recover, unable to pass check50

#include <stdio.h> #include <stdlib.h> int main (int argc, char *argv[1]) { // ensure the arguments are correct if (argc != 2) { fprintf(stderr, "Usage: ./recover filename\n"...
0
votes
1answer
101 views

PSET4 RECOVER (QUESTIONS)

I managed to make my code recover all 50 images, and have passed check50. However, during the development process I have encountered two problems, and still doesn't get why it is an issue. Here is my ...
0
votes
1answer
42 views

Pset4 recover: my code never recognises the beginning of a jpeg

When I compile the code I don't get any errors, however when I run it i get a segmentation fault. I discovered this is because my code never finds the beginning of a jpeg so my img file never gets ...
0
votes
1answer
62 views

PSET 4 RECOVER - My program outputs 50 images however they all have an invalid format

So I think I've nearly finished but I've come upon a bit of roadblock. That is all my photo are invalid. I looked at all the threads I could and couldn't find out why. My Code: #include <stdio.h&...
0
votes
1answer
52 views

Pset4 Recover - Program only recovers 2 images, but loops 50 times

My recover.c program only recovers 2 images, although when I tested how many loops it did, it did 50. Both images recovered seem complete, nothing weird about the images. Check50 also confirmed the ...
0
votes
1answer
41 views

pset4 recover it shows segmentation fault

/*************************************** * recover.c * problem pset4 * computer science 50 * Reccvers JPEGs from a foreinsic image * **************************************/ #include <stdio.h&...
0
votes
1answer
80 views

Segmentation error pset4 recover

I am getting a segmentation error when I run recover. I've looked at other questions regarding segmentation errors but cant find the issue. Below is my code. Thanks! #include <stdio.h> #include ...
0
votes
2answers
523 views

recover - fread into buffer

I am working on the recover problem and I request some help. Well as the problem requires that search through raw data to get and save images separately, I am working on the problem step by step. At ...
0
votes
2answers
115 views

Segmentation fault in recover pset4

I am working on recover in problem set 4. However, after trying out different stuff, the code itself compiles but I get a segmentation fault and the outcome is only one jpg file called 000.jpg. I am ...
0
votes
1answer
55 views

pset4 recover code compiles but doesn't run

I thought I had everything figured out when my code compiled, but unfortunately it doesn't recover the images or do anything at all for that matter, and I'm not sure why. #include <stdio.h> #...
0
votes
1answer
54 views

pset 4 recover, won't recognize file outptr

#include <stdio.h> #include <stdlib.h> // I got information about what to do with the buffer // from this stack exchangehttps://cs50.stackexchange.com/questions/2680/ //...
0
votes
1answer
221 views

pset 4 recover, questions about purpose of using buffer

#include <stdio.h> #include <stdlib.h #include <stdint.h> // I got information about what to do with the buffer // from this stack exchangehttps://cs50.stackexchange....
0
votes
1answer
80 views

pset4 recover: first byte of buffer seems unexpectedly changes to 0

Thanks for seeing my question, I appreciate your help. :) Let's get to the point. My code compiles and runs without any errors. Images are generated, but the images are incomplete, here's an example ...
0
votes
1answer
25 views

*** Error in `./recover': double free or corruption (top): 0x000000000294a250 *** in recover pset4

I got this error when working in pset4(recover) and i can't see where exactly did i free something twice, can some one help me with it, by the way do i need to use a File *pointer with append as a ...
0
votes
1answer
128 views

CS50 Pset4 Recover card.raw only NULL

Okay so I am starting the recover program from Pset4 and I initially just want to get some output, any output, I have been trying to read the first few bytes from recover.raw but for some reason seem ...
0
votes
1answer
39 views

PSET 4 Recover If condition never true

I have been spending quite some time now on PSET 4 recover. After using Debug50 several times, I see that what is blocking is the fact that my if condition never returns TRUE and thus I can never find ...
0
votes
1answer
128 views

pset4 recover single image

My recover program currently successfully returns a single image "001.jpg" which looks good when I open the file. It also returns a second image "002.jpg" which prompts an error for an Unsupported or ...
0
votes
1answer
142 views

Recover: invalid or unsupported image format

#include <stdio.h> #include <stdlib.h> #include <stdint.h> int main(int argc, char *argv[]) { if (argc != 2) { fprintf(stderr, "Usage: ./recover Card.raw\n"); ...
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
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
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
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
88 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
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
68 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
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
449 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
174 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
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
65 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
1answer
153 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
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
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
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
121 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
41 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
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
474 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
418 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! ...
0
votes
1answer
403 views

My recovered IMGs doesn't match the Original in recover Pset4 recover

0 down vote favorite The problem is to recover some JPGs from a .raw file. when I run check50 I get "recovered img don't match". :) recover.c exists. :) recover.c compiles. :) handles lack of ...
0
votes
1answer
91 views

Segmentation fault on recover pset4

My program compiles, but when I run it I get a segmentation fault and nothing else: ~/workspace/recover/ $ make recover clang -fsanitize=integer -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall ...
0
votes
1answer
272 views

Blank jpegs pset 4 recover

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <cs50.h> int main(int argc,char *argv[]) { if (argc != 2) { fprintf(stderr, "usage: ./recover ...
0
votes
1answer
388 views

Pset4 Recover - all 50 photos recovered but failed check50

I run my code and can see all 50 images, but check50 says: :) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :) recovers 000.jpg correctly :( recovers middle images ...
0
votes
1answer
51 views

Segmentation fault and only one unreadable image - RECOVER

I'm getting a segmentation fault and only one, unreadable image (and some other temp nonsense files) when running the following code: #include <stdio.h> #include <stdlib.h> #include <...

1
5 6
7
8 9
18