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

pset4 recover - timed out while waiting for program to exit

Whenever I run my code using check50, I get this error: "timed out while waiting for program to exit", and I don't know why this is happening. Any help would be greatly appreciated. Here's my code: #...
0
votes
1answer
57 views

Pset4 Recover: Program works perfectly but jpeg 1 name is not three digits for some reason HELP!

Everything works except the first jpeg gets the name 1 instead of 001 #include <stdio.h> #include <stdlib.h> #include <stdint.h> //includes BYTE struct #include <cs50.h> ...
0
votes
1answer
66 views

pset4 recover: 'recovered image does not match'

My program recovers the images but the recovered images are all blank and check50 says that they "don't match". All the images are 512 bytes in size. Please help me find out why this is happening. My ...
0
votes
1answer
57 views

Recovered Images not clear

I having trouble generating clear images. I am able to generate the 50 JPEGs but they are just random colors or pixelated. I am however, not receiving an "Invalid or unsupported" file format error. I ...
0
votes
1answer
1k views

cs50 pset4 recover 2020

I have been working on pset4 recover, but it is bringing one error how can i rectify it? Here is my code FILE* card_ptr = fopen("card.raw", "r"); if (card_ptr == NULL) { printf("...
0
votes
1answer
85 views

pset4: recover last check wrong

All check correct and it recovers all 50 images but I have this problem and I can't solve it. I know I must find return number from fread function but the return number is 1 no all the elements that ...
0
votes
1answer
60 views

Why is it saying it did not recover any images?

So it seems like I am almost done with recover. My code recover all the pictures except the fist one and last one. On the first one it only recovers a small block on the top right corner. Also the ...
0
votes
1answer
413 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 ...
0
votes
1answer
89 views

Why is fwrite not writing the image except for the second one?

So my code creates the correct number of files in the correct format but they are all empty with the exception of number two that had the first couple of lines but the rest is also empty. Why is it ...
0
votes
1answer
73 views

Why is nothing happening?

I know their is defiantly something wrong and missing to my code but i'm stuck and can't figure out what is missing. It complies and when I run it does not do anything visible. #include <stdio....
0
votes
1answer
73 views

Recover PSET 4 - 26 Invalid Images

Been struggling with the recover PSET for a while now, my code recovers 26 images but when i try to open them i get the following error "Invalid or Unsupported Image Format ". I believe it's because ...
0
votes
1answer
82 views

Segmentation fault pset4 recover

I'm having a segmentation fault which I'm not being able to identify. After reading about other similar problems I thought it could be that I wasn't checking if (img == NULL) but even after adding it ...
1
vote
0answers
24 views

Empty pointer values in Pset 3: "Recover"

I know pointers don't have to be used in this pset, but my first attempt relies on them. The program has other bugs, but I'm wondering why my pointer variable doesn't get values (keep staying empty) ...
0
votes
1answer
61 views

pset 3 Recover Segmentation fault

So, after some manipulations with my code I`ve got to Segmentation fault. Here is my code so far #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { // ensure ...
0
votes
2answers
86 views

recover.c images recovering correctly, but 049.jpg test case failing

The title explains the issue, not really sure why the test case is failing because the logic seems to work. I'm assuming it has to do with reading some unnecessary bytes near the end, but I haven't ...
0
votes
1answer
34 views

jpegs don't process correctly nor do they have correct names

my recover.c goes through the raw file and then opens up new jpg files but only the first one has the correct name 001.jpg the rest have long code names such as 8767661.jpg. Additionally, none of them ...
0
votes
1answer
51 views

PSET3 -I am getting segmentation fault

I am getting seg fault over and over again. Could anyone help out please. I am pretty sure the functional part of the code, the while loop, should be working properly. Thanks in advance. #include &...
0
votes
1answer
38 views

Segmentation fault on PSET3 recover

My program compiles, but wherever it runs I recieve a segmentation fault error. However i cannot see where the source of the problem is: #include <stdio.h> #include <stdlib.h> #include &...
0
votes
1answer
349 views

PSET4 Recover munmap_chunk(): invalid pointer

This my solution to recover problem. It works, but it produces "munmap_chunk(): invalid pointer" error: And Valgrind outputs: ==5906== LEAK SUMMARY: ==5906== definitely lost: 0 bytes in 0 ...
0
votes
1answer
64 views

pset 3 recover - JPEGs don't match

#include <stdio.h> include include int main(int argc, char *argv[]) { //ensure proper usage if (argc != 2) { fprintf(stderr, "Usage: /recover infile\n"); return ...
0
votes
1answer
70 views

Recover: Problem when writing info into image

I'm having trouble when creating the JPG files. The amount of images created and the name is fine, but the content of the image is wrong. Here is my code: int main(int argc, char *argv[]) { if( ...
0
votes
1answer
85 views

Having trouble getting recover off the ground

I'm sorry to do this but I'm fairly lost with this pset3 recover for cs50. I've been researching for hours and am no closer to figuring out how to utilize FILE *outptr = fopen and sprintf(filename, "%...
0
votes
1answer
52 views

Recover: Segmentation fault

Everytime I try to run this code, it gives me a segmentation fault error. What is wrong with my logic? #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { // ...
0
votes
1answer
71 views

Pset4 - Recover: Weird output

This problem set is the worst and it made me cry 🤣 Take a look at this code: #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { // ...
0
votes
1answer
30 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
41 views

pset3 Recover will not find the start of a JPEG

Having some trouble with problem set 3's recover. Running the code below I get a segmentation error but using the debugger I found that the program would not find the start of a JPEG even though the ...
0
votes
1answer
392 views

Recover cs50 Please help!

Can somebody please help with this question? ... and also I tried to debug and apparently it doesn't run my while loop and i don't understand why. while (fread(buffer, 512, 1, fraw) == 1) so ...
0
votes
1answer
69 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
143 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
1answer
74 views

Still stuck on Recover Pset3, but getting closer

really sorry, not sure how to format copy-and-pasted code so it renders correctly in this forum. I'm hoping for a hint or two on how to get my Recover program (PSet 3, 2018) to work. I'm able to get ...
0
votes
1answer
66 views

pset3 "Recover"

I am facing some troubles, only one blank image is generated , any help? // Program to recover lost photos. #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <...
0
votes
1answer
130 views

why is check50 returning error of lack of forensic image and some jpg not found

this is my code // Open the card.raw file and check for NULL FILE* card_ptr = fopen("card.raw", "r"); [admin removed rest of code] and this is my error message generated from check50 :) recover.c ...
0
votes
1answer
42 views

Can't debug recover

I can't figure out what's wrong in my code. I'm getting 49 blank images along with gibberish files with jpg extension like below. Please drop a comment if anything is unclear in my code. Edit: ...
0
votes
1answer
140 views

Recover produces 49 blank images

I know that there are many other issues with my code, but I cannot seem to understand why only 49 images are recovered. Also, it would be great to get any pointers to why all of the recovered are ...
0
votes
1answer
61 views

Recover help - only 2 imgs are getting recovered

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

Error on running recover

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

How can I find out the size of what i have just read with fread()?

currently my code looks like this. int finds_reading_length(FILE* the_open_file, int the_block_size) { fseek(the_open_file,-the_block_size,SEEK_CUR); BYTE* buffer[the_block_size + 1]; ...
0
votes
1answer
241 views

Not Recovering the last "Recover" image

Having an incredibly tough time figuring out where my error is. The JPEG outputs look good but when I do check 50, I'm getting a :( for "recovers 049.jpg correctly - recovered image does not match....
0
votes
1answer
146 views

CS50 pset3 recover

After running it, I got the error massage "double free or corruption (top) Aborted". And I only got 000.jpg. Need some advice, thanks. int main(int argc, char *argv[]) { //ensure proper usage ...
0
votes
1answer
10k views

Recover: Fatal error: glibc detected an invalid stdio handle

I'm trying to do the recover assignment, but when I try to run it I get the error: Fatal error: glibc detected an invalid stdio handle Aborted I have no idea what this means or where to start to ...
0
votes
1answer
47 views

PSET3 Recover generates 50 files, but they are only 0-50% complete. Review appreciated

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { // ensure proper usage if (argc != 2) { ...
0
votes
1answer
134 views

Stuck on recover for 1 month - a couple of issues

So anyways, ive been stuck on recover for like a month because of some issues, im completely lost and id appreciate some feedback on my program. here are the issues: 1. the program only finds 4 jpegs ...
0
votes
1answer
14 views

How do I change the value of "a" via "b"?

e.g. Input: int a = 1; int b = a; b = 5; printf("%i \n", a); Output: 5 I have tried writing things like int* b = &a; b = 5; However i cant change b into an integer from a pointer?
0
votes
1answer
65 views

Pset4 'Recover' - Help! How can I solve this segmentation fault?

For pset4 'Recover', I'm facing a segmentation fault but I cannot find what I did wrong in my code. If I use echo$? to find where the bug is, it returns the value 1. Can someone help me to point me in ...
0
votes
1answer
359 views

CS50 Recover compiles, but doesn't compile on check50?

on the 2019 pset 3 on CS50, my code for "Recover" is working and compiling, but when I go to check50, it fails to compile. Picture of code: https://pastebin.com/rCALvDjq Picture of error messages: ...
0
votes
1answer
21 views

i have tried it with small diffs a lot of times.i feel more comfortable about this, but still not working.what am i doing wrong??thanks in advance

// creat a counter that keepw trach of jpegs found int counter = 0; // crate a string filename for sprintf char filename[8]; // FILE* picture = NULL; // chech if we have found ...
0
votes
1answer
53 views

Pset 4--51 files created instead of 50

Apologies for including all my (60 lines) of code, but I've been thoroughly confused by this for a while. I've written code to do Recover, and it's working fine and recovers images perfectly--it just ...
0
votes
1answer
37 views

pset4: check50 say that recover.c compiled with an exit code of 1 and not 0

I completed my code and it recovers all images fine. However, when I ran check50 for recover, I received this error code with a domino effect on the rest of them: https://legacy.cs50.me/checks/...
0
votes
1answer
108 views

What's wrong with this recover code?

I wrote some code for recover that seems to me to be recovering the image correctly (I can see pictures of people for all 50 images), but for some reason, check50 says that 049.jpg does not match the ...
0
votes
1answer
54 views

jpg's are not proper, mix of multiple images. Can anyone tell me whats wrong?"RECOVER"

here is my code while (fread(buffer, 512, 1, inptr) == 1) { if (buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff && (buffer[3] & 0xf0) == 0xe0) ...

1
3 4
5
6 7
18