liblzma (XZ Utils) 5.8.0
Data Structures | Macros | Functions
bcj.h File Reference

Branch/Call/Jump conversion filters. More...

This graph shows which files directly or indirectly include this file:

Data Structures

struct  lzma_options_bcj
 Options for BCJ filters. More...
 

Macros

#define LZMA_FILTER_X86   LZMA_VLI_C(0x04)
 Filter for x86 binaries.
 
#define LZMA_FILTER_POWERPC   LZMA_VLI_C(0x05)
 Filter for Big endian PowerPC binaries.
 
#define LZMA_FILTER_IA64   LZMA_VLI_C(0x06)
 Filter for IA-64 (Itanium) binaries.
 
#define LZMA_FILTER_ARM   LZMA_VLI_C(0x07)
 Filter for ARM binaries.
 
#define LZMA_FILTER_ARMTHUMB   LZMA_VLI_C(0x08)
 Filter for ARM-Thumb binaries.
 
#define LZMA_FILTER_SPARC   LZMA_VLI_C(0x09)
 Filter for SPARC binaries.
 
#define LZMA_FILTER_ARM64   LZMA_VLI_C(0x0A)
 Filter for ARM64 binaries.
 
#define LZMA_FILTER_RISCV   LZMA_VLI_C(0x0B)
 Filter for RISC-V binaries.
 

Functions

size_t lzma_bcj_arm64_encode (uint32_t start_offset, uint8_t *buf, size_t size) lzma_nothrow
 Raw ARM64 BCJ encoder.
 
size_t lzma_bcj_arm64_decode (uint32_t start_offset, uint8_t *buf, size_t size) lzma_nothrow
 Raw ARM64 BCJ decoder.
 
size_t lzma_bcj_riscv_encode (uint32_t start_offset, uint8_t *buf, size_t size) lzma_nothrow
 Raw RISC-V BCJ encoder.
 
size_t lzma_bcj_riscv_decode (uint32_t start_offset, uint8_t *buf, size_t size) lzma_nothrow
 Raw RISC-V BCJ decoder.
 
size_t lzma_bcj_x86_encode (uint32_t start_offset, uint8_t *buf, size_t size) lzma_nothrow
 Raw x86 BCJ encoder.
 
size_t lzma_bcj_x86_decode (uint32_t start_offset, uint8_t *buf, size_t size) lzma_nothrow
 Raw x86 BCJ decoder.
 

Detailed Description

Branch/Call/Jump conversion filters.

Note
Never include this file directly. Use <lzma.h> instead.

Function Documentation

◆ lzma_bcj_arm64_encode()

size_t lzma_bcj_arm64_encode ( uint32_t  start_offset,
uint8_t *  buf,
size_t  size 
)
extern

Raw ARM64 BCJ encoder.

This is for special use cases only.

Parameters
start_offsetThe lowest 32 bits of the offset in the executable being filtered. For the ARM64 filter, this must be a multiple of four. For the very best results, this should also be in sync with 4096-byte page boundaries in the executable due to how ARM64's ADRP instruction works.
bufBuffer to be filtered in place
sizeSize of the buffer
Returns
Number of bytes that were processed in buf. This is at most size. With the ARM64 filter, the return value is always a multiple of 4, and at most 3 bytes are left unfiltered.
Since
5.7.1alpha

◆ lzma_bcj_arm64_decode()

size_t lzma_bcj_arm64_decode ( uint32_t  start_offset,
uint8_t *  buf,
size_t  size 
)
extern

Raw ARM64 BCJ decoder.

See lzma_bcj_arm64_encode().

Since
5.7.1alpha

◆ lzma_bcj_riscv_encode()

size_t lzma_bcj_riscv_encode ( uint32_t  start_offset,
uint8_t *  buf,
size_t  size 
)
extern

Raw RISC-V BCJ encoder.

This is for special use cases only.

Parameters
start_offsetThe lowest 32 bits of the offset in the executable being filtered. For the RISC-V filter, this must be a multiple of 2.
bufBuffer to be filtered in place
sizeSize of the buffer
Returns
Number of bytes that were processed in buf. This is at most size. With the RISC-V filter, the return value is always a multiple of 2, and at most 7 bytes are left unfiltered.
Since
5.7.1alpha

◆ lzma_bcj_riscv_decode()

size_t lzma_bcj_riscv_decode ( uint32_t  start_offset,
uint8_t *  buf,
size_t  size 
)
extern

Raw RISC-V BCJ decoder.

See lzma_bcj_riscv_encode().

Since
5.7.1alpha

◆ lzma_bcj_x86_encode()

size_t lzma_bcj_x86_encode ( uint32_t  start_offset,
uint8_t *  buf,
size_t  size 
)
extern

Raw x86 BCJ encoder.

This is for special use cases only.

Parameters
start_offsetThe lowest 32 bits of the offset in the executable being filtered. For the x86 filter, all values are valid.
bufBuffer to be filtered in place
sizeSize of the buffer
Returns
Number of bytes that were processed in buf. This is at most size. For the x86 filter, the return value is always a multiple of 1, and at most 4 bytes are left unfiltered.
Since
5.7.1alpha

◆ lzma_bcj_x86_decode()

size_t lzma_bcj_x86_decode ( uint32_t  start_offset,
uint8_t *  buf,
size_t  size 
)
extern

Raw x86 BCJ decoder.

See lzma_bcj_x86_encode().

Since
5.7.1alpha