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.

170 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
53 views

PSET4 Recover timing out

My code works for the card.raw that is given part of the problem set. However, it times out when I use check50. Does anyone know why even though the code compiles rather quickly for the card.raw? Or ...
0
votes
1answer
48 views

Pset4 recover final jpg is mismatch

I am getting all 49 images, on check50 i get the message that the 049.jpg is mismatch.I am trying to debug, but i am getting a seg fault error. #include <stdio.h> #include <stdlib.h> #...
0
votes
1answer
48 views

PSET4 Recover Segmentation Fault, please help

I hope everyone is doing well during this difficult time, my prayers to those been affected by it. I have difficulty debugging the segmentation fault here and the cs50 debugger is not too helpful on ...
0
votes
1answer
120 views

Pset4: Recover, only 49 images and fails with check50

I recently started with CS50 and I struggle a bit with pset4's recover. While the jpgs look correct to me, my code only recovers 49 jpgs total, not the 50 which are expected. Check50 fails on the ...
0
votes
1answer
22 views

CS50 Recover outputs random symbols instead of JPEGS

I am working on pset4 recover in CS50 and I think I am almost done it. The files that it outputs though appear as a bunch of random symbols instead of a jpeg, I'm not sure why this is occurring but ...
0
votes
1answer
380 views

Debug50 Running through breakpoints

I am trying to use debug50 for PSET 4 (Recover). However, when I set the breakpoints the debugger runs through them and do not pause. Only when I set the breakpoint at the if statement shown in the ...
0
votes
1answer
82 views

Segmentation fault pset4 recover

I'm having a segmentation fault which I'm not being able to identify. After reading about other similar problems I thought it could be that I wasn't checking if (img == NULL) but even after adding it ...
0
votes
1answer
38 views

Segmentation fault on PSET3 recover

My program compiles, but wherever it runs I recieve a segmentation fault error. However i cannot see where the source of the problem is: #include <stdio.h> #include <stdlib.h> #include &...
0
votes
1answer
29 views

PSET 3 recover I can't open pointers. Always returns a NULL value

Whenever I try to run this code, it returns "could not open file", which means that jptr is assigned a null value. I don't know how to get rid of this, tried so many solutions. It keeps on happening ...
0
votes
1answer
67 views

(Recover) Segmentation fault

I was trying to complete the recover problem and it's giving me a segmentation fault. Any help would be appreciated. #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #...
0
votes
1answer
128 views

CS50 Recover.c | No idea what and where i'm going wrong | Can't debug or compile in CS50 IDE

I'm trying to debug in CS50 IDE but I'm continuously receiving this error; debug50: recover: No such file. and if I try to compile it says this "make: *** No rule to make target 'recover'. Stop." ...
0
votes
1answer
124 views

why is check50 returning error of lack of forensic image and some jpg not found

this is my code // Open the card.raw file and check for NULL FILE* card_ptr = fopen("card.raw", "r"); [admin removed rest of code] and this is my error message generated from check50 :) recover.c ...
0
votes
1answer
61 views

Recover help - only 2 imgs are getting recovered

#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if(argc != 2) { fprintf(stderr, "Usage: ./recover <filename>\n"); return 1; } ...
0
votes
1answer
84 views

How can I find out the size of what i have just read with fread()?

currently my code looks like this. int finds_reading_length(FILE* the_open_file, int the_block_size) { fseek(the_open_file,-the_block_size,SEEK_CUR); BYTE* buffer[the_block_size + 1]; ...
0
votes
1answer
65 views

Pset4 'Recover' - Help! How can I solve this segmentation fault?

For pset4 'Recover', I'm facing a segmentation fault but I cannot find what I did wrong in my code. If I use echo$? to find where the bug is, it returns the value 1. Can someone help me to point me in ...
0
votes
1answer
96 views

Recovered image does not match pset3

I can't figure out what is wrong with my code. I recovered images from 000.jpg to 050.jpg. This is my code #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef ...
0
votes
0answers
39 views

recover.c spits out images that are partially recognizable

recover.c compiles and runs normally, but it produces 21 images that have chunks of different images mixed in. Here are the images: 000.jpg: 001.jpg: 002.jpg: 003.jpg: 004.jpg: Because I'm too ...
0
votes
1answer
49 views

CS50 recover - images are some kind of blank

//My program creates images of different sizes but without content (just black and white pixels). Someone can help me? #include <cs50.h> #include <stdio.h> #include <stdlib.h> #...
0
votes
1answer
106 views

Why can I recover only two images?

This is my code for pset3, recover #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { // ensure proper usage if (argc != 2) { fprintf(stderr, "...
0
votes
1answer
80 views

PSET4 Recover Output Ptr Closing/JPEG Writing

I have a script that mostly works, I think, but I cant get the file writing to work. I have seen some others use a flag for calling when to close the output pointer but I cant see why this way wont ...
0
votes
1answer
51 views

pset4 recover file name declaration

char jpgname[8]; // Correct declaration char *jpgname = "000.jpg"; // Incorrect declaration . . sprintf(jpgname,"%03i.jpg", fileNum); // Segmentation fault seemed to occur on this line if the ...
0
votes
1answer
271 views

pset4 recover handles lack of forensic image

Help to recover images on this program. Thank you. /*************************************** * recover.c * problem pset4 * computer science 50 * Reccvers JPEGs from a foreinsic image * ***********...
0
votes
1answer
102 views

Pset4 Recover issues

I am having a number of problems with recover in pset4. First, my program is not finding a beginning of a jpeg. But, to test that, I have to first compile it, and I cannot because for some reason on ...
0
votes
0answers
138 views

Help with some understanding - Recover

I don't want an explicit solution, but some clarity in my understanding. 1) The buffer. Is using a char or int buffer a hack approach? I thought about typedef byte or block but what's the ...
0
votes
1answer
161 views

pset4 recover can create 50 images but all white and grey check

when I run my code, 50 images are produced but they are all white and grey checks. and when I run check50, the comments are below. I do not know what went wrong in my code. any suggestion would be ...
0
votes
1answer
55 views

pset4 recover: Segmentation fault - Unsure of fix

I am very new to programming and am having problems with a segmentation fault in the code below. Any sort of guidance on where I have gone wrong would be very much appreciated. It is most likely ...
0
votes
1answer
56 views

Can someone please explain why I am getting a segmentation fault ? (recover pset4)

#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { if(argc != 2) { fprintf(stderr, "please give the correct input."); return 1; } ...
0
votes
1answer
111 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
429 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
117 views

recover.c finds all 50 images but check50 doesn't see them

It looks like this will be one of many questions regarding this already on CS50SE... however I just can't figure this out at all despite looking through all the other questions of people who have this ...
0
votes
0answers
258 views

recover.c: recover 50 images, but not pass check50

Well, this is my third post regarding the same pset:recover.c, but I have made some improvements: I have recovered 50 images starting from 000.jpg until 049.jpg which were not shown at all in my ...
0
votes
1answer
215 views

pset4 recover.c segmentation fault fread/fwrite

I am trying to complete recover.c for pset4, but I am having major trouble debugging. I get a segmentation fault after the first fwrite step has occured, and it creates the fault at the fread step at ...
0
votes
1answer
412 views

CS50 pset 4 recover.c timed out while waiting for program to exit

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> typedef uint8_t BYTE; int main(int argc , char* argv[]){ //checking number of arguments ...
0
votes
1answer
64 views

pset4 recover: too many JPEGs found

guys! I was solving recover, but my program finds way too many JPEGs. I believe that this is because of the following lines: // starting bytes of jpeg are in [lower, upper] uint8_t lower[4] = {0xff, ...
0
votes
2answers
62 views

seg fault PSET4, recover

Having a problem with recover, getting a seg error when I step thru code at line 43-44. Appreciate any help making this run smoothly! #include <stdio.h> #include <stdlib.h> //variables ...
0
votes
1answer
64 views

pset4 Recover check50 error lack of image

I've finished my code and have recovered the photos, but in check50 it shows an error saying :) recover.c exists :) recover.c compiles :( handles lack of forensic image \ expected standard error, ...
0
votes
0answers
61 views

Having Trouble correctly reading bytes for pset4 recover

I've just started pset4 recover, and I wanted to make sure certain parts of the program would work well independently before I put it all together. So I started by making sure my program could ...
0
votes
0answers
28 views

PSET4: Recover error

#include<cs50.h> #include<stdio.h> int main(int argc, string argv[]) { if(argc!=2) { fprintf(stderr,"Usage: ./recover file_name\n"); return 1; } FILE *...
0
votes
1answer
96 views

Still having problems with recover.c, doesn't pass all the checks

Here is my code: include include include include int main(int argc, string argv[]) { // ensure proper usage if (argc != 2) { fprintf(stderr, "Usage: ./recover infile\n"); ...
0
votes
1answer
51 views

recover.c/pset4 doesn't open any jpeg

I have been for long on recover.c/pset4 but can't figure out what wrong am I doing . My code compiles but doesn't open any jpeg.Any suggestions will be appreciated!
0
votes
1answer
104 views

recover.c/pset4 not working plse help!

I am working on recover.c/pset4 and my code just exists & compiles & handles lck of forensic image , passes none of other checks. Check50 output is : :) recover.c exists :) recover.c compiles ...
0
votes
1answer
143 views

Detecting if we already found a jpg

I'm having trouble figuring out how to print extra 512bytes, if the first jpg is longer than that, like how to loop UNTIL it hits the next 4 header indicators. In this code example I've tried with a ...
0
votes
1answer
244 views

Recover pset4: help with pseudocode logic

I finally passed resize and now I'm on this pset. This time I'm trying to really focus on doing a good pseudocode since I feel a bit unsure about who to tackle the problem. In particular, I'm not sure ...
0
votes
1answer
63 views

PSET4 recover! dynamically allocated array does not seem to work

Hope all is well. This is probably a stupid question but I am going to ask it anyway. I have finally finished Recover (PSET4). I initially dynamically allocated an array as follows to store my 512 ...
0
votes
0answers
48 views

pset4-recover(what is wrong in my code??)

#include<stdio.h> #include<stdlib.h> int main(int argc,char* argv[]) { unsigned char buffer[512]; char filename[8]; int jpegfound=0; FILE *jpegimg = NULL; if(argc != ...
0
votes
0answers
134 views

PSET4 recover not passing check50

I get the output of all 50 images which can be viewed but it fails all CS50 checks. :) recover.c exists :) recover.c compiles :) handles lack of forensic image :( recovers 000.jpg correctly :( ...
0
votes
2answers
46 views

Some comprehension questions now that I've fixed my code

So i struggled probably a little less than some did with recover.c, and was able to fix my problems with the help of other's questions on this stackexchange, but although i was able to get my code ...
0
votes
1answer
36 views

compilation errors in recover.c pset4

here is the link to my code I don't understand the reasons for the errors in compiling: https://pastebin.com/KhrWPKec
0
votes
0answers
63 views

CS50 recover problem with junk data

EDIT: Okay, I appear to have found the problem. I was actually opening the file pointer when I declared FILE *outptr, instead of setting it to NULL. (I should have shown that bit of code...) That said,...
0
votes
1answer
177 views

Pset4 recover.c I'm able to recover all images. But Check50 is not passing

:) recover.c exists :) recover.c compiles :) handles lack of forensic image :) recovers 000.jpg correctly :( recovers middle files correctly :( recovers last file correctly I am able to see all 50 ...