diff options
| author | jakob <jakob@memeware.net> | 2017-01-09 20:51:41 -0500 |
|---|---|---|
| committer | jakob <jakob@memeware.net> | 2017-01-09 20:51:41 -0500 |
| commit | 8eaa3f0526d380afe422152fada2bea27b8d8f70 (patch) | |
| tree | eded2f25609b6d131a377233fb215efac2b31c18 /src/file.h | |
| parent | 7d141c7e79bb9688a475b88722f6101ad01ef782 (diff) | |
Significant progress on implementing file decryption. Offsets as of now are trying to go from within the table, which is incorrect. A working commit should come tomorrow.
Diffstat (limited to 'src/file.h')
| -rw-r--r-- | src/file.h | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -19,11 +19,24 @@ #include <stdint.h> +/* Structure representing a 28-byte segment in a file. */ typedef struct { - uint32_t filename_key; - uint64_t timestamp, compressed_size, decompressed_size, offset; -} file_entry; -// Decompressed/compressed size same in info/segm? + uint32_t compressed; /* Whether or not the chunk is compressed. */ + uint64_t offset; /* Chunk's position in the file as an offset. */ + uint64_t compressed_size; /* Chunk's compressed size. */ + uint64_t decompressed_size; /* Chunk's decompressed size. */ +} segment; -/* Document and update documentation in header file. */ -void read_file_entry(memory_stream *data_stream, Bytef *section_end); +/* Node in a linked list of file entries to write to disk. */ +typedef struct file_node { + int compressed; /* Whether or not the archive is compressed. */ + uint32_t key; /* Key associated with matching eliF entry. */ + uint64_t compressed_size; /* Size of compressed chunk. */ + uint64_t decompressed_size; /* Size of decompressed data. */ + uint64_t segment_count; /* Number of segments in File entry. */ + segment **segments; /* Data segments associated with the entry. */ + struct file_node *next; /* Pointer to the next node. */ +} file_node; + +/* Creates a file node by parsing a file entry. */ +file_node *read_file_node(memory_stream *data_stream, Bytef *section_end); |