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
0
votes
1answer
176 views

Can't Find JPEG's in pset4 - Recover

I'm stucked with pset4 recover at a very basic level, I'm trying to check if my code can find the beginning of the JPEG's only, without making all the other considerations. But apparently this is not ...
0
votes
1answer
115 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
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
0answers
342 views

recover.c segmentation fault at fread

I'm getting a segmentation fault at line 44 from fread. I've run it through gdb and Valgrind but I can't seem to figure out what is failing to cause the fault. A file called iofread seems to say that ...
0
votes
1answer
238 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
150 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
89 views

Pset4, Recover, Seg Fault and Stack Overflow

My program works fine for 4 images. They are completely viewable! However, on the 5th run through recursion, it segfaults. Here is the recursion function: FILE* write(FILE* in_file, FILE* out_file, ...
0
votes
1answer
193 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
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
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
79 views

recover.c pset4

recover.c is creating the correct number of file with the correct names, but they're all empty (0 bytes)... To conform with the honor code, I've posted the code as a gist: https://gist.github.com/...
0
votes
0answers
54 views

Strange segmentation fault

I ran my recover program and it worked correctly, and then I checked its correctness with check50. Check50 outputed that my code was working perfectly but after that, when I try to run the program I ...
0
votes
0answers
44 views

pset4, recover - Wrong number of jpg

I'm working on recover.c. I work stage by stage and now try to recognize all img in card file. Here is my code #include <stdio.h> #include <stdlib.h> #include <stdint.h> #define ...
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
301 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
43 views

Help pls pset4 - recover the checkl says To do

My code is here :https://github.com/volvovics/Cs50-course-projects/blob/master/recover.c It fails the last 2 point of the checklist. For the middle files and last file it says to do. I can't figure ...
0
votes
1answer
211 views

pset4 recover doesn't pass check50

i have gone through the answers already posted but they don't seem to handle my exception. this is my code: /** * recover.c * * Computer Science 50 * Problem Set 4 * * Recovers JPEGs from a ...
0
votes
1answer
64 views

Why does my program return a blank jpeg?

I have started recover.c in pset4. I have decided to approach the problem step by step, so first task is recovering the first jpeg. enter code here FILE* file = fopen("card.raw", "r"); ...
0
votes
0answers
110 views

Pset4 recover - check50's TODO

I completed Pset4 recover, all 50 jpg are extracted, each file starting with FFD8FFE* (yes, I included all possible 0xF cases) and ending with 0xFFD9 without padding.. ~/workspace/pset4/jpg $ ll *jpg ...
0
votes
2answers
168 views

recover.c does not create any file

my code is running properly but it is not creating any output file where i can check those images.it also passes check50.i'll be very thankful for suggestions on how to improve my code. here is my ...
0
votes
1answer
57 views

Recover: While loop repeats but does'nt add variable

My code: //create space save info from card unsigned char buffer[512]; int jpgCount = 0; char title[7]; do { if (buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff) { ...
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
434 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 ...
0
votes
1answer
102 views

Pset4 Recover All the images are black

My code compiles and all 50 image files are created, but if I open them, they're all black. Does anyone know what I'm doing wrong? (Do I need to show my code as well?) Thanks in advance! (Code ...
0
votes
1answer
66 views

PSET4 Recover Passes Check50 but throws Seg Fault

Last night, recover.c worked fine. Today, it compiles and, after I run ./recover, promptly throws a seg fault. At times, it has claimed it cannot open "card.raw" though the syntax is perfect. For fun,...
0
votes
0answers
68 views

Pset4 recovers all jpg but does not passes check50

Can retrieve all 16 jpg files, but check50 shows error. sandbox output Can someone check my code in PM, to give me some int for what is wrong?
0
votes
2answers
242 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
397 views

guys here is my code of recover it recovers every image but still check50 disagrees

/** * recover.c * * Computer Science 50 * Problem Set 4 * * Recovers JPEGs from a forensic image. */ #include <stdio.h> #include <cs50.h> #include <stdlib.h> int main(void) { ...
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
0answers
526 views

pset4 recover not passing check

My program seems to work. I recover 50 images and they all can be viewed. However, I get errors when I try to check it with check50. It says "Expecting an exit code of 0. ... but received the ...
0
votes
1answer
84 views

pset4: recover.c - core dumped

Could you please help me to figure out what's wrong with my recover.c code? What is the reason, that only 1 JPEG is created with size of zero bytes and i get the segmentation fault error? #include &...
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
1answer
82 views

Recover from getting 8 images to now just 1 image and terminal hanging

Ok now for the last 48 hours I have been trying to make recover work. First I made a program that got only 8 correct images. I posted my problem in this link and got a response and understood how my ...
0
votes
1answer
110 views

pset4 recover.c sge fault cant find first jpg signature

Here is my code. I keep getting a segmentation fault while iterating over beginning of bufferArray[512] looking for the first jpg signature. Please help! I cant see what i've done wrong. Im trying to ...
0
votes
0answers
83 views

pset4 recover creating small jpgs

#include "stdio.h" #include "cs50.h" #include "stdint.h" int main(int argc, char* argv[]) { // check for command-line arguments if (argc >= 2) { printf("This program does not accept command-...
0
votes
1answer
578 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
0answers
165 views

Recover finds first jpeg then never finds the next

The code compiles and using GDB I can look at the block data and see the jpeg pattern matches for the first jpeg(I'm assuming it's the first.) The second do loop to pack the jpeg file with data until ...
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
140 views

Getting wrong information from card.raw PSET4?

I have been trying to figure out what has been the problem now for a while but I can't. When I run GDB, it is telling me that compare[0] is either 97, 235, 82 or 0. int counter = 0; FILE* inptr = ...
0
votes
1answer
282 views

pset 4 - recover - Segmentation fault reading into buffer

My program makes one image, then has a segmentation fault. Using GDB, I can see that the segmentation fault happens on the next iteration of the loop after creating the first jpeg. Looking more, I ...
0
votes
0answers
81 views

Error in recover

I'm not to sure if "Aborted (core dumped)" means the same as "Segmentation fault (core dumped)", but that was the error message I received when I executed the program; however when I ran the program ...
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
464 views

pset4 recover segfault: no such file/directory

My code seems to have trouble making the .jpg files in which to place the blocks of data. #include <stdio.h> #include <stdlib.h> #include <stdint.h> uint8_t buffer[512]; uint8_t ...
0
votes
0answers
410 views

recover.c failing to fill buffer array with 512 bytes?

I am working on pset4 recover.c and I am stuck on trying to fill a buffer array with 1 block or 512 bytes from card.raw. The problem I am having is that fread successfully fills 4 bytes of data ...
0
votes
0answers
124 views

Problem in recover in pset4

I have done my recover program and I get the 16 jpg images. They are well named and I can see them so the program is working correctly but when I check the program I get an error in the set recovers ...
0
votes
0answers
122 views

pset4 recover can't find more than one jpg

I'm doing pset4 recover program. I've written following code to read 512 bytes of data at once and detect the start of any jpg image BYTE buffer[512]; while((fread(buffer, 512 * sizeof(BYTE), 1, ...
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
1answer
409 views

recover finds images but check50 provides killed by server error / pset4

Recover.c appears to be working. Creates 15 jpgs and they look proper. Valgrnd suggests no memory leaks/losses. I am at a loss. > :) recover.c exists :) recover.c compiles :( recovers 000.jpg &...
0
votes
1answer
446 views

Recover returns jpegs with wrong structure

My recover program is able to output all 16 jpg but the structure seems off as it states SOS before SOF. I'm guessing the issue might be with the fwrite function but I'm unable to figure it out. I'm ...
0
votes
1answer
777 views

Pset4 recover not passing check50, but I can see the recovered .jpg files

I have run my program and it works! I get 16 .jpg files, all of which I can see when I open them. When I run check50, however it fails on jpg 000.jpg and 001.jpg through 014.jpg, but not 015.jpg?! ...