Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | ctx |
Macros | |
#define | HEADER_BYTES_ZIP 9 |
#define | HEADER_MAGIC_LENGTH 4 |
#define | HEADER_MAGIC1_OFFSET 0 |
#define | HEADER_MAGIC2_OFFSET 2 |
#define | HEADER_SIZE_OFFSET 9 |
#define | HEADER_SIZE_LENGTH 8 |
#define | HEADER_PARAMETERS_LENGTH 5 |
#define | HEADER_LZMA_ALONE_LENGTH (HEADER_PARAMETERS_LENGTH + HEADER_SIZE_LENGTH) |
Enumerations | |
enum | header_state { INCOMPLETE , OUTPUT , DONE } |
Functions | |
static zip_uint64_t | maximum_compressed_size (zip_uint64_t uncompressed_size) |
static void * | allocate (bool compress, int compression_flags, zip_error_t *error, zip_uint16_t method) |
static void * | compress_allocate (zip_uint16_t method, int compression_flags, zip_error_t *error) |
static void * | decompress_allocate (zip_uint16_t method, int compression_flags, zip_error_t *error) |
static void | deallocate (void *ud) |
static zip_uint16_t | general_purpose_bit_flags (void *ud) |
static int | map_error (lzma_ret ret) |
static bool | start (void *ud, zip_stat_t *st, zip_file_attributes_t *attributes) |
static bool | end (void *ud) |
static bool | input (void *ud, zip_uint8_t *data, zip_uint64_t length) |
static void | end_of_input (void *ud) |
static zip_compression_status_t | process (void *ud, zip_uint8_t *data, zip_uint64_t *length) |
Variables | |
zip_compression_algorithm_t | zip_algorithm_xz_compress |
zip_compression_algorithm_t | zip_algorithm_xz_decompress |
#define HEADER_BYTES_ZIP 9 |
Definition at line 44 of file zip_algorithm_xz.c.
#define HEADER_LZMA_ALONE_LENGTH (HEADER_PARAMETERS_LENGTH + HEADER_SIZE_LENGTH) |
Definition at line 51 of file zip_algorithm_xz.c.
#define HEADER_MAGIC1_OFFSET 0 |
Definition at line 46 of file zip_algorithm_xz.c.
#define HEADER_MAGIC2_OFFSET 2 |
Definition at line 47 of file zip_algorithm_xz.c.
#define HEADER_MAGIC_LENGTH 4 |
Definition at line 45 of file zip_algorithm_xz.c.
#define HEADER_PARAMETERS_LENGTH 5 |
Definition at line 50 of file zip_algorithm_xz.c.
#define HEADER_SIZE_LENGTH 8 |
Definition at line 49 of file zip_algorithm_xz.c.
#define HEADER_SIZE_OFFSET 9 |
Definition at line 48 of file zip_algorithm_xz.c.
enum header_state |
|
static |
Definition at line 107 of file zip_algorithm_xz.c.
References ctx::compress, compress(), ctx::compression_flags, DONE, ctx::end_of_input, ctx::error, error(), ctx::header, ctx::header_bytes_offset, ctx::header_state, INCOMPLETE, LZMA_PRESET_EXTREME, malloc(), memset(), ctx::method, NULL, ZIP_CM_LZMA, ZIP_ER_MEMORY, zip_error_set(), and ctx::zstr.
Referenced by compress_allocate(), and decompress_allocate().
|
static |
Definition at line 139 of file zip_algorithm_xz.c.
References allocate(), ctx::compression_flags, error(), and ctx::method.
|
static |
|
static |
Definition at line 145 of file zip_algorithm_xz.c.
References allocate(), ctx::compression_flags, error(), and ctx::method.
|
static |
|
static |
Definition at line 306 of file zip_algorithm_xz.c.
References ctx::end_of_input.
|
static |
Definition at line 158 of file zip_algorithm_xz.c.
References ctx::compress, ctx::method, and ZIP_CM_LZMA.
|
static |
Definition at line 249 of file zip_algorithm_xz.c.
References _zip_buffer_free(), _zip_buffer_new(), _zip_buffer_put_64(), ctx::compress, DONE, ctx::error, ctx::header, ctx::header_bytes_offset, HEADER_BYTES_ZIP, HEADER_LZMA_ALONE_LENGTH, HEADER_MAGIC2_OFFSET, HEADER_MAGIC_LENGTH, HEADER_SIZE_LENGTH, HEADER_SIZE_OFFSET, ctx::header_state, INCOMPLETE, length, LZMA_OK, LZMA_RUN, memcpy(), ctx::method, NULL, UINT_MAX, ctx::uncompresssed_size, ZIP_CM_LZMA, ZIP_ER_COMPRESSED_DATA, ZIP_ER_INVAL, ZIP_ER_MEMORY, zip_error_set(), ZIP_MIN, and ctx::zstr.
Definition at line 174 of file zip_algorithm_xz.c.
References LZMA_DATA_ERROR, LZMA_MEM_ERROR, LZMA_OPTIONS_ERROR, LZMA_UNSUPPORTED_CHECK, ZIP_ER_COMPRESSED_DATA, ZIP_ER_INTERNAL, ZIP_ER_INVAL, and ZIP_ER_MEMORY.
|
static |
Definition at line 86 of file zip_algorithm_xz.c.
References compressed_size, uncompressed_size, and ZIP_UINT64_MAX.
|
static |
Definition at line 314 of file zip_algorithm_xz.c.
References ctx::compress, DONE, ctx::end_of_input, ctx::error, ctx::header, ctx::header_bytes_offset, HEADER_BYTES_ZIP, HEADER_LZMA_ALONE_LENGTH, HEADER_MAGIC_LENGTH, ctx::header_state, INCOMPLETE, length, LZMA_BUF_ERROR, LZMA_FINISH, LZMA_OK, LZMA_RUN, LZMA_STREAM_END, map_error(), memcpy(), ctx::method, OUTPUT, UINT_MAX, ZIP_CM_LZMA, ZIP_COMPRESSION_END, ZIP_COMPRESSION_ERROR, ZIP_COMPRESSION_NEED_DATA, ZIP_COMPRESSION_OK, zip_error_set(), ZIP_MIN, and ctx::zstr.
|
static |
Definition at line 193 of file zip_algorithm_xz.c.
References ctx::compress, ctx::compression_flags, ctx::error, filters, zip_file_attributes::general_purpose_bit_flags, zip_file_attributes::general_purpose_bit_mask, lzma_filter::id, LZMA_CHECK_CRC64, LZMA_CONCATENATED, LZMA_FILTER_LZMA1, LZMA_FILTER_LZMA2, LZMA_OK, LZMA_VLI_UNKNOWN, map_error(), ctx::method, NULL, opt_lzma, options, lzma_filter::options, zip_stat::size, UINT64_MAX, ctx::uncompresssed_size, zip_stat::valid, zip_file_attributes::valid, ZIP_CM_LZMA, zip_error_set(), ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS, ZIP_STAT_SIZE, ZIP_UINT64_MAX, and ctx::zstr.
zip_compression_algorithm_t zip_algorithm_xz_compress |
Definition at line 379 of file zip_algorithm_xz.c.
zip_compression_algorithm_t zip_algorithm_xz_decompress |
Definition at line 393 of file zip_algorithm_xz.c.