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

Pset4 Recover Segmentation Error. Valgrind unable to find anything

I'm sorry to bring about yet another segmentation fault but I cannot for the life in me find the error (Even valgrind is kinda malfunctioning). Here's my code- #include <stdio.h> #include <...
0
votes
1answer
35 views

Issue with Recover code.While using cs50 check it fails giving the following message : timed out while waiting for program to exit

#include <stdio.h> #include <cs50.h> #include <stdint.h> #include <stdlib.h> #define BLOCK_SIZE 512 #define FILE_NAME_SIZE 8 typedef uint8_t BYTE; bool is_start_new_jpeg(BYTE ...
0
votes
1answer
38 views

PSET4 Recover - Code gets stuck at if statement

I'm working on the recover problem, but when my code gets to the if statement I made that checks for the header of a JPEG file, it gets stuck. I get no errors, it simply stops iterating through the ...
0
votes
2answers
18 views

CS50 Recover (Pset4). What exactly is causing the segmentation fault?

CS50 NEWBIE here. Program successfully compiles but I keep getting a segmentation fault error when trying to run it. After some debugging, I think the problem has something to do with trying to close ...
0
votes
1answer
15 views

why does it fail check50 for the last image?

#include <stdlib.h> #include <stdio.h> typedef unsigned char BYTE; int main(int argc, char *argv[]) { if (argc != 2) { return 1; } FILE *infile = fopen(argv[1], "r"); FILE *...
0
votes
1answer
60 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
59 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
30 views

Recover Week 4 Assignment--Code appears to work beautifully but check50 says no

My code works as I get all 0-49 images that look beautiful to me. After days of working on this, I really would appreciate any advice as to why the checker is saying my code failed the last three ...
0
votes
1answer
30 views

I'm working on CS50 Recover, but my images aren't showing up and I can't figure out why

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

Week 4 recover seg fault

#include <stdio.h> #include <stdlib.h> #define BYTE 512 #define NAME 8 int main(int argc, char *argv[]) { //check for valid input if(argc != 2) { //Promt user for valid input printf("...
0
votes
1answer
95 views

PSET4 Recover, don't know how to go through the blocks of data!

I am content on how to read a single 512 byte block in recover, however I'm extremely confused on how to go through the rest of the blocks of the memory card i.e can you do this using fread? I was ...
0
votes
1answer
52 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
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
1answer
31 views

pset4-recover: can get 50 photos but a column on the left appears on the right, problems of colors and on the first portion of the photo

I've tried some different values with fread() an with fwrite() but had no new results. On the right in some pictures appears, like a column, part of the image that should be at the left, and in some ...
0
votes
1answer
22 views

So i have written the recovery code which compiles but all the images are Invalid and Unsuported format

#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { if (argc < 2) { printf("Usage: ./recover image\n"); ...
0
votes
1answer
31 views

PSET4 Recover: Check50 shows error

#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> typedef char* string; typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { ...
0
votes
1answer
74 views

PSET4 Recover Segmentation Fault Help

Edit: It has been resolved. I figured it out. Anyone who has similar problem may check my answers below. Try to skip over my code to avoid spoiling yourself. // // // // I have been stuck with ...
0
votes
1answer
27 views

Pset4 Recover Problem With Seg Fault *Updated*

Getting closer on this now and am no longer getting a segmentation fault. However, my Jpeg images created by the program are not correct. I think part of the problem is that I am writing rather than ...
0
votes
1answer
29 views

Pset 4 Recover Issue

I am 2 days into PSET 4 Recover. I can get the program to compile successfully without errors but my program is not returning any JPEGs, with no errors to point me in any direction as to what might be ...
0
votes
1answer
21 views

pset4 recover error - timed out while waiting for program to exit

i am getting a timed out error but don t understand why...? also i can see all the pictures except the last one (049.jpg) ... #include <stdio.h> #include <stdlib.h> int main(int argc, ...
0
votes
1answer
60 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
1answer
13 views

Pset4 Recover JPEG images do not match

Getting closer on Pset4 Recover but still working through some issues. I am now generating jpegs (yay!) but they apparently do not match the original images. So I am getting three errors: :( recovers ...
0
votes
1answer
45 views

“File size limit exceeded” in Recover - how does file writing work?

I've been quite frustrated by trying to make progress in Recover. When I run my code, I am unable to make even the first JPEG file as the program continues running until the file size is exceeded. I ...
0
votes
1answer
82 views

Recover from getting 8 images to now just 1 image and terminal hanging

Ok now for the last 48 hours I have been trying to make recover work. First I made a program that got only 8 correct images. I posted my problem in this link and got a response and understood how my ...
0
votes
1answer
33 views

pset4 - can't figure out what i'm doing wrong - recover

This is the code: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if (argc != 2) { return 1; } FILE *file = fopen(argv[1], "r&...
0
votes
1answer
48 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
57 views

Recover: While loop repeats but does'nt add variable

My code: //create space save info from card unsigned char buffer[512]; int jpgCount = 0; char title[7]; do { if (buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff) { ...
0
votes
0answers
16 views

Why are the recovered jpgs messed up?

Sorry for asking such a general question but I cannot understand why my code does not recover the images fully. In most of the images one can see a fraction of the image. check50 tells me that there ...
0
votes
1answer
63 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
1answer
72 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
23 views

Pset4 Recover Creating Segmentation Fault

Trying to work through Pset4 Recover. Currently getting a segmentation fault and not opening any new jpegs. My logic thinking here was to: Make sure user submits just 1 command line argument Open ...
0
votes
0answers
17 views

Recover, almost there… images doesn’t show correctly

I think I'm very close to getting this one right, but I've been trying different codes with the same results so I think my logic must be wrong. This code finds correctly the jpegs and creates the ...
0
votes
1answer
61 views

Why does my program return a blank jpeg?

I have started recover.c in pset4. I have decided to approach the problem step by step, so first task is recovering the first jpeg. enter code here FILE* file = fopen("card.raw", "r"); ...
0
votes
1answer
209 views

pset4 recover doesn't pass check50

i have gone through the answers already posted but they don't seem to handle my exception. this is my code: /** * recover.c * * Computer Science 50 * Problem Set 4 * * Recovers JPEGs from a ...
0
votes
1answer
48 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
2answers
45 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
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
62 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
1answer
31 views

pset4 recover: Not getting as many files as the problem requires

After reading a few submissions for help here and in the subreddit, People have told me there should be 50 files in the memory card. I have made a loop that correctly reads the file, but as soon as I ...
0
votes
1answer
90 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
42 views

Help pls pset4 - recover the checkl says To do

My code is here :https://github.com/volvovics/Cs50-course-projects/blob/master/recover.c It fails the last 2 point of the checklist. For the middle files and last file it says to do. I can't figure ...
0
votes
1answer
53 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
47 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
34 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
1answer
64 views

PSET4 Recover Passes Check50 but throws Seg Fault

Last night, recover.c worked fine. Today, it compiles and, after I run ./recover, promptly throws a seg fault. At times, it has claimed it cannot open "card.raw" though the syntax is perfect. For fun,...
0
votes
1answer
49 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
48 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
28 views

Pset4 Recovery Produces Corrupt Null Files & Skips An Image

I've been working at recovery for a while - I believe I'm nearly done with it - but right now my code is giving me serious problems. Currently, running ./recover card.raw produces 49 of the 50 images (...
0
votes
1answer
26 views

CS50 pset 4 Recovery timed out even though everything compiles

There seems to be an infinite loop in my program that I'm unable to find, could someone please help me Here's my code #include <stdio.h> #include <stdlib.h> #include <cs50.h> #...
0
votes
1answer
127 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 ...

1
2 3 4 5
17