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
2answers
91 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
105 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
77 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
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
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
187 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
235 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
48 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
247 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
91 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
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 ...
0
votes
2answers
514 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
137 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
100 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
114 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 ...
0
votes
1answer
34 views

Recover - file counter keeps resetting

Initially, I thought my code was only recovering 2 images from the card.raw file but after looking at the code with debug - I think it is recovering the 50 files but it overwrites 001.jpeg many times. ...
0
votes
1answer
67 views

pset 4 recover still getting memory leaks

I've been told before that my code is getting memory leaks (when running Valgrind this becomes apparent) so I now free memory at the end of the program, but I'm still getting leaks. Even beyond ...
0
votes
1answer
59 views

Code runs, but no JPEGs are formed in recover

#include <stdio.h> #include <stdlib.h> #include <cs50.h> int main(int argc, char *argv[]) { // ensure proper usage if (argc != 2) { fprintf(stderr, "The program ...
0
votes
1answer
77 views

pset4 recover not sure why I get segmentation fault

Really clueless to why I get a segmentation fault on this problem, I have a hunch it may be something regarding the creation of the outfile. #include #include int main(int argc, char *argv[]...
0
votes
1answer
55 views

pset4 recover code compiles but doesn't run

I thought I had everything figured out when my code compiled, but unfortunately it doesn't recover the images or do anything at all for that matter, and I'm not sure why. #include <stdio.h> #...
0
votes
1answer
52 views

pset 4 recover, won't recognize file outptr

#include <stdio.h> #include <stdlib.h> // I got information about what to do with the buffer // from this stack exchangehttps://cs50.stackexchange.com/questions/2680/ //...
0
votes
1answer
217 views

pset 4 recover, questions about purpose of using buffer

#include <stdio.h> #include <stdlib.h #include <stdint.h> // I got information about what to do with the buffer // from this stack exchangehttps://cs50.stackexchange....
1
vote
1answer
191 views

My code works, but dont know why it is char filename[7]. Why 7? Why not another number?

My code works, but dont know why it is char filename[7]. Why 7? Why not another number?Thanks. // create filename char filename[7]; sprintf(filename, "%03i.jpg", ...
1
vote
2answers
88 views

pset 4 - recover: undefined behavior?

I got a question regarding check50 on pset4 - recover. If i run check50 a couple times in a row, without even compiling my code in between I get different results (might be all green smileys or ...
2
votes
2answers
274 views

pset4 recover: recovered images seems to still be corrupted

My code compiles and runs without any errors. Images are generated, but the images are incomplete, here's an example of 000.jpg: https://i.imgur.com/Ovs2Xv8.png. I can't really find what's wrong in my ...
0
votes
1answer
80 views

pset4 recover: first byte of buffer seems unexpectedly changes to 0

Thanks for seeing my question, I appreciate your help. :) Let's get to the point. My code compiles and runs without any errors. Images are generated, but the images are incomplete, here's an example ...
0
votes
1answer
149 views

pset4 recover can create 50 images but all white and grey check

when I run my code, 50 images are produced but they are all white and grey checks. and when I run check50, the comments are below. I do not know what went wrong in my code. any suggestion would be ...
0
votes
2answers
50 views

pset4:recover, finds only 28 images and they are unsupported format

As the title suggests my program finds only 28 images and they are unsupported format and won't open (the file names are correct though). Please can anyone highlight any issues with my code or point ...
0
votes
1answer
123 views

pset4: recover. double free or corruption (out)

Can somebody please help? When I try to run my program I get this message, * Error in `./recover': double free or corruption (out): 0x00007ffe270739f0 * Aborted I can't seem to find the issue. From ...
0
votes
2answers
52 views

PSET4 - Recover: Error in './recover': double free or corruption (top). Can't figure out what's wrong

I can't seem to figure out why this error is occurring. I used fclose() only once per file pointer. #include <stdbool.h> #include <stdint.h> #include <stdio.h> typedef uint8_t BYTE;...
0
votes
1answer
54 views

pset4 recover: Segmentation fault - Unsure of fix

I am very new to programming and am having problems with a segmentation fault in the code below. Any sort of guidance on where I have gone wrong would be very much appreciated. It is most likely ...
0
votes
1answer
25 views

*** Error in `./recover': double free or corruption (top): 0x000000000294a250 *** in recover pset4

I got this error when working in pset4(recover) and i can't see where exactly did i free something twice, can some one help me with it, by the way do i need to use a File *pointer with append as a ...
0
votes
1answer
212 views

pset4 recover not creating JPEGs

my code here compiles but does not create the file. Have tried changing many things... any ideas on what i'm missing? Thanks! Will #include <stdio.h> #include <stdint.h> #include <...
0
votes
1answer
124 views

CS50 Pset4 Recover card.raw only NULL

Okay so I am starting the recover program from Pset4 and I initially just want to get some output, any output, I have been trying to read the first few bytes from recover.raw but for some reason seem ...
0
votes
1answer
38 views

PSET 4 Recover If condition never true

I have been spending quite some time now on PSET 4 recover. After using Debug50 several times, I see that what is blocking is the fact that my if condition never returns TRUE and thus I can never find ...
0
votes
1answer
128 views

pset4 recover single image

My recover program currently successfully returns a single image "001.jpg" which looks good when I open the file. It also returns a second image "002.jpg" which prompts an error for an Unsupported or ...
0
votes
1answer
88 views

pset4 recover fails check50 but gets all 50 images

This is a last resort, I've never asked a question here . . . I see all 50 images (I'm assuming that's correct for CS50?) :-) but check50 is saying it has not recovered 000.jpg, 001.jpg, 049.jpg, ...
0
votes
1answer
147 views

PSET4: Recover, unable to solve the errors

Questions: I don't know why I'm getting the first error, I used unsigned char for file1. I didn't understand how sprintf(file1, "%03i.jpg",2); FILE *img = fopen(file1, "w"); will create a jpg file. ...
0
votes
1answer
138 views

Recover: invalid or unsupported image format

#include <stdio.h> #include <stdlib.h> #include <stdint.h> int main(int argc, char *argv[]) { if (argc != 2) { fprintf(stderr, "Usage: ./recover Card.raw\n"); ...
0
votes
1answer
53 views

Can someone please explain why I am getting a segmentation fault ? (recover pset4)

#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { if(argc != 2) { fprintf(stderr, "please give the correct input."); return 1; } ...
0
votes
1answer
256 views

Pset 4 : Recover, Segmentation fault

I am having problems identifying where i have gone wrong in the below code. On running the program i am getting segmentation fault. i have gone through many related tags and answers but cant ...

1
4 5
6
7 8
18