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
14 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 ...
0
votes
1answer
16 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 ...
0
votes
0answers
37 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 ...
0
votes
1answer
34 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) ...
0
votes
1answer
40 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&...
0
votes
1answer
15 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[])...
0
votes
1answer
31 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;...
0
votes
1answer
27 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 *' [-...
0
votes
1answer
16 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 ...
0
votes
2answers
35 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 ...
0
votes
1answer
21 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 "...
0
votes
0answers
23 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 <...
0
votes
1answer
33 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 &...
0
votes
1answer
25 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 ...
0
votes
1answer
35 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 ...
0
votes
1answer
35 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....
0
votes
1answer
29 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
26 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
2answers
43 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
45 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
29 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
32 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
0answers
15 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
32 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
35 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
20 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 ...
0
votes
1answer
35 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; ...
0
votes
1answer
53 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/...
1
vote
1answer
46 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 ...
0
votes
1answer
26 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; ...
0
votes
1answer
24 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 ...
0
votes
1answer
15 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 ...
0
votes
1answer
14 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 ...
0
votes
1answer
14 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
38 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 ...
0
votes
1answer
17 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 ...
0
votes
1answer
35 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
2answers
54 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 ...
0
votes
2answers
36 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 ...
0
votes
1answer
161 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 ...
0
votes
1answer
15 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?). ...
0
votes
1answer
28 views

Pset4 Recover debugging help: "While loop has empty body"

I'm working on the Recover problem, and I'm unable to fix this error I'm getting when trying to compile: "while loop has empty body" If you look at my code I think what should be happening ...
0
votes
1answer
53 views

Help with recover.c! I tried to use recursion

The lines which attempt to stop the recursion using EOF don't seem to work. Can anyone help me see why? #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string....
0
votes
1answer
25 views

Recover - PSet 4

I am for some reason unable to generate any jpgs with my code; I think there's a mistake in the logic somewhere? Would be very grateful for some hints! Thank you! #include <stdio.h> #include <...
0
votes
1answer
47 views

pset4 - Recover passed check50, but want to understand the logic on fwrite or file-pointer

Below are my code for pset4 - Recover, it passed the check50, but I am trying to understand the logic on a particular process of fwrite or file-pointer. In short, my question is how does line 74 know ...
0
votes
1answer
21 views

PSET 4 - Recover produces an infinite loop

I have been working through this problem and cannot figure out why this while loop is producing an infinite loop and no image files, which is probably caused by a logic error on my part. As far as I ...
0
votes
1answer
47 views

PS4 Recover Segmentation Fault (Core Dumped)

Hope you got into the new year well and healthy! I get a segmentation fault (core dumped) if I want to run ./recover card.raw Anyone got any tips because I have checked it 100 times already. Valgrind ...
0
votes
1answer
14 views

PSET4 - Recover - program timing out and not passing the check

could you please help me to understand why my program is not passing the check - the error says "timed out while program is trying to exit". It's compiling well, but seems to not even create ...
0
votes
1answer
22 views

PSET4 - Recover - Segmentation fault, not sure what's wrong

Can't understand what's wrong in my code: it's compiling but not creating jpgs, the check says "failed to execute program due to segmentation fault". Please help to understand - THANKS IN ...
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; //...

1
2 3 4 5
18