RawFS (Raw File System)

来源:互联网 发布:2017悬疑推理网络剧 编辑:程序博客网 时间:2024/05/17 01:33

 When storing multiple files on unpartitioned space there must be a specification how they are stored. For dedicated attacks (if only 1 file need to be stored) then only the file could be stored raw, however, I want to have a flexible solution where I can store multiple files and acces them via file names. An advantage of this is the better abstraction of hiding and accessing files which can be done via a driver in Windows.

RawFS structures the file system into sectors (512 byte blocks). It is intended to be easy and most flexible with less efforts in reading and writing.
The first sector contains the File Table which tells the location of files and the position of the next File Table.

Every file table is structured as:
  - 512 bytes of size
  - contains 16 entries with each 32 byte of size
  - each entry has following format

        + 0   8 bytes     Sector number of the file
        + 8   8 bytes     Size (in bytes) of the file
        + 16  16 bytes    MD5 hash of the file name
        ---------------------------------------------
              32 bytes per entry

  - special entries (md5 of the names)

        D41D8CD98F00B204E9800998ECF8427E    File Table

The next File Table is pointed to by the file "". There is only one (the first found) next File Table valid. If a file name is requested, the md5 must be generated and compared against all md5 hashes of the file table. Only the file name without any slashes and paths may be used for generating the md5.