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

How to write a fread function

Soo i'm a little confuse about the fread/fwrite function ... from what i understood in the videos, you need 4 input for those to work, let's use fread for the exemple fread("place to store the data",...
0
votes
1answer
56 views

PSET 4 Recover - Only recovering part of the photo?

My program to recover JPGs runs and creates the files, but was failing check50. So I ran the debugger, and it looks like it's only recovering a small portion of each JPG. Not sure what I'm doing ...
0
votes
1answer
68 views

Recover function in pset4

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <stdbool.h> /* Open memory card Repeat until end of card: Read 512 bytes of data into buffer If ...
0
votes
1answer
44 views

Image does not match in the recovery problem

fellow programmers! I've been stuck for days trying to solve this problem, but i can't really seem to find the error in this code, which opens all the images but they do not match when i use the ...
0
votes
1answer
31 views

Why my Recover images are Invalid or “Unsupported Image Format”?

I'm stuck in Recover. I've been trying for two days. Now my code opens 49 images but they are "Invalid or Unsupported Image Format. I can't identify where I'm going wrong, please help me. #include &...
0
votes
1answer
49 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
77 views

PSET4 Recover - Can't Read Card

Having a problem with Recover. The debugger shows that "buffer" is always 0000. Tried everything I could think of here. Any ideas? #include <stdio.h> #include <stdlib.h> #include <...
0
votes
1answer
46 views

CS50 Recover jpg files not found

I've been stuck on Recover for the last few days. I'm trying to work out why Submit tells me none of the jpg files are found. I've revised it multiple times, worked it out on paper... I can't figure ...
0
votes
1answer
73 views

Week 4 recover segmentation fault

I have spent two evenings on recover but I just can not figure it out. For the first time I managed to recover everything but the first image without any problems, so I did some searching and ...
0
votes
1answer
51 views

CS50 pset4 recover.c produces unsupported jpg images

Here is my code. Please help. #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <stdbool.h> #define BLOCK_SIZE 512 #define FILE_NAME_SIZE 8 typedef uint8_t ...
0
votes
1answer
34 views

pset 4 recover (My code compiles but does not do a thing)

Hello everyone so this is my code, it does compile and writes the recovers the first photo (that is 000.jpeg) but when it comes to continuing to the new jpeg it can only write one block(512BYTE) once ...
0
votes
1answer
314 views

(pset4) Fatal error: glibc detected an invalid stdio handle

everyone! I've been stuck with this one for a little while. Through debugging I found out that my problem is probably in the size parameter I'm trying to pass to fread() in line 33 (start of the while ...
0
votes
1answer
45 views

CS50 ~/pset4/recover Seg Fault

I have been trying to edit this code multiple times and keep getting a segmentation fault. I've tried debug50 and narrowed down the incorrect line to be on line 53 fwrite(block,sizeof(int),512,image) ...
0
votes
2answers
104 views

Why does my Cs50 recover programme correctly recover all images except the first one?

I wrote the below code and it recovers 51 images: 000.jpg to 050.jpg- all images except img 000 seem to have been found correctly. I'm not sure why the code isn't working? include include include ...
0
votes
1answer
52 views

PSET 4 Code fails two checks

Stuck on this problem for days and I can't figure out why my code is failing, I'll admit I'm struggling to really understand what my code is doing, like how the filename variable works. But I've ...
0
votes
0answers
48 views

Recover program: Can't produce the 50th jpg (049 jpg)

I've tried everything to get that last file, I even ran some printf statement test and the 4 indexes that show the start of a jpg are recognized 50 times in total but i'm still only able to produce 49 ...
0
votes
0answers
50 views

I am having trouble with the 2020 pset4 Recover assignment and even though my code compiles, it doesnt work, its not recovering the images

EDIT: I posted this 17 days ago please help. Heres my code and it wud be great if someone cud help A.S.A.P. thankyou! #include <stdio.h> #include <stdlib.h> #include<stdint.h> #...
0
votes
1answer
64 views

Recovers images, but Check50 is not happy!

I have successfully (or I guess not super successfully) recovers all 50 images, but where am I going wrong? Thanks! #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[])...
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
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
49 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
49 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
120 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
86 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
38 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
87 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
26 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
111 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
0answers
25 views

CS 50 Recover, Genrating blurred or pixalated images!

I have been stuck at this code for quiet a while now and i am finally able to generate all the images but the images are pixalated and not correct . I have seen online as why this might happen and ...
0
votes
1answer
128 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
0answers
39 views

Pset4 Recover Why does this work / what does it do?

Hi I'm working on pset4 recoverand I'm having trouble understanding something. My code does not work like it's suposed to, in fact it only creates 1 file "000.jpg" and that one isn't even readable. ...
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
88 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
37 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
112 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
122 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
58 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
73 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
75 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
57 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
109 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
49 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
72 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
41 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
0answers
30 views

strange bug in pset 4 recover

I solved pset 4 recover, but one of the bugs in my program which I removed, I found the code which was causing the problem but I don't know why it was. At the end of my program I was freeing up ...
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 ...

1 2
3
4 5
18