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

set 4 - I don't know why I only get part of the image

I don't know why my code isn't working. It recovers images but only a small fuzzy part of them. Can anyone help? /** * recover.c * * Computer Science 50 * Problem Set 4 * * Recovers JPEGs ...
0
votes
1answer
424 views

pset4 recover recovering images but not passing check

I am stuck on pset4/recover. My program appears to recover all 50 images, but I am unable to pass the checker. Any tips or pointers (ha) are much appreciated. -Thad /** * recover.c * * Computer ...
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
274 views

Recover images of invalid/unsupported format, cannot open

What a day, second question a row! I would truly be thankful for any hint of what I am doing wrong! I have stucked and cannot find what I am missing. The program finds all images and names them ...
0
votes
1answer
264 views

Having trouble passing pset4 Recover check50, despite finding all 50 images

I'm having trouble sussing out where I am having problems here, I'm pretty sure that I have covered everything that is mentioned in the walk-through. Maybe I'm just missing something. Stepping ...
0
votes
1answer
465 views

Need clarity in setting up buffer in recover

I can't seem to wrap my head in the code below. unit8_t BYTE; Does this create a data type the size of 8 bytes? But don't I need 512 bytes for the buffer? BYTE buffer[512]; Does this create an ...
0
votes
1answer
81 views

i am getting segmentation fault with my recover.c program

include include int main(void) { FILE* file = fopen("card.raw", "r"); int* data = malloc(513); if(data == NULL) { printf("failed to do task\n"); return 1; } else { int k = 0; ...
0
votes
2answers
138 views

Data in recover.c doesn't seem to be aligned at 512-byte intervals… what am I missing?

The instructions for "recover.c" in pset4 seem to indicate that all the jpeg photos will be aligned with a block of 512... eg, I only need to check the first 4 bytes starting at 0, 512, etc to find ...
1
vote
1answer
435 views

Pset4 Recover - Why do we need to check if JPG is already found?

I'm having trouble reading and writing the contents of the JPG files in Pset4 recover. When I run my program, I'm getting all 50 JPGs as files 000.jpg to 049.jpg. However, the pictures all appear to ...
0
votes
1answer
342 views

Recover.c outputting 50 jpegs of size 512 bytes only

So I've made progress and wrote what I have in here. My program outputs 50 jpegs of size 512 bytes. I know that may program writes only 512 bytes to a newly created jpeg but I don't know what should I ...
0
votes
1answer
101 views

pset4 recover: Only creating 1 faulty jpg

I think I followed the pseudocode from the instruction video but my code is still not working, it just spits out one jpg with a bunch of symbols. I'm not sure if it's because of the data types I used ...
0
votes
1answer
276 views

Pset4 recover getting 24 blank jpg

It has been quite a struggle just to get to this point, but I feel like I'm close. Hopefully it's just a small oversight, but I keep getting 24 blank jpgs. Here's my code: #include <stdio.h> #...
0
votes
1answer
134 views

pset4 recover - Invalid read and Use of uninitialised value

I don't know what's wrong in my code. Valgrind points to 33 line of my code: while(fread(arr, sizeof(arr), 1, card) == 1) but I can't see what's isn't right, i had read about some similar problems but ...
0
votes
1answer
309 views

pset4 Recover Unsupported file format

I know i've been asking a lot about this pset, but I assure I have done my research. My program for recover creates all of the files, but when I try to open them it says the file format is unsupported....
0
votes
1answer
65 views

Pset4 Recover Writing the slack space on Jpg

My code for recover works fine but I'm having a little trouble understanding one thing. Here is a snippet from my pseudocode -found the first JPG's signature? While true Write the buffer ...
0
votes
1answer
56 views

Recover not returning images

I've been itching at this code for hours now, it doesn't output any images, everytime i try to debug it it comes to the first while statement and immediatly returns 0, i have no idea why int main(int ...
0
votes
1answer
219 views

recover.c, Can not open JPG's

I got stuck on recover.c. It saves 10 JPG's to file but i'm only able to open the first one. Of this first JPG i can only see a small part of the upper side of the picture. when I look at the first ...
0
votes
1answer
296 views

pset4 Recover: Check50 doesn't pass

What can possibly make the following errors? :) recover.c exists :) recover.c compiles :( recovers 000.jpg correctly \ expected an exit code of 0, not output of "ÿØÿà\u0000\u0010JFIF\u0000\u0001\...
0
votes
1answer
158 views

Need a little help with Recover.c , PSET4

I am having issues with this problem set. I am unable to recover all 50 pictures, only 49, all of these pictures are not more than a few pixels though. I have seen the whole pictures and there's a ...
0
votes
1answer
78 views

pset4: recover works and passes, but has valgrind issues

My Recover program is now fully functional, but when running it through valgrind, I get the following read-out: ==2169== HEAP SUMMARY: ==2169== in use at exit: 1,136 bytes in 2 blocks ==2169== ...
0
votes
1answer
229 views

PSET 6 unable to load cat.jpg

Upon further checking, I found that the function load doesn't return true meaning something went wrong somewhere. Am I using fread, realloc and memcpy right? bool load(FILE* file, BYTE** content, ...
0
votes
1answer
72 views

Recover.c not creating any jpegs

I've been through my code numerous times and I'm pretty sure the logic is correct. I just can't seem to create and write the images. Any help would be appreciated. #include <stdio.h> #...
0
votes
1answer
934 views

PSET4 recover.c worked well but didn't pass check50 test

So my recover.c worked and recovered all 50 photos, all of them are viewable. The program also passed Valgrind test with no leak in memory. However, it didn't pass check50 test. The results are: :) ...
0
votes
2answers
242 views

cs50 Prblem set 4 recover. Can someone please look at my code and tell me why I'm getting a segmentation fault?

/** * recover.c * * Computer Science 50 * Problem Set 4 * * Recovers JPEGs from a forensic image. */ include include include int main(int argc, char* argv[]) { // Ensure proper usage ...
1
vote
2answers
603 views

pset4 recover issue-blank pics?

I was wondering if anyone could give me some guidance on this problem. I have the below code. When it runs, I see 000.jpg to 049.jpg, however all the pictures are black boxes? I'm not quite sure what'...
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
2answers
883 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
56 views

pset4 recover.c ,my code shows segmentation fault

int main(int argc, char* argv[]) { typedef uint8_t BYTE; // open the given file FILE* file = fopen("card.raw","r"); if (file == NULL) { printf("Could not read from file.\n"); free(file); ...
0
votes
1answer
81 views

Recover.c Could not open file: /build/buildd/eglibc-2.19/libio/strops.c when trying to run through GDB

I get this messeage, when trying to run recover through debug: Could not open file: /build/buildd/eglibc-2.19/libio/strops.c Does anyone know why I get this? Here is my code, in case that has ...
0
votes
1answer
184 views

Broken image cat.jpg? [duplicate]

Thanks to an answer on an earlier question tonight, server.c seems to work perfectly on every file except for cat.jpg. I checked in GDB, and the path is processing perfectly, as is the MIME type. But ...
0
votes
1answer
83 views

Please What's Wrong With My recover code?

Please can someone help me check out what I am missing here? I can recover the files but they are malformed. My code looks like this: #include <stdio.h> #include <stdlib.h> #include <...
0
votes
1answer
533 views

pset4 recover check50 error

I would like some help with recover, after few days of struggle I managed tp finish pset4 recovering all 50 images from file but when i run the cs50 check test it gives me this error $ check50 2015....
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 ...
1
vote
1answer
179 views

pset4, recover.c: difference between two sets of fread() parameters

At first I could not get fread() to read anything from card.raw, but then I made a change to the second and third arguments, and the function worked. Although intuition led me to the change, the two ...
1
vote
2answers
204 views

sprintf compile error

I seem to be having a problem with sprintf, the compiler gives me an error. char* title = sprintf("%03d.jpg", counter); The above gives me the following response in the compiler: recover.c:39:39: ...
0
votes
1answer
61 views

pset4 Can't detect a single photo in recover

I face a problem in which the function isjpgheader() never ever returns true for any photo. I would appreciate if someone can offer some advice as to why the function is not working, thank you very ...
0
votes
1answer
107 views

My code will only print 23 jpg's which are unreadable, I have been stuck a long time already, xxd'd the jpg's and everything seems to be fine

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

pset4 - Recover - doesn't pass check50 but works

So, I have finished recover.c (2016 edition) and it recovers all 50 of the jpg-s, and labels tham from 000 to 049. I have looked at every jpg, and they seem intact, all of them (I opened each of them ...
1
vote
1answer
290 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 ...
0
votes
1answer
2k views

File size limit exceeded error in resize.c

#include<stdio.h> #include<stdlib.h> #include<stdint.h> int main(int argc, char* argv[]) { FILE* card = fopen("card.raw", "r"); if(card==NULL) { printf("File cannot be ...
1
vote
1answer
1k 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 ...
0
votes
2answers
213 views

pset4 recover not recognizing jpg signature

I've been having problems with recognizing the jpg signature (0xffd8ff) in my code. In my current version, the first if statement never recognizes the first few bytes of a block; therefore, it won't ...
2
votes
1answer
2k views

cs50 pset 4 Recover - I get 50 blank images of different sizes

I cannot figure out where in heck I've gone wrong with this program. It outputs 50 files, numbered correctly and with different sizes. However, they are all blank. When I run "head -q -c4 *.jpg | ...
0
votes
1answer
144 views

Recover: all 50 JPGs have “0” as first byte instead of 0xff

I've been stuck for days with this problem. My recover program creates 50 jpgs but none of them show. When I look at the first 4 bytes of each, bytes 2 - 4 are correct for JPG signature. But byte ...
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 ...
1
vote
2answers
674 views

pset 4 Recover: how to validate the 4 bits in the 4th byte in JPG signature?

I started this course in 2015 and it is great. It is taking a while to work through it and loving the challenge. For Recover in pset 4, my code works for finding and matching the first 3 static ...
0
votes
1answer
65 views

How to compare first byte of 512 block?

how to compare first byte of 512 block? char buffer[512]; for (int i = 0; i < 20000000/512; i++) { fread(&buffer, 512, 1, inpt_file); if (strcmp(buffer[0],0xff) == 0) { ...
0
votes
1answer
134 views

recover and jpg signature

I wanted to finish the psets I left behind throughout the course...I still want to, even if it is not in this year, I just don't know why my code isn't detecting the jpg signatures, it goes on an ...
0
votes
1answer
48 views

Unable to open JPGs recover.c

I started this a couple of weeks ago, went away fro Christmas and have now come back to finish it. This compiles and runs and finds/creates 16 jpg files however I can't open any of them. I feel like ...

1
12 13
14
15 16
18