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.

170 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
1answer
113 views

Week 4: Recover (invalid stdio handle)

As I'm sure you're aware, the goal of this assignment is to recover a number of deleted jpeg files from a provided memory card image. My code compiles and executes, but I'm receiving the error "...
1
vote
1answer
58 views

How to skip loop iterations with debug50?

I'm struggling with the recover problem. I'm running a while loop that's more than 7 thousand iterations long. I get a segmentation fault because (i'm pretty sure) of the last or perhaps the last but ...
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) ...
1
vote
1answer
113 views

pset 4 - recover -> invalid pointer

i am trying to solve the recover issue. When I run my programm I get: * Error in `./recover': free(): invalid pointer: 0x0000000001da5200 * Aborted I don't know how to proceed. Can someone please ...
1
vote
1answer
140 views

pset4 recover - 16 images recovered with Invalid or Unsupported Image Format

I'm really confused. I reviewed all similar problems, but did find my case. It seems like jpeg start bytes are detected, but wrong data inserts to the output file. Please advise! 24-Oct-2016: The ...
1
vote
0answers
80 views

Why does chrome not work with server, but firefox does?

I got server (from pset6) working on Firefox, but not Chrome. Chrome will either not show anything, or just show a error message if there's an error. Everything works on Firefox, except it will not ...
0
votes
0answers
11 views

How do I interpret Valgrind to fix this program's segmentation fault?

I was attempting PSet 4's Recover but kept running into a segmentation fault. I tried using Valgrind to debug it but I have no idea of how to interpret the error message. My code: #include <stdio.h&...
0
votes
1answer
37 views

I really don't know why my code is not working pset4

I'm not good a programming but I'm really trying so I've been stuck for days in the same problem and any advice could be helpful Here's my code: #include <stdio.h> #include <stdlib.h> #...
0
votes
1answer
39 views

why does it fail check50 for the last image?

#include <stdlib.h> #include <stdio.h> typedef unsigned char BYTE; int main(int argc, char *argv[]) { if (argc != 2) { return 1; } FILE *infile = fopen(argv[1], &...
0
votes
0answers
23 views

Week 4 recover seg fault

#include <stdio.h> #include <stdlib.h> #define BYTE 512 #define NAME 8 int main(int argc, char *argv[]) { //check for valid input if(argc != 2) { //Promt user for valid input printf("...
0
votes
1answer
23 views

Pset4 Recover JPEG images do not match

Getting closer on Pset4 Recover but still working through some issues. I am now generating jpegs (yay!) but they apparently do not match the original images. So I am getting three errors: :( recovers ...
0
votes
0answers
21 views

Why are the recovered jpgs messed up?

Sorry for asking such a general question but I cannot understand why my code does not recover the images fully. In most of the images one can see a fraction of the image. check50 tells me that there ...
0
votes
1answer
24 views

Pset4 Recover Segmentation Error. Valgrind unable to find anything

I'm sorry to bring about yet another segmentation fault but I cannot for the life in me find the error (Even valgrind is kinda malfunctioning). Here's my code- #include <stdio.h> #include <...
0
votes
0answers
23 views

Recover, almost there… images doesn’t show correctly

I think I'm very close to getting this one right, but I've been trying different codes with the same results so I think my logic must be wrong. This code finds correctly the jpegs and creates the ...
0
votes
0answers
14 views

problem set 4 recover, segmentation fault

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: ./recover image\n"); ...
0
votes
1answer
34 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
32 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
32 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
34 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
0answers
34 views

Recover.c fprintf failing on the 35th file

So on the recover.c program, my program works to recover the first 34 images, but it segfaults on the 35th. I've determined that it has to do with the fprintf function, but it worked the first 34 ...
0
votes
0answers
18 views

Recover: Images actually duplicating

Edit: I checked the output and it turns out that I am getting duplicate images, can anyone help? So I finally finished Recover, and it works fantastically whenever I run it outside of check50. I ...
0
votes
1answer
40 views

I can only find 13 images using recover

I am aware that the same question has been asked before: PSET4 Recover only finds 13/16 images However, as far as I could try given this answer, I could not fix my function so it would successfully ...
0
votes
1answer
33 views

pset4: recover segmentation fault

The code compiles fine but when running ./recover i keep getting a seg fault. i tried valgrind but still can't seem to get what the problem is exactly. #include <stdio.h> #include <stdlib.h&...
0
votes
1answer
11 views

Find hex values inside a string in C?

I have a long string "given_string", and I'm trying to find hex values within that string. Here's a simplified example: /* Find a sub-string in a given string: */ char * given_string = &...
0
votes
0answers
24 views

Recover Assignment Memory Leak and Insufficient Recovery

I am trying to complete the assignment given by CS50x (Harvard Community Online, edX.org), and while it successfully recovers images, valgrind is telling me that there are memory leaks that happen in ...
0
votes
0answers
35 views

For pset4/recover i keep getting an error despite the pictures recovering when i run the program

could someone please identify whats wrong with my code. im a beginner and completely lost.
0
votes
1answer
60 views

PSET4, RECOVER: Segmentation Fault

I have been trying to solve RECOVER from PSET4 and I keep getting a segmentation fault. Any ideas on why this happens? #include <stdio.h> #include <stdlib.h> #include <stdint.h> ...
0
votes
0answers
26 views

Segfault error, please help

I really need help, I'm getting a segfault error. Please look through my code and help me, please. #include <stdio.h> #include <stdlib.h> #include <stdint.h> int main(int argc, char ...
0
votes
0answers
39 views

fread() return value

I am working on recover, currently pset, and only my last photo is not processing properly. I am calling fread(buffer, 1, 512, inptr) to read 512 bytes of data at a time. The video says fread ...
0
votes
1answer
96 views

CS50/PSET4/RECOVER- Error- “Can't open card.raw: file format unsupported”

Keep getting "Can't open card.raw: file format unsupported" error when running the code. Not sure what I'm doing wrong. #include <stdio.h> #include <stdlib.h> int main(int argc, char *...
0
votes
1answer
51 views

PSET4 Recover, Dynamic File Names

So far I've gotten to the point where I can recover one image. I'm to the point where I need to find a good way to make dynamic variable names. I thought of one way to do it, but it seems rather ...
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
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
2answers
105 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
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
114 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
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
89 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&...
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
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 ...
0
votes
1answer
111 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 ...