Rizin
unix-like reverse engineering framework and cli tools
|
LZMA decoder. More...
#include "lz_decoder.h"
#include "lzma_common.h"
#include "lzma_decoder.h"
#include "range_decoder.h"
Go to the source code of this file.
Classes | |
struct | lzma_length_decoder |
Length decoder probabilities; see comments in lzma_common.h. More... | |
struct | lzma_lzma1_decoder |
Macros | |
#define | seq_4(seq) |
#define | seq_6(seq) |
#define | seq_8(seq) |
#define | seq_len(seq) |
#define | len_decode(target, ld, pos_state, seq) |
#define | d(seq) |
LZMA decoder.
Definition in file lzma_decoder.c.
#define d | ( | seq | ) |
#define len_decode | ( | target, | |
ld, | |||
pos_state, | |||
seq | |||
) |
Definition at line 117 of file lzma_decoder.c.
#define seq_4 | ( | seq | ) |
Definition at line 75 of file lzma_decoder.c.
#define seq_6 | ( | seq | ) |
Definition at line 81 of file lzma_decoder.c.
#define seq_8 | ( | seq | ) |
Definition at line 89 of file lzma_decoder.c.
#define seq_len | ( | seq | ) |
Definition at line 99 of file lzma_decoder.c.
|
static |
Definition at line 290 of file lzma_decoder.c.
References ALIGN_BITS, assert(), d, dict_get(), dict_is_distance_valid(), dict_put(), dict_repeat(), DIST_MODEL_END, DIST_MODEL_START, DIST_SLOTS, lzma_dict::full, get_dist_state, in, in_pos, in_size, is_literal_state, len, len_decode, limit, lzma_dict::limit, literal_subcoder, LZMA_DATA_ERROR, LZMA_OK, LZMA_STREAM_END, LZMA_VLI_UNKNOWN, MATCH_LEN_MAX, MATCH_LEN_MIN, out, lzma_dict::pos, rc_bit, rc_bit_case, rc_bit_last, rc_direct, rc_from_local, rc_if_0, rc_is_finished, rc_normalize, rc_read_init(), rc_reset, rc_to_local, rc_update_0, rc_update_1, restrict, STATE_LIT_LIT, STATE_MATCH_LIT, STATE_MATCH_LIT_LIT, STATE_REP_LIT, STATE_REP_LIT_LIT, STATE_SHORTREP_LIT, STATE_SHORTREP_LIT_LIT, UINT32_MAX, unlikely, update_long_rep, update_match, and update_short_rep.
Referenced by lzma_lzma_decoder_create().
|
static |
Allocate and initialize LZMA decoder. This is used only via LZ initialization (lzma_lzma_decoder_init() passes function pointer to the LZ initialization).
Definition at line 970 of file lzma_decoder.c.
References allocator, lzma_lz_decoder::coder, is_lclppb_valid(), lzma_decoder_reset(), lzma_decoder_uncompressed(), lzma_lzma_decoder_create(), LZMA_OK, LZMA_PROG_ERROR, LZMA_VLI_UNKNOWN, options, and return_if_error.
Referenced by lzma_lzma_decoder_init().
|
static |
Definition at line 859 of file lzma_decoder.c.
References ALIGN_BITS, bit_reset, bittree_reset, lzma_length_decoder::choice, lzma_length_decoder::choice2, DIST_MODEL_END, lzma_lzma1_decoder::dist_slot, DIST_SLOT_BITS, DIST_STATES, FULL_DISTANCES, lzma_length_decoder::high, i, lzma_lzma1_decoder::is_match, lzma_lzma1_decoder::is_rep, lzma_lzma1_decoder::is_rep0, lzma_lzma1_decoder::is_rep0_long, lzma_lzma1_decoder::is_rep1, lzma_lzma1_decoder::is_rep2, lzma_lzma1_decoder::len, LEN_HIGH_BITS, LEN_LOW_BITS, LEN_MID_BITS, lzma_lzma1_decoder::limit, lzma_lzma1_decoder::literal, lzma_lzma1_decoder::literal_context_bits, literal_init(), lzma_lzma1_decoder::literal_pos_mask, lzma_length_decoder::low, lzma_lzma1_decoder::match_len_decoder, lzma_length_decoder::mid, NULL, lzma_lzma1_decoder::offset, options, lzma_lzma1_decoder::pos_align, lzma_lzma1_decoder::pos_mask, lzma_lzma1_decoder::pos_special, lzma_lzma1_decoder::probs, lzma_lzma1_decoder::rc, rc_reset, lzma_lzma1_decoder::rep0, lzma_lzma1_decoder::rep1, lzma_lzma1_decoder::rep2, lzma_lzma1_decoder::rep3, lzma_lzma1_decoder::rep_len_decoder, lzma_lzma1_decoder::sequence, lzma_lzma1_decoder::state, STATE_LIT_LIT, STATES, and lzma_lzma1_decoder::symbol.
Referenced by lzma_decoder_init(), and lzma_lzma_decoder_create().
|
static |
Definition at line 851 of file lzma_decoder.c.
References lzma_lzma1_decoder::uncompressed_size, and uncompressed_size.
Referenced by lzma_decoder_init(), and lzma_lzma_decoder_create().
lzma_ret lzma_lzma_decoder_create | ( | lzma_lz_decoder * | lz, |
const lzma_allocator * | allocator, | ||
const void * | opt, | ||
lzma_lz_options * | lz_options | ||
) |
Definition at line 942 of file lzma_decoder.c.
References allocator, lzma_lz_decoder::code, lzma_lz_decoder::coder, lzma_lz_options::dict_size, lzma_alloc(), lzma_decode(), lzma_decoder_reset(), lzma_decoder_uncompressed(), LZMA_MEM_ERROR, LZMA_OK, NULL, options, lzma_lz_options::preset_dict, lzma_lz_options::preset_dict_size, lzma_lz_decoder::reset, and lzma_lz_decoder::set_uncompressed.
Referenced by lzma2_decoder_init(), and lzma_decoder_init().
lzma_ret lzma_lzma_decoder_init | ( | lzma_next_coder * | next, |
const lzma_allocator * | allocator, | ||
const lzma_filter_info * | filters | ||
) |
Allocates and initializes LZMA decoder.
Definition at line 987 of file lzma_decoder.c.
References allocator, assert(), filters, init, lzma_decoder_init(), lzma_lz_decoder_init(), and NULL.
Referenced by alone_decode().
Definition at line 1025 of file lzma_decoder.c.
References is_lclppb_valid(), lzma_lzma_decoder_memusage_nocheck(), options, and UINT64_MAX.
Referenced by alone_decode().
Definition at line 1016 of file lzma_decoder.c.
References lzma_options_lzma::dict_size, lzma_lz_decoder_memusage(), and options.
Referenced by lzma_lzma2_decoder_memusage(), and lzma_lzma_decoder_memusage().
bool lzma_lzma_lclppb_decode | ( | lzma_options_lzma * | options, |
uint8_t | byte | ||
) |
Decodes the LZMA Properties byte (lc/lp/pb)
Definition at line 1000 of file lzma_decoder.c.
References LZMA_LCLP_MAX, and options.
Referenced by alone_decode(), lzma2_decode(), and lzma_lzma_props_decode().
lzma_ret lzma_lzma_props_decode | ( | void ** | options, |
const lzma_allocator * | allocator, | ||
const uint8_t * | props, | ||
size_t | props_size | ||
) |
Definition at line 1035 of file lzma_decoder.c.
References allocator, lzma_options_lzma::dict_size, error(), lzma_alloc(), lzma_free(), lzma_lzma_lclppb_decode(), LZMA_MEM_ERROR, LZMA_OK, LZMA_OPTIONS_ERROR, NULL, options, lzma_options_lzma::preset_dict, lzma_options_lzma::preset_dict_size, props, and read32le().