Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (gdb) run card.raw
- Starting program: /home/jrupinski/CS50/pset4/recover/recover card.raw
- Missing separate debuginfos, use: dnf debuginfo-install glibc-2.24-4.fc25.x86_64
- JPEG Header found!
- JPEG Header found!
- new file created : 000.jpg
- Breakpoint 1, main (argc=2, argv=0x7fffffffdf68) at recover.c:60
- 60 while (fread(outptr, 1, 512, inptr) == 512)
- (gdb) n
- 63 fseek(inptr, -512, SEEK_CUR);
- (gdb) n
- 66 for(int i = 0, arr_size = sizeof(byte_array); i < arr_size; i++)
- (gdb) n
- 68 fread(&byte_array[i], 1, 1, inptr);
- (gdb) print /x byte_array[0]
- $1 = 0x0
- (gdb) n
- 69 fwrite(&byte_array[i], 1, 1, outptr);
- (gdb) print /x byte_array[0]
- $2 = 0xff
- (gdb) n
- Fatal error: glibc detected an invalid stdio handle
- Fatal error: glibc detected an invalid stdio handle
- Program received signal SIGABRT, Aborted.
- 0x00007ffff773d91f in raise () from /lib64/libc.so.6
- (gdb) n
- Single stepping until exit from function raise,
- which has no line number information.
- Program terminated with signal SIGABRT, Aborted.
- The program no longer exists.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement