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
50 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
45 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
50 views

CS50 Recover JPG's not rendering correctly

My code is recovering 50 images, but according to check50 the images are not being recovered correctly. A few of the images are obviously not recovering but I can't figure out why in my code. Several ...
0
votes
2answers
53 views

CS50 pset 4 recover, only two images recovered

I am currently working on pset4 recover.c. My code complies correctly, but when I run it, only two files are outputted (000.jpg & 001.jpg), which I believe there should be 50 files. I'm not sure ...
0
votes
1answer
143 views

CS50 Recover - Need Help

Please help me by reviewing the code below. Cant seem to crack it. Errors are as below: :( recovers 000.jpg correctly timed out while waiting for program to exit :( recovers middle images ...
0
votes
1answer
95 views

pset4 recover - rick rolled - thinking about this the wrong way?

This is my humble, little code. The comments shows my though process: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if(argc != 2) { printf("...
0
votes
1answer
42 views

PSET4 Recover Segmentation Fault Questions

I've managed to complete recover however I want to understand the following segemntation fault issues: 1) Why if i use char * for a string for the filename variable it comes with an error? If i use ...
0
votes
1answer
88 views

Pset4 recover. Im getting a check50 error .Searched for days . I still dont know

:) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :) recovers 000.jpg correctly :) recovers middle images correctly :( recovers 049.jpg correctly recovered image does ...
0
votes
1answer
27 views

Pset4 Recover: Code generates blurry, discoloured images

My code below compiles and generates 50 images, but all appear blurry or are a coloured mess. I've tried debugging but without success. I must be missing a logical step. May anyone advise? #include &...
0
votes
1answer
137 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
178 views

pset4 recover issue with first recovered image

Hello I've been working on recoverfor sevreal days now and I've finally got it to work, almost. It compiles just fine, responds properly to a lack of forensic image, creates and properly names 51 jpg ...
0
votes
1answer
24 views

Recover : if condition seems to not work

I have problemes with my code for Recover. It compiles ok but when i try it I have a segmentation fault. So i looked with debug50 and it seems that my if conditions is never true, so my code just go ...
0
votes
1answer
126 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
0answers
39 views

Pset4 Recover segmentation error

Help needed with recover part of pset4. Please find my code below. It compiles but produces a seg fault. Any comments are welcome. Thanks in advance. #include <stdio.h> #include <stdlib.h&...
1
vote
2answers
117 views

CS50 PSET4 RECOVER.C SEGMENTATION FAULT PLEASE HELP!

I'm seriously struggling with this assignment and I can't seem to find the problem in my code. I'm supposed to create a program that reads a raw card one block at a time with each block containing ...
0
votes
1answer
133 views

Pset4 Recover conceptually struggling

Pset4 Recover is different since it uses files; fopen, fcloser, fprintf, and fread. It adds a whole new dimension to the coding. Its change from just formatting conceptions to making sure all the ...
0
votes
2answers
57 views

Can't write jpegs in recover, segmentation fault

here's the code i wrote: #include <stdio.h> #include <stdint.h> #include <stdlib.h> typedef uint8_t BYTE; //take command line argument from the user for the file name int main(int ...
0
votes
1answer
59 views

Recover doesn't provide any images

Not sure why there are not results from this program, recover literally does nothing. Better than my old program that created over 500 images I guess. #include <stdio.h> #include <stdlib.h&...
0
votes
1answer
70 views

pset4 recover incorrectly generate images

I need your help with pset4 recover, as image does not recover correctly. And I would like to have more understanding on how file pointer works. Below is what I have written which generate no correct ...
0
votes
1answer
99 views

Using fseek in Pset4 recover to iterate through the binary file (one 512 Byte block at a time)

I just have a conceptual question for how fread and fseek works in the context of the pset4's recover assignment. Initially when I was trying to write my program for this assignment, I was using fseek ...
0
votes
1answer
117 views

Pset 4 - Fopen returns NULL

Currently working on the Pset4 recover.c assignment. My code compiles correctly, however, when I execute, fopen return NULL. Based on my understanding from the shorts on file pointer and the lecture, ...
0
votes
1answer
65 views

pset4 Recover - need to break (^C) to exit

I'm recovering the files just fine, but my program seems stuck in the while loop. I've tried adding extra closing statements and adding else statements, but I can't seem to find where/why it won't ...
0
votes
1answer
110 views

Please could I get some help with pset4 recover

Please could I get some help with my code for Pset4's recover? I have been stuck on it for about 8 hours today and cannot work out why it isn't working. I think the current issue is that my current[] ...
0
votes
1answer
73 views

Pset3 Recover - need some help with my logic. Compiles but generates nothing

struggling as usual. I can't seem to figure out what I'm missing here. It compiles ok but when I run it nothing seems to happen. Any pointers to what I am missing? It is probably something looking ...
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
73 views

One tiny step to completion. Recover recovers all images except the first one. Help!

Alrighty. I just need someone to point out to me where the issue is so i can finish this thing. submit it. and move on. i'm so so close. so help would be greatly appreciated. // include libraries #...
0
votes
1answer
46 views

How to identify cause of Segmentation Faults?

Working on problem set 4- Recover but keep getting Segmentation Fault. Tried valgrind too, but could not figure it out. Could anyone kindly anyone look into the code and tell me where does the ...
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
119 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
49 views

Help with pset5 'recover': incomplete jpgs

I´ve been working on recover for the past few days and I am having some trouble getting a working solution. The code below prints out 49 jpgs instead of 50, and they are all incomplete or very blurry. ...
0
votes
1answer
21 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
60 views

PSET 4- RECOVER getting 22 pictures and none good

I keep looking my code and connot identify what is going on. I open 22 pictures, but none of them are good. It doesn't even write in the entire picture, some of them just a part of the picture is ...
0
votes
1answer
98 views

Pset4/recover: code is working fine but the recoverd images are not correct

I have written this code. The code seems to work fine but the images are not correct they are distorted. I have attached those photos below. Can you please help me and tell me where I went wrong in ...
0
votes
1answer
79 views

PSET4 Recover- code working fine except recovered image 49 does not match

I keep ending up with this last error on Check50 - any tips? int main(int argc, char *argv[]) { // Check for invalid usage if (argc != 2) { printf("Usage: Recover [...
0
votes
2answers
148 views

pset4 recover - timed out while waiting for program to exit

Whenever I run my code using check50, I get this error: "timed out while waiting for program to exit", and I don't know why this is happening. Any help would be greatly appreciated. Here's my code: #...
0
votes
1answer
57 views

Pset4 Recover: Program works perfectly but jpeg 1 name is not three digits for some reason HELP!

Everything works except the first jpeg gets the name 1 instead of 001 #include <stdio.h> #include <stdlib.h> #include <stdint.h> //includes BYTE struct #include <cs50.h> ...
0
votes
1answer
65 views

pset4 recover: 'recovered image does not match'

My program recovers the images but the recovered images are all blank and check50 says that they "don't match". All the images are 512 bytes in size. Please help me find out why this is happening. My ...
0
votes
1answer
52 views

Recovered Images not clear

I having trouble generating clear images. I am able to generate the 50 JPEGs but they are just random colors or pixelated. I am however, not receiving an "Invalid or unsupported" file format error. I ...
0
votes
1answer
1k views

cs50 pset4 recover 2020

I have been working on pset4 recover, but it is bringing one error how can i rectify it? Here is my code FILE* card_ptr = fopen("card.raw", "r"); if (card_ptr == NULL) { printf("...
0
votes
1answer
85 views

pset4: recover last check wrong

All check correct and it recovers all 50 images but I have this problem and I can't solve it. I know I must find return number from fread function but the return number is 1 no all the elements that ...
0
votes
1answer
59 views

Why is it saying it did not recover any images?

So it seems like I am almost done with recover. My code recover all the pictures except the fist one and last one. On the first one it only recovers a small block on the top right corner. Also the ...
0
votes
1answer
366 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
71 views

Why is fwrite not writing the image except for the second one?

So my code creates the correct number of files in the correct format but they are all empty with the exception of number two that had the first couple of lines but the rest is also empty. Why is it ...
0
votes
1answer
73 views

Why is nothing happening?

I know their is defiantly something wrong and missing to my code but i'm stuck and can't figure out what is missing. It complies and when I run it does not do anything visible. #include <stdio....
0
votes
1answer
73 views

Recover PSET 4 - 26 Invalid Images

Been struggling with the recover PSET for a while now, my code recovers 26 images but when i try to open them i get the following error "Invalid or Unsupported Image Format ". I believe it's because ...
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 ...
1
vote
0answers
24 views

Empty pointer values in Pset 3: “Recover”

I know pointers don't have to be used in this pset, but my first attempt relies on them. The program has other bugs, but I'm wondering why my pointer variable doesn't get values (keep staying empty) ...
0
votes
1answer
61 views

pset 3 Recover Segmentation fault

So, after some manipulations with my code I`ve got to Segmentation fault. Here is my code so far #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { // ensure ...
0
votes
2answers
86 views

recover.c images recovering correctly, but 049.jpg test case failing

The title explains the issue, not really sure why the test case is failing because the logic seems to work. I'm assuming it has to do with reading some unnecessary bytes near the end, but I haven't ...

1 2 3
4
5
18