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
1 answer
30 views

PSET4 - Recover - set output file pointer to NULL

case 1: FILE *file_out = NULL; case 2: FILE *file_out; "file_out" is a newly defined file pointer to where the recovered JPEG blocks will be written to. I tried both case 1 and case 2 and ...
user avatar
0 votes
1 answer
35 views

Pset4 (cs50) fails check50 (segmentation fault)

Here's my code : #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { printf("./...
user avatar
0 votes
1 answer
50 views

pset4 recover: segmentation fault when closing file

I have been stuck with this segmentation fault for quite a while now. After running valgrind I was able to determine that it happens when I close the output file at the end of the code, but I have no ...
user avatar
  • 1
0 votes
1 answer
36 views

pset4 recover not working due to segmentation fault

I have come up with this code for recover but there is a segmentation fault I can't figure out where. any pointers welcome. BYTE buffer[512]; int i = 0; FILE *jpeg = NULL; while (fread(...
user avatar
0 votes
1 answer
26 views

Recover: invalid or unsupported image format. All new jpegs show in folder

// Recovers Jpegs from Memory card #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { // Return 1 if more then 1 arg ...
user avatar
  • 1
0 votes
0 answers
18 views

PSET-4 Recover. Getting a segmentation fault even though the program compiles correctly [duplicate]

Here is my code #include <stdio.h> #include <stdlib.h> #include <string.h> #include <cs50.h> #include <stdint.h> //defining new type typedef uint8_t BYTE; //defining ...
user avatar
  • 5
0 votes
1 answer
54 views

Code compiles but files are not read. Recover pset4

Trying to find the problem i could track it to the else statement where ""printf("Could not open file because NULL.\n");"" is located. The files are not read at all or ...
user avatar
0 votes
1 answer
36 views

Why the pixels are not rendering correctly in recover problem?

I am working on recover problem and suffice to say I am just a beginner. Here is my code: #include <stdio.h> #include <stdlib.h> #include "stdint.h" #include "stdbool.h"...
user avatar
0 votes
1 answer
46 views

Pset4 recover 000.jpg 001.jpg 049.jpg are not found

PLEASE I am dying: I am searching for hours for the problem, but I can't find it. It compiles. At least 000. and 001. should be found but I get these results and I am full of remorse. Where could be ...
user avatar
0 votes
1 answer
62 views

Recovering problem

While debugging, the compiler doesn't enter the condition (although it should be entered at the first iteration), also I get segmentation fault in the fwrite line after the conidion I 'm including ...
user avatar
0 votes
1 answer
45 views

pset4 recover doesn't recognize jpegs

I've been working on Recover for quite many hours now and I can't really understand what is wrong. Here I share my commented code. What I can tell you about its behavior is the following: It does not ...
user avatar
0 votes
1 answer
40 views

Im busy with problem set 4(recover) and the image says Invalid or unsupported format. The sizes of the images look legit

I am not sure why my images are unsupported. Everything looks as if it works until you try to open the images. Even the image sizes look correct.(meaning they aren't 0bytes or all the same size or 512 ...
user avatar
  • 7
0 votes
0 answers
79 views

Academic honesty

Question about the Academic Honesty after working on recover problem for more than 10 hours and watching the lecture , shorts , and walking through several times , and still facing lots of errors and ...
user avatar
0 votes
1 answer
63 views

pset 4 recover, I can compile but no JPEGs returned

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

CS50 PSET4 recover Segmentation Fault

Can someone point out why this code is resulting in segmentation fault? It's a code for the 'recover' question in pset4, cs50. #include <stdio.h> #include <stdlib.h> #include <stdint.h&...
user avatar
  • 3
0 votes
1 answer
24 views

PSET4/Recover -- Why am I getting "double free or corruption (top)"?

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int counter = 0; char filename[8]; FILE *img; BYTE buffer[512]; int main(int argc, char *argv[])...
user avatar
0 votes
1 answer
47 views

Pset4 recover produces only 2 corrupted iamges

I am at Pset4 recover pset. When I run my code, it produces only 2 corrupted images here is my code : #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE;...
user avatar
0 votes
1 answer
135 views

PSET4 Recover error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *

I am at PSet4-recover. I can't compile code properly. Always get these errors : recover.c:47:31: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-...
user avatar
0 votes
1 answer
37 views

Debug50 won't even open and I don't know what step to take next in lab4 Recover

Because I can't get debug50 to help me out, I don't know where to start to debug this program. I think I have an infinite loop somewhere, but I'm not sure. Any help to get me started on right path ...
user avatar
  • 14
0 votes
2 answers
60 views

Pset 4 Recover - How to check for first jpeg?

I feel like I have been able to implement the majority of the pseudocode but I am struggling to think of a way to find the first jpeg. I thought my code would work but it doesn't as buffer[0]... etc ...
user avatar
0 votes
1 answer
35 views

Getting an "Invalid or Unsupported Image Format" while trying to open images (Recover, Pset4)

I'm currently trying out CS50's Recover (PSET4). The program compiles and I manage to get back all the 50 jpgs. But I can't open them because the image isn't correctly returned and I get an "...
user avatar
0 votes
0 answers
53 views

CS50/pset4/recover doesnt recover img 49

Hei All, I am running my version of recover and check50 validates every check apart from the last one This is my code. I really cant figure out what's wrong. #include <stdio.h> #include <...
user avatar
  • 1
0 votes
1 answer
44 views

PSET4 Recover - Cannot identify the error in my program

I'm currently trying out CS50's Recover (PSET4). The program compiles but the only output I get when I run it is 000.jpg; That too I can't open because the image isn't correctly returned and I get an &...
user avatar
0 votes
1 answer
61 views

(PSET 4 - Recover) Why is first recovered image blank?

I am on problem set 4 recover and I have nearly completed it. I have written my code and it compiles but when I run it on the card.raw file it appears to recover all the 50 photos except the 1st one ...
user avatar
0 votes
1 answer
40 views

My Program is not recovering the jpegs correctly

My program is compiling properly it is even recovering the images but when I am opening the image to view, it is not opening. It is showing "Invalid or Unsupported file format". Please look ...
user avatar
0 votes
1 answer
81 views

pset4 recover fread segmentation fault

guys I want to ask why am I constantly getting segfault with second fread inside of a while loop after checking jpeg header. first fread works perfectly going through first several 512bytes of card....
user avatar
0 votes
1 answer
35 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> #...
user avatar
0 votes
1 answer
31 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 ...
user avatar
0 votes
2 answers
55 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 ...
user avatar
0 votes
1 answer
54 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 ...
user avatar
0 votes
1 answer
50 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 ...
user avatar
  • 1
0 votes
1 answer
35 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 ...
user avatar
0 votes
1 answer
37 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 ...
user avatar
0 votes
1 answer
49 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'...
user avatar
0 votes
1 answer
26 views

Recover PSET4 Corrupt images

i was working on pset4 recover and my code finds all the image, but everytime it writes to the image the image got corrupted, and i cant find the issue, checked the debugger and it seems going the way ...
user avatar
0 votes
1 answer
43 views

Wrote a simple recover.c program to extract the first image from card.raw but the image is corrupted?

that is the code I wrote can anyone tell what is wrong with my code!! FILE *file = fopen(argv[1], "rb"); FILE *outptr = fopen("000.jpg", "wb"); typedef uint8_t BYTE; ...
user avatar
0 votes
1 answer
63 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/...
user avatar
1 vote
1 answer
51 views

Recover - segmentation fault and other general problems

Hey guys so I've hit a bit of a wall with Recover, when I run my program I get segmentation fault but I also don't know how to end off one jpeg when another header pops up? In essence, I'm not sure ...
user avatar
  • 139
0 votes
1 answer
44 views

PSET4 Recover fread/fwrite

PSET 4 is really taking me for a wild ride that I am not enjoying whatsoever. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> int num = 0; ...
user avatar
0 votes
1 answer
30 views

Recover finding all images but not passing check50

I know this has been brought up a few times before but none of the solutions seem to be relevant to the code that I have written below. My recover.c file compiles, executes and returns all 50 images ...
user avatar
0 votes
1 answer
21 views

Segmentation and bool fault in recover.c

Can anyone help? I keep getting a segmentation fault when trying to run recover.c. It compiles fine. My code is below. I do plan to add in the error returns once I can get this to work properly as ...
user avatar
0 votes
1 answer
15 views

CS50 Recover pset is causing segmentation fault

This is question is fairly common here, but I haven't seen code similar to mine. This has led me to doubt my screen thoroughly, so I come here asking for help. It doesn't throw any errors with either ...
user avatar
0 votes
1 answer
18 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&...
user avatar
  • 1
0 votes
1 answer
64 views

Recover code makes 000.jpg to 049.jpg, but jpgs are corrupt

I've been working on this problem for a little bit, but right now I have no clue why my code isn't working. Right now it spits out the 50 jpgs like it's supposed to, but they're all blank. Anyone have ...
user avatar
  • 3
0 votes
1 answer
21 views

PSET4 Recover Problem

This is the result of my code: :) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :( recovers 000.jpg correctly recovered image does not match :( recovers middle images ...
user avatar
0 votes
1 answer
45 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 ...
user avatar
0 votes
3 answers
274 views

Pset4 recover segmentation fault when running

Finished the problem but when running check50 gets segmentantion faultand running ./recover card.raw . The error code is the following: :) recover.c exists. :) recover.c compiles. :) handles lack of ...
user avatar
0 votes
2 answers
43 views

Getting a segmentation fault in pset4 recover

I'm getting a segmentation fault when trying to run my program for pset4 recover. I've been trying for ages to debug it, but I'm finding it really difficult because when I try to use debug50, after ...
user avatar
0 votes
1 answer
369 views

cs50 2021 pset4 recover help

EDIT: Ok after trying for 3 hours after posting this I have finally managed to solve this pset. The problem wasn't actually a logical one but rather it was a problem with the type definition and the ...
user avatar
0 votes
1 answer
22 views

When I'm creating array

This has me confused. In the following code, I create an array of characters initialized at size 7. The array needs to store at least 6 characters, so I've made it large enough to do that (I think?). ...
user avatar

1
2 3 4 5
19