76 if (index_hash ==
NULL) {
78 if (index_hash ==
NULL)
94 index_hash->
crc32 = 0;
137 (
const uint8_t *)(sizes),
sizeof(sizes));
148 if (index_hash->
sequence != SEQ_BLOCK
187 const size_t in_start = *
in_pos;
201 ret = lzma_vli_decode(&index_hash->
remaining,
215 ? SEQ_PADDING_INIT : SEQ_UNPADDED;
220 case SEQ_UNCOMPRESSED: {
225 ret = lzma_vli_decode(
size, &index_hash->
pos,
233 if (index_hash->
sequence == SEQ_UNPADDED) {
239 index_hash->
sequence = SEQ_UNCOMPRESSED;
262 ? SEQ_PADDING_INIT : SEQ_UNPADDED;
268 case SEQ_PADDING_INIT:
277 if (index_hash->
pos > 0) {
303 index_hash->
crc32 = lzma_crc32(
in + in_start,
315 if (((index_hash->
crc32 >> (index_hash->
pos * 8))
319 }
while (++index_hash->
pos < 4);
330 index_hash->
crc32 = lzma_crc32(
in + in_start,
const lzma_allocator lzma_vli unpadded_size
RzBinInfo * info(RzBinFile *bf)
const lzma_allocator const uint8_t size_t * in_pos
const lzma_allocator const uint8_t size_t in_size
const lzma_allocator * allocator
const lzma_allocator const uint8_t * in
const lzma_allocator const uint8_t size_t uint8_t * out
void lzma_check_finish(lzma_check_state *check, lzma_check type)
Finish the check calculation and store the result to check->buffer.u8.
void lzma_check_update(lzma_check_state *check, lzma_check type, const uint8_t *buf, size_t size)
Update the check state.
void lzma_check_init(lzma_check_state *check, lzma_check type)
Initialize *check depending on type.
static lzma_vli index_stream_size(lzma_vli blocks_size, lzma_vli count, lzma_vli index_list_size)
Calculate the total size of the Stream.
static lzma_vli vli_ceil4(lzma_vli vli)
Round the variable-length integer to the next multiple of four.
#define UNPADDED_SIZE_MAX
Maximum Unpadded Size.
static lzma_vli index_size(lzma_vli count, lzma_vli index_list_size)
Calculate the size of the Index field including Index Padding.
static lzma_vli index_size_unpadded(lzma_vli count, lzma_vli index_list_size)
Calculate the size of the Index field excluding Index Padding.
#define UNPADDED_SIZE_MIN
Minimum Unpadded Size.
static lzma_ret hash_append(lzma_index_hash_info *info, lzma_vli unpadded_size, lzma_vli uncompressed_size)
Updates the sizes and the hash without any validation.
LZMA_API(lzma_index_hash *)
assert(limit<=UINT32_MAX/2)
#define LZMA_BACKWARD_SIZE_MAX
Custom functions for memory handling.
Structure to hold internal state of the check being calculated.
union lzma_check_state::@638 buffer
Buffer to hold the final result and a temporary buffer for SHA256.
lzma_check_state check
Check calculated from Unpadded Sizes and Uncompressed Sizes.
lzma_vli index_list_size
Size of the List of Index Records as bytes.
lzma_vli blocks_size
Sum of the Block sizes (including Block Padding)
lzma_vli count
Number of Records.
lzma_vli uncompressed_size
Sum of the Uncompressed Size fields.
lzma_vli uncompressed_size
Uncompressed Size currently being read from an Index Record.
uint32_t crc32
CRC32 of the Index.
enum lzma_index_hash_s::@651 sequence
lzma_index_hash_info blocks
Information collected while decoding the actual Blocks.
lzma_vli remaining
Number of Records not fully decoded.
lzma_index_hash_info records
Information collected from the Index field.
lzma_vli unpadded_size
Unpadded Size currently being read from an Index Record.
Definitions common to the whole liblzma library.
#define return_if_error(expr)
Return if expression doesn't evaluate to LZMA_OK.
void * lzma_alloc(size_t size, const lzma_allocator *allocator) lzma_attribute((__malloc__)) lzma_attr_alloc_size(1)
Allocates memory.
uint64_t uncompressed_size
uint64_t lzma_vli
Variable-length integer type.
#define LZMA_VLI_C(n)
VLI constant suffix.
#define LZMA_VLI_MAX
Maximum supported value of a variable-length integer.
lzma_ret
Return values used by several functions in liblzma.
@ LZMA_PROG_ERROR
Programming error.
@ LZMA_DATA_ERROR
Data is corrupt.
@ LZMA_STREAM_END
End of stream was reached.
@ LZMA_BUF_ERROR
No progress is possible.
@ LZMA_OK
Operation completed successfully.
void lzma_free(void *ptr, const lzma_allocator *allocator)
Frees memory.