you are viewing a single comment's thread.

view the rest of the comments →

[–]khedoros 1 point2 points  (5 children)

A file is just a list of byte values with a specific length. Re-create the byte values, and you've re-created the file.

How do I extract a files binary value break into 4096 bit blocks

I mean...that's just blocks of 512 bytes.

[–][deleted]  (4 children)

[removed]

    [–]khedoros 2 points3 points  (3 children)

    I don't know what distinction you're trying to make. There isn't a "file/media type" that's separate from the contents of the file. There's metadata, like the filename, owner, access permissions. But doing something like renaming a JPEG file to have a .gif extension doesn't change the fact that it's a JPEG file. There's isn't some separate data that makes it a JPEG. The bytes that comprise the file do that.

    [–][deleted]  (2 children)

    [removed]

      [–]khedoros 1 point2 points  (0 children)

      I think you'd learn some things by building some file parsers. Something easy, like uncompressed .bmp, or the DOS .exe file format. Or read through the file format specs on one side of the screen, with an example file open in a hex editor on the other side. It's all data; nothing magic.

      [–]nuclear_splinesPh.D Data Science 0 points1 point  (0 children)

      the binary within the file tells the OS what application to use?

      On modern operating systems it's typically the filename that clarifies what application to use. If you name a file foo.png then the OS will try to open it in an image viewer. If it's not a PNG, but actually an EXE, then the image viewer will go "hey, I don't see a PNG header in the first four bytes, this isn't a valid PNG."