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
1
vote
2answers
262 views

i'm able to recover the 49th image but does check50 says unable to recover the 49th image

I spent hours but still then i'm not able to understand that why does check50 does not recognize my 49th recovered image eventhough i have recovered that image and i can see that the image is of ...
1
vote
2answers
625 views

check50 says “bmp.h” not found even though “bmp.h” is in jpg directory

Hello all I have a question about compiling what I've written for recover.c The compiler shows me this message when I try to compile recover: " expected an exit code of 0, not standard error of ...
1
vote
1answer
2k views

recover end of file detection

I'm having a lot of trouble with recover. I have written some code, just to get the basic structure. I was trying to iterate over the raw file until the end, printing when stumbled upon a jpeg. ...
1
vote
1answer
377 views

Recover.c Segmentation Fault

Pseudocode: declare counter declare filename[8] main Open input Declare buffer do read(512 bytes into buffer from input) while (not start of jpeg) do write filename open ...
1
vote
1answer
26 views

pset 4 - recover, can't figure out mistake

I can't figure out what I'm doing wrong, please help! #include <cs50.h> #include <stdio.h> #include <stdlib.h> #define BUFFER_SIZE 512 int main(void) { // open memory ...
1
vote
1answer
61 views

PSET4 Recover, cannot seem to find my mistake - Recovered image does not match

I've been struggling to finish PSET4 Recover. I have followed the walkthroughs and I feel like I have incorporated every step they explain, yet when running check50, it shows that all of the recovered ...
1
vote
2answers
113 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 ...
1
vote
1answer
192 views

pset3 recover not sure how the code works

I'm taking baby steps towards writing the code for recover. So far I have written this: int count = 0; int blocks = 0; // Loops through the whole card. while (feof(card_in) == 0) { // declares ...
1
vote
1answer
329 views

Can't recover 000.jpg

First time poster here. Cannot figure out why I can't recover this one image. And any time I make changes to the code to get at it, I end up losing all the images. Please help. // Recovers jpeg ...
1
vote
1answer
166 views

PSET4 Recover produces JPGs, but passes CS50 check only partially

My PSET 4 Recover code is able to recover the 50 jpg's from the raw file. However, when checking the code with the check50 it only partially passes. I checked a lot other related issues on SE CS50 ...
1
vote
2answers
155 views

output blurry, incomplete

thanks in advance for your patience. While working on the recover portion of pset4, I'm running into a problem. My code below compiles, but when I run it with card.raw as its input, I only get 26 ...
1
vote
2answers
54 views

2 check50 errors to go

My program creates 50 jpegs run once no errors! ... Pseudocode: while fread buffer from card.raw while first 4 bytes is jpeg header // start of jpeg create filename fopen ...
1
vote
1answer
525 views

CS50 pset4 recover: buffer type and fseek questions

I have figured out a solution to recover, but my first attempt did not work. I'd like to understand a couple of things from my original attempt so I don't repeat the same errors in future code. ...
1
vote
1answer
683 views

Pset4 recover using fread as condition

In the walkthrough Zamyla mentions using fread as a condition. I've tried using it as the while condition, hoping the loop would stop when fread returns 0 but I get only 26 heavily distorted jpegs ...
1
vote
1answer
216 views

PSET4 Recover: What struct do I create? [duplicate]

Dear CS50 fellow geeks, Zamyla mentions creating a struct the walkthrough. I am lost as to what type of struct I should create. What should be in the struct?
1
vote
1answer
276 views

How to initiate debug50 when a variable reaches a certain value?

I am working on recover.c and I need to debug my code by watching the variable states. However, stepping through the program 400 times in a loop is not very easy, how can I set up the debugger so that ...
1
vote
1answer
191 views

recover works but fails last check50, “recovers last file correctly”

I finally got recover.c to compile and work. Everything looks right: files are padded with zeroes, all 50 jpgs are recovered and readable. But when I run check50, it fails the check of recovering the ...
1
vote
1answer
203 views

Pset4 recover: can't seem to use struct to identify the jpg

Trying to apply the structs from pset4/resize. Coming up with a quick prototype to make sure i understand structs completely. 1) I keep returning nothing in my output. Can someone tell me what's ...
1
vote
1answer
86 views

Pset4 recover.c Still getting a Seg fault

I changed the code from the first time I asked this question, so I decided to make a new thread. Sorry if this is not a good idea. Anyway, I'm still getting a Seg fault here. And even if that ...
1
vote
1answer
285 views

Pset 4 Recover Segmentation Fault

When I try to run this program I get a segmentation fault. I think it may have something to do with how I'm checking for the end of the file, although I'm not sure how to go about finding the specific ...
1
vote
1answer
849 views

unable to write to file (segmentation fault)

I have created the following so far, but for some reason the fclose and fwrite functions give me segmentation faults already in the first block read. I have tested these lines separately by commenting ...
1
vote
1answer
76 views

pset4 recover cant find headers

I just started on this code and for now I ONLY want to find the headers. Why doesnt this code find any? It seems to me it looks for blocks and then compares the first 4 bytes.. #include <stdio.h&...
1
vote
1answer
111 views

Pset4 Recover: Not understanding where to put the forever loop to break out and close the image file

My code for recover.c works except for 015.jpg. I can see the image in the folder, but the file is not closing correctly and thus disrupting check50. I get that I want to put a "forever loop" ...
1
vote
1answer
170 views

recover.c not finding any jpegs

Alright so for fun, I decided to try something a little different in my code. I created a union containing a 32-bit int and a struct containing four unsigned chars. I then read the first four bytes of ...
1
vote
1answer
118 views

Can anyone tell why is this giving me a SEGFAULT?

typedef uint8_t BYTE; int main(void) { FILE* memcard = fopen("card.raw", "r"); if (memcard == NULL) { printf("something went wrong and file could not be opened"); return ...
1
vote
1answer
120 views

Why is this condition true if the characters in the buffer do not match?

As you can see, the if statement on the line 35 is false. Why is the body of the if statement being executed?
1
vote
2answers
44 views

Major Help Needed on CS50 - Recover

I would love any possible help with this code. I think I've got the general idea, but I keep running into segmentation faults. Thank you to anyone who gets a chance to look this over! I've been very ...
1
vote
1answer
130 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
62 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
3answers
7k views

cs50. pset4. recover

I ask for help. I do not find the error. I prompted and rewritten the code. Next is a new version, but the cs50 does not pass! The files have been resumed. performance control does not pass list of ...
1
vote
1answer
115 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
142 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
2answers
132 views

pset4 recover code review

Below is my code for pset4 recover.c. I tried my best to write these code out but still having bunch of compiling errors. Could anyone give me some guide or just point out my incorrect points? ...
1
vote
1answer
57 views

PSET4 recover check50 unexpected end of input

when I run my code, it is able to create the photos with the proper naming conventions, but when I run check50 it returns 'unexpected end of input.' What is wrong? Thanks! /** * recover.c * * ...
1
vote
1answer
148 views

Recover.c Nothing Happens!

I run my code which seems right to me but nothing happens! No images appear in my jpeg file!! Please help me I am stuck. Thank you [code hidden to comply to academic honesty] // Checks if file is ...
1
vote
1answer
547 views

why does check50 claim that 015.jpg wasn't recovered correctly? [duplicate]

This is my sandbox link: https://sandbox.cs50.net/checks/0d0024b391314b4597be136798827f98 while(feof(fp)==0) { // recover images } Edit: I'm opening only one file at time and I'm closing 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 ...
1
vote
0answers
378 views

Anyone get rick rolled in recover.c? [closed]

Did anyone get the easter egg while working recover.c? If you open the card.raw file for reading, and then: char block[512] = {0}; fread(block, sizeof(char), 512, inptr); which is incorrect, but ...
1
vote
2answers
647 views

What is the meaning of this segmentation fault?

For recover.c my program compiles but when I run gdb I get a segmentation fault and I'm not quite sure what it means. When I run gdb I reach line 59 before I get this error message. I would like to ...
0
votes
2answers
880 views

Recover not passing recovers last file correctly

So my recover program recovers all pictures fine to me, and passes all tests in check50, apart from the last one: recovers last file correctly... Check50 link: https://sandbox.cs50.net/checks/...
0
votes
1answer
4k views

segmentation fault in recover

So my problem is that I get a segmentation fault when I run this code and I'm totally unsure why. I don't really understand what is happening in gdb either. This is definitely the most challenging ...
0
votes
1answer
872 views

Recover Buffer as uint8_t instead of int

I have been struggling through Recover when I noticed that the buffer on the walk through was a BYTE buffer; instead of just an int buffer;. After changing this my program finally worked! My ...
0
votes
1answer
1k views

segmentation fault - pset5 recover.c

I have spent a long time looking through my code for a segmentation fault, but have not been able to find it. #include <stdio.h> #include <stdlib.h> #include <stdint.h> #define ...
0
votes
1answer
518 views

PSET4 recover.c - don't know what's wrong

check50 reverts with following results and don't quite understand what these referring to: :) recover.c exists :( recover.c compiles \ expected an exit code of 0, not standard error of "recover.c:...
0
votes
1answer
595 views

recover.c recovers all images successfully, but check50 says it fails to recover the last. Any ideas why this is happening?

I have a while (!feof(infile)) loop, so that exits only when the eof is reached. And it closes all files upon exit. Here's the code: // scan input file while (!feof(infile)) { // read four bytes ...
0
votes
1answer
106 views

What's wrong with this recover code?

I wrote some code for recover that seems to me to be recovering the image correctly (I can see pictures of people for all 50 images), but for some reason, check50 says that 049.jpg does not match the ...
0
votes
2answers
95 views

Pset3 recover __ How can I read and store data from card.raw to an array, and print this data-array byte by byte?

(This is the 1st time I use this site) I've tried many different ways, and all failed. Mostly 0s are being printed. Any idea how to approach this? I've spent the entire week on this already. Actually,...
0
votes
2answers
227 views

PSET4, Recover - Generated JPGs are blank

My code compiles and saves 50 JPG images with proper names, but when I try to open any one of them, all of them are blank, just grid. When I run check50, I get Segmentation fault error. What I'm ...
0
votes
1answer
259 views

Recover pset 4 last image

I have been working on this for a long time. I used check50 on it and it reports that the last image isn't recovered correctly. Can someone provide insight? #include <stdio.h> #include &...

1
2
3 4 5
18