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

PSET4 recover compiles but doesn't give any output

I am having a difficult time with the recover assignment. The program compiles but after running does not return any images. I also noticed it doesn't enter the if statements that check the JPEG magic ...
0
votes
1answer
102 views

Segmentation fault when I run recover.c

I keep having a segmentation fault when I try to run recover.c. I now have only 1 error when I run Valgrind. Can somebody take a look at my code and give me some guidance ? here is my code : [code ...
0
votes
1answer
429 views

recover.c “ recovered image does not match”

My program generated the 50 images (000 to 049) from the card.raw file. When I opened each one, it was just a checkered (which i assume is blank) image. I'm not getting a "unsupported image" error btw....
0
votes
1answer
714 views

why does check50 say “killed by server”?

My code works - all 16 images are recovered without a problem. However, it doesn't pass check50, which gives me smileys for recover.c existing and compiling, but says "killed by server" for recovering ...
0
votes
2answers
187 views

pset4 works correctly but check shows error

/** * recover.c * * Computer Science 50 * Problem Set 4 * * Recovers JPEGs from a forensic image. */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef ...
0
votes
1answer
412 views

CS50 pset 4 recover.c timed out while waiting for program to exit

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> typedef uint8_t BYTE; int main(int argc , char* argv[]){ //checking number of arguments ...
0
votes
1answer
103 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, "...
0
votes
1answer
140 views

Detecting if we already found a jpg

I'm having trouble figuring out how to print extra 512bytes, if the first jpg is longer than that, like how to loop UNTIL it hits the next 4 header indicators. In this code example I've tried with a ...
0
votes
1answer
422 views

PSET4: fgets returns odd characters instead of what's in .raw

I know the first few lines of 'card.raw' are (by opening in a texteditor): bit.ly/18gECvy ˇÿˇ‡JFIFHHˇ€Cˇ€Cˇ¿Vˇƒ Currently all I want the app to do is print back what's in the .raw file, and then ...
1
vote
1answer
169 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 "...
0
votes
1answer
372 views

Recover pset5 scope?

I'm almost there, but one more question about recover.. In my code, I open a file inside an if condition, but how do I acces that file later? It's getting out of scope and I'm getting use of ...
0
votes
1answer
474 views

Error: double free or corruption when running recover

After a very long time, I finally managed to find out why my version of recover.c only managed to recover 1 image (recover.c only recovers 1 image) Anyway, now I face a new problem. What I've ...
0
votes
1answer
17 views

Recover finding all images but not passing check50

I know this has been brought up a few times before but none of the solutions seem to be relevant to the code that I have written below. My recover.c file compiles, executes and returns all 50 images ...
0
votes
1answer
8 views

Segmentation and bool fault in recover.c

Can anyone help? I keep getting a segmentation fault when trying to run recover.c. It compiles fine. My code is below. I do plan to add in the error returns once I can get this to work properly as ...
0
votes
2answers
85 views

In recover.c, how do you name each image file a seperate name?

Is this even necessary? Will the computer automatically name each file? Or will it use the name designated in fopen()?
0
votes
2answers
172 views

Pset 4 Recover: Image pointer returns null on second iteration of code

For some reason my code seems to be either unassigning the pointer to my image when it reaches the second iteration following the opening of the first jpg file. (I know this because there is a ...
0
votes
1answer
165 views

recover onlys recovers 1 image out of 16

my code for recover only successfully recovers 1 image. It seems to me that the loop only executes once. I don't know what I am doing wrong. So below is my code and I am wondering if you guys can help ...
0
votes
1answer
111 views

recover compiles and runs but no jpeg is saved

I save the name of the picture in picname and open it in img and do the rest of the copying from memory card on img , the program compiles and runs fine but no image is saved in the current directory....
0
votes
1answer
13 views

CS50 Recover pset is causing segmentation fault

This is question is fairly common here, but I haven't seen code similar to mine. This has led me to doubt my screen thoroughly, so I come here asking for help. It doesn't throw any errors with either ...
1
vote
1answer
146 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 ...
0
votes
1answer
47 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
102 views

Images are not producing

This is my code. It is compiling and executing but not producing any images
0
votes
1answer
11 views

pset4 Recovered image doesnt match

I´m trying to solve the pset4 recover challenge, but i havent been able to make the program recover the full image, only one part of it. What am i doing wrong ?? This is my code: #include <stdio.h&...
0
votes
1answer
297 views

pset4 recover: Code works 3/4 times. Sometimes gives segmentation fault. Doesn't pass check50

I'm having trouble figuring out what is going on. 3/4 times I run ./recover, it produces all 16 pictures correctly. Other times, I get a segmentation fault. When I run valgrind it gives me two "Use of ...
0
votes
1answer
97 views

I'm getting a Segmentation Fault when running recover.c

Seems like others also had the same problem of a Segmentation Fault when trying to do solve this, but I'm not going to look at those. I already liked at another person's code while I was stuck trying ...
0
votes
1answer
156 views

PSET4 Recover: Not sure why my code is not working

I've reviewed my code and I think it should work, but only the first 512 bytes are being written, not sure why. #include<stdio.h> #include<stdlib.h> #include<stdint.h> typedef ...
0
votes
2answers
237 views

How do I use fread inside a condition

I watched the short for the set and its at the point where Zamyla explains that its useful to use read inside a condition to check for elf, she uses the example of if(read(&buff, sizeof(DOG), 2, ...
0
votes
1answer
29 views

PSET 3 recover I can't open pointers. Always returns a NULL value

Whenever I try to run this code, it returns "could not open file", which means that jptr is assigned a null value. I don't know how to get rid of this, tried so many solutions. It keeps on happening ...
0
votes
1answer
126 views

Recover works but doesnt pass the check50… any ideas?

The code recovers the images but it doesn't pass the check and I can't figured out why yet... any ideas? Thank you! int main(void) { //declare a buffer array typedef uint8_t BYTE; BYTE ...
0
votes
1answer
177 views

Recover Infinite Loop

I have been working on the "recover", however although it compiles but it tend to run into an infinite loop when searching for the start of the jpgs. Here are my coding for searching the start of the ...
0
votes
1answer
176 views

pset5 recover video

In the video offering tips for the "Recover" assignment, a graphic is shown, which depict the blocks of memory containing the jpeg files. The last block of memory is shown as "EOF" and appears to not ...
0
votes
1answer
109 views

jpegs do not exists on running recover.c

i have made a program to recover the jpegs i.e. resize.c . The code is : http://pastebin.com/B0XkP9i9 the check 50 results: check50 2016.recover recover.c :) recover.c exists :) recover.c compiles :) ...
0
votes
1answer
188 views

PSET 4 Recover.c file size limit exceeded and segmentation fault

This is my code for PSET4. Can anyone explain why it is not working? I have tried debugging forever. But I get various combinations of file limit exceeded and segmentation faults that just don't go ...
0
votes
1answer
238 views

Recover pset4: help with pseudocode logic

I finally passed resize and now I'm on this pset. This time I'm trying to really focus on doing a good pseudocode since I feel a bit unsure about who to tackle the problem. In particular, I'm not sure ...
0
votes
1answer
24 views

Recover code makes 000.jpg to 049.jpg, but jpgs are corrupt

I've been working on this problem for a little bit, but right now I have no clue why my code isn't working. Right now it spits out the 50 jpgs like it's supposed to, but they're all blank. Anyone have ...
0
votes
1answer
17 views

PSET4 Recover Problem

This is the result of my code: :) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :( recovers 000.jpg correctly recovered image does not match :( recovers middle images ...
0
votes
1answer
208 views

pset4 recover.c segmentation fault fread/fwrite

I am trying to complete recover.c for pset4, but I am having major trouble debugging. I get a segmentation fault after the first fwrite step has occured, and it creates the fault at the fread step at ...
0
votes
1answer
148 views

Struggling with recover.c

Its getting compiled hence syntactically correct. But after execution it had just made 1 new jpg file and too corrupted. Could you please help me out here. I have used 508 instead of 512 ...
0
votes
1answer
298 views

recover not working pset4 cs50. Doesn't show images properly

I've been checking lots of answers to people with a similar problem. But I don't get this to work yet. My code recovers all the images, but the last image is empty. I've read answers and check the ...
0
votes
1answer
576 views

Pset4 recover help

int counter = 0; FILE* inptr = fopen("card.raw", "r"); BYTE compare[512]; fread(&compare, 512, 1, inptr); while (!feof(inptr)) { if ((compare[0] == 0xff) && (compare[1] == 0xd8) &&...
0
votes
1answer
23 views

Where am I mystaking ? pset4-RECOVER

I've been rewriting that code for about a week now and start beeing very confused about what I am doing wrong, I hope my logic isn't fully wrong but I have some doubts about my understanding of ...
0
votes
1answer
64 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
1answer
67 views

(Recover) Segmentation fault

I was trying to complete the recover problem and it's giving me a segmentation fault. Any help would be appreciated. #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #...
0
votes
1answer
235 views

Pset4 Recover - only one corrupted picture is recovered!

I'm not sure what I'm doing wrong. I tried to follow the walkthrough. My code is below. Any help will be appreciated. typedef uint8_t BYTE; typedef struct { BYTE first; BYTE second; ...
0
votes
1answer
177 views

Pset4 recover.c I'm able to recover all images. But Check50 is not passing

:) recover.c exists :) recover.c compiles :) handles lack of forensic image :) recovers 000.jpg correctly :( recovers middle files correctly :( recovers last file correctly I am able to see all 50 ...
0
votes
1answer
123 views

CS50 Recover.c | No idea what and where i'm going wrong | Can't debug or compile in CS50 IDE

I'm trying to debug in CS50 IDE but I'm continuously receiving this error; debug50: recover: No such file. and if I try to compile it says this "make: *** No rule to make target 'recover'. Stop." ...
0
votes
2answers
134 views

Can't seem to wrap my head around what the Bitwise AND operator does in Pset4 vs. && AND operator

I just watched the Recover video and I saw them mention bitwise arithmetic, but I am not exactly sure what that means nor what it does. I saw another forum post explain it but that also didn't really ...
2
votes
3answers
784 views

jpg's fourth byte

Reviewing my code after successfully recovering the images in pset4, I see a part I just copied (from Zamyla's video) without understanding. Mainly, the following: (block[3] & 0xf0) == 0xe0 I ...
0
votes
1answer
355 views

Debug50 Running through breakpoints

I am trying to use debug50 for PSET 4 (Recover). However, when I set the breakpoints the debugger runs through them and do not pause. Only when I set the breakpoint at the if statement shown in the ...
1
vote
1answer
72 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
2 3 4 5
18