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

pset3 Recover - problem with final image

Hi I'm working on recover in pset3 and seems there is some problem when my code ends, can anyone point out the direction I should look into? Check50 returns the following error while all others are ...
0
votes
1answer
50 views

Need help with recover

I have been working with recover for a long time and I have a great problem with detecting the beginning of a JPEG. I have tried for a long time to no avail. I feel my problem may be with buffer but ...
0
votes
2answers
96 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
1answer
165 views

problem with recover.c using malloc and fread

i tried to write a function that sample 4 bytes from card.raw file but i doesn't work because fread doesn't put any data into block buffer so i wrote this simple code and i found out that fgetc works ...
0
votes
1answer
70 views

CS50 Recover image does not match

I have been working on this problem for a while but could never get it to work. Check50 says that the recovered image does not match. When I opened the recovered images manually, they are all blank. I ...
0
votes
1answer
96 views

Recovered image does not match pset3

I can't figure out what is wrong with my code. I recovered images from 000.jpg to 050.jpg. This is my code #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef ...
0
votes
1answer
306 views

Recover.c; Need explanation about how to implement “write 512 bytes until the new jpeg is found”?

I am completely stuck right now when it comes to implement: Write 512 bytes until the new jpeg is found. Could anyone give me idea how to implement this step? Here is my code: // Declare ...
0
votes
1answer
32 views

cs50 Recover segmenation fault

I am working on the CS50 Recover Problem and got stuck on the segmentation fault. #include <cs50.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { ...
0
votes
1answer
54 views

recover.c producing random image 🙁

recover.c is always producing this image: Here is my code: #include <stdio.h> #include <stdint.h> typedef enum {false, true} bool; // Bool int main(int argc, char *argv[]) { if (...
0
votes
0answers
39 views

recover.c spits out images that are partially recognizable

recover.c compiles and runs normally, but it produces 21 images that have chunks of different images mixed in. Here are the images: 000.jpg: 001.jpg: 002.jpg: 003.jpg: 004.jpg: Because I'm too ...
0
votes
1answer
53 views

pset3 recover is fopen changing the first value in my buffer?

My code for pset3 works and recovers all the images as it is supposed to however I realised that when I call fopen the first value in my buffer array becomes 0 I fixed this by changing the value back ...
0
votes
1answer
49 views

CS50 recover - images are some kind of blank

//My program creates images of different sizes but without content (just black and white pixels). Someone can help me? #include <cs50.h> #include <stdio.h> #include <stdlib.h> #...
0
votes
1answer
58 views

All 50 images look good but failing on middle images on check50 “:( recovers middle images correctly recovered image does not match”

I thought I was there, I was failing on the last image not matching also, but after looking through similar questions I realised that I was checking for EOF before the read of the raw file and not ...
0
votes
1answer
135 views

recover.c:43:34: error: use of undeclared identifier 'out' fwrite(temp, 1, 512, out);: WHAT?

When I compile my program, clang is probably not working. I get this when I compile: ~/pset3/recover/ $ make recover clang -fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11 -...
0
votes
1answer
58 views

Pset4 - Recover - Segmentation fault when trying to free buffer

I have run the debug50 and it seems the seg fault occurs after trying to free memory here: // if not start of a new jpeg and we HAVE NOT already found one before if (block_buffer[0] != 0xff &&...
0
votes
1answer
148 views

PSET 4 recover doesn't pass check50 - “recovered images do not match”

All images are recovered, and when I open them, they all display correctly (I checked every one of them in the IDE), yet my program is not passing check50. Why? Here's my code: #include <stdio.h&...
0
votes
1answer
72 views

cs50 Recover — Segmentation fault and too many jpegs

I'm stuck with the debugging the below code. I keep getting way too many jpg files written and a segmentation fault. Thanks in advance for the help. I'm new to programming and this one is kicking ...
0
votes
1answer
45 views

Pset4: Recover - Reach EOF to “early” aka. doesn't recognize beginning of new jpg

I am fighting with the recover challenge in pset4. Had some progress and was able to detect 20 images. But then my condition for finding EOF is true and the program stops. I think the problem is, ...
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 ...
0
votes
1answer
162 views

Pset4 - recover, unable to pass check50

#include <stdio.h> #include <stdlib.h> int main (int argc, char *argv[1]) { // ensure the arguments are correct if (argc != 2) { fprintf(stderr, "Usage: ./recover filename\n"...
0
votes
1answer
106 views

Why can I recover only two images?

This is my code for pset3, recover #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { // ensure proper usage if (argc != 2) { fprintf(stderr, "...
1
vote
1answer
88 views

Pset 3 - recover. code only returns 30 images, all of which are glitchy

Some of the images returned are filled halfway, some not so much, all being glitchy colors. Not really sure what I'm doing wrong #include <stdio.h> #include <stdlib.h> #include <string....
0
votes
1answer
140 views

Pset 3 Recover : segmentation fault for “already found JPEG” loop

I'm having some difficulties understanding the flow of recover. I've used the code and have written the pseudocode like this: if the start of a JPEG file is found - if it is first JPEG, create new ...
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 ...
0
votes
1answer
92 views

problem with checking 4 bytes of jpeg

So i recently completer recover and it came out that the only problem was with the code that was actually told in the recover walkthrough about the checking of jpeg 4 bytes.The code was: if(block[0]...
0
votes
2answers
266 views

Pset 3 (Recover): Why are images still glitchy?

I've been having trouble with pset3's Recover exercise. My code successfully compiles and creates 50 jpegs, numbered 000 to 049. However, all images are terribly glitchy. Examples: I've scoured the ...
0
votes
2answers
92 views

pset3 recover output not valid ASCII text

I'm recovering all 50 JPEG images, but still failing check50 with the message: "output not valid ASCII text." Not sure if this might have something to do with it, but for some reason, my buffer[0] ...
0
votes
1answer
113 views

Recover.c Help?

I wrote a code for recover.c, and though it compiles, it doesn't function properly. I don't know specifically where the issue is, (it could be the entire concept, really) but I'm sure the fread() and ...
0
votes
1answer
101 views

PSET4 RECOVER (QUESTIONS)

I managed to make my code recover all 50 images, and have passed check50. However, during the development process I have encountered two problems, and still doesn't get why it is an issue. Here is my ...
0
votes
1answer
107 views

PSET4 Recover spits out 50 images but they're all invalid

#include <stdio.h> #include <stdint.h> #include <stdlib.h> #define FAT_BLOCK_SIZE 512 // I figured out how to get block size from here "https://cs50.stackexchange.com/...
0
votes
1answer
42 views

Pset4 recover: my code never recognises the beginning of a jpeg

When I compile the code I don't get any errors, however when I run it i get a segmentation fault. I discovered this is because my code never finds the beginning of a jpeg so my img file never gets ...
0
votes
1answer
62 views

PSET 4 RECOVER - My program outputs 50 images however they all have an invalid format

So I think I've nearly finished but I've come upon a bit of roadblock. That is all my photo are invalid. I looked at all the threads I could and couldn't find out why. My Code: #include <stdio.h&...
0
votes
1answer
80 views

PSET4 Recover Output Ptr Closing/JPEG Writing

I have a script that mostly works, I think, but I cant get the file writing to work. I have seen some others use a flag for calling when to close the output pointer but I cant see why this way wont ...
0
votes
1answer
52 views

Pset4 Recover - Program only recovers 2 images, but loops 50 times

My recover.c program only recovers 2 images, although when I tested how many loops it did, it did 50. Both images recovered seem complete, nothing weird about the images. Check50 also confirmed the ...
0
votes
2answers
245 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
63 views

Can't open generated JPGs

My code compiles and saves 50 JPG images with proper names, but when I try to open any one of them, I get the 'Invalid or Unsupported Image Format' error. What I'm doing wrong? Here is pseudo-code: -...
0
votes
1answer
193 views

pset4 recover - my implementation recovers 50 jpegs but check50 rejects

I am having trouble with recover from pset4 - when I run it, it creates 50 images, apparently correctly formatted (000.jpg-049.jpg). However, check50 rejects it: :) recover.c exists. :) recover.c ...
0
votes
2answers
250 views

PSET 4 - Recover: recovers JPGs but doesn't pass check50

My implementation of Recover produces 50 JPGs but does not pass check50. I am stumped. Any help would be greatly appreciated. #include <stdio.h> #include <stdlib.h> #include <stdlib.h&...
0
votes
1answer
51 views

pset4 recover file name declaration

char jpgname[8]; // Correct declaration char *jpgname = "000.jpg"; // Incorrect declaration . . sprintf(jpgname,"%03i.jpg", fileNum); // Segmentation fault seemed to occur on this line if the ...
0
votes
1answer
41 views

pset4 recover it shows segmentation fault

/*************************************** * recover.c * problem pset4 * computer science 50 * Reccvers JPEGs from a foreinsic image * **************************************/ #include <stdio.h&...
0
votes
1answer
272 views

pset4 recover handles lack of forensic image

Help to recover images on this program. Thank you. /*************************************** * recover.c * problem pset4 * computer science 50 * Reccvers JPEGs from a foreinsic image * ***********...
2
votes
1answer
1k views

:( recovers 049.jpg correctly recovered image does not match

I have problem with pset4/recover. I recover all images and can see last image when I click on it but when I run check50 it returns with error: :( recovers 049.jpg correctly recovered image does not ...
0
votes
1answer
80 views

Segmentation error pset4 recover

I am getting a segmentation error when I run recover. I've looked at other questions regarding segmentation errors but cant find the issue. Below is my code. Thanks! #include <stdio.h> #include ...
0
votes
1answer
102 views

Pset4 Recover issues

I am having a number of problems with recover in pset4. First, my program is not finding a beginning of a jpeg. But, to test that, I have to first compile it, and I cannot because for some reason on ...
1
vote
1answer
383 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 ...
0
votes
2answers
548 views

recover - fread into buffer

I am working on the recover problem and I request some help. Well as the problem requires that search through raw data to get and save images separately, I am working on the problem step by step. At ...
0
votes
0answers
138 views

Help with some understanding - Recover

I don't want an explicit solution, but some clarity in my understanding. 1) The buffer. Is using a char or int buffer a hack approach? I thought about typedef byte or block but what's the ...
0
votes
1answer
36 views

Pset4 recover bedug50 creates jpeg but when I run the code it gives segmentation fault

I rearranged my code several times. Also searched and saw so many people’s codes with segmentation fault and changed the code according to advice they got but my code keeps giving me the same mistake. ...
0
votes
1answer
103 views

PSET4 recover qeustion

This is what I wrote for pset4 recover. The problem is that I am only getting first 2 images (partially, not full images). And also it creates like hundreds of images and says "file size limit ...
0
votes
2answers
116 views

Segmentation fault in recover pset4

I am working on recover in problem set 4. However, after trying out different stuff, the code itself compiles but I get a segmentation fault and the outcome is only one jpg file called 000.jpg. I am ...

1
4 5
6
7 8
18