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

Need clarity for Problem Set4 recover

I am working on set4 recover My program is always printing "Testing EOF", hence it looks card file is empty. Here is my code in detail. #include <stdio.h> #include <stdlib.h> #...
0
votes
1answer
51 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
1answer
27 views

Segmentation Fault in CS50 Recover - pset4

I would appreciate some guidance on the below issue. I have seen the other threads with the same issue but haven't had any luck applying those fixes. I am getting the below error in my code and I can'...
0
votes
1answer
12 views

pset4 Recovered image doesnt match

I´m trying to solve the pset4 recover challenge, but i havent been able to make the program recover the full image, only one part of it. What am i doing wrong ?? This is my code: #include <stdio.h&...
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
42 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

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
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
40 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
1answer
142 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
12 views

Pset 4 Recover output shows Segmentation Fault

#include <stdlib.h> #include <stdint.h> //to use uint8_t as BYTE typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { printf("INVALID. There ...
0
votes
1answer
83 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
2answers
38 views

CS50 Recover - fread into buffer

I am working on CS50 Recovery and I am unable to get the program to check the JPEG starting header. I used debug50 and added a couple print statements to try and find the problem. Every time I run the ...
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
42 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
139 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
79 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
41 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
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
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
1answer
34 views

PSET4 Recover, output files are blank

Honestly, I have been struggling with Week 4, and I have been trying to complete this pset to the best of of my current understanding. I have researched multiple articles on this topic, but I have yet ...
0
votes
1answer
28 views

Regarding PSET4: Recover is compiled but only 26 files are recovered but unable to open images

#include <stdio.h> //call for sprintf() #include <stdint.h> //call for typedef uint8_t BYTE #include <stdlib.h> //call for sizeof() and NULL typedef uint8_t BYTE; //...
0
votes
1answer
28 views

CS50 Recover recovering corrupted images, and only 43 images

I'm attempting to solve the Recover problem, and I'm using a for loop to go through the bytes of the raw file. It spits out 43 images, some of which have the full image, but most are corrupted, and ...
0
votes
1answer
27 views

Where am I mystaking ? pset4-RECOVER

I've been rewriting that code for about a week now and start beeing very confused about what I am doing wrong, I hope my logic isn't fully wrong but I have some doubts about my understanding of ...
0
votes
1answer
20 views

Pset4/recover: Why does it not works? Image names are correct. But it doesn't match. Please help?

:) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :( recovers 000.jpg correctly recovered image does not match :( recovers middle images correctly recovered image ...
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
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
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
43 views

Problem with Recover (Pset4)

everyone. I've been struggling with the Recover problem of Pset4. I really don't understand why I'm getting the following error message when applying the Check50 control: *Results for cs50/problems/...
0
votes
1answer
64 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
211 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
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
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
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
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
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
0answers
13 views

Pset4 able to compile but unable to recover images

My code compiled successfully and it passed check50,but when I implemented it, nothing occurred and no jpg file is created. Can anyone help me figure out what happened? [EDIT: Code removed for Harvard ...
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
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
18 views

PSET4 RECOVERY does not recover images correctly

I have started working on PSET 4 RECOVERY. My program compiles successfully, it goes through the first 3 tests no problem, but for the love of me I cannot seem to find the problem. It just does not ...
0
votes
1answer
66 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
282 views

pset 4 - recover - Segmentation fault reading into buffer

My program makes one image, then has a segmentation fault. Using GDB, I can see that the segmentation fault happens on the next iteration of the loop after creating the first jpeg. Looking more, I ...
0
votes
1answer
35 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 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
43 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
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
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
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
409 views

recover finds images but check50 provides killed by server error / pset4

Recover.c appears to be working. Creates 15 jpgs and they look proper. Valgrnd suggests no memory leaks/losses. I am at a loss. > :) recover.c exists :) recover.c compiles :( recovers 000.jpg &...
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; } ...

1
2 3 4 5
18