Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::Decompress Class Reference

Wrapper for the inflate algorithm. More...

#include <compression.hh>

Public Member Functions

 Decompress (void)
 Initialize the inflate algorithm state.
 
 ~Decompress (void)
 Free algorithm state resources.
 
void input (uint1 *buffer, int4 sz)
 Provide the next sequence of compressed bytes.
 
bool isFinished (void) const
 Return if end of compressed stream is reached.
 
int4 inflate (uint1 *buffer, int4 sz)
 Inflate as much as possible into given buffer.
 

Private Attributes

z_stream compStream
 The zlib inflate algorithm state.
 
bool streamFinished
 Set to true if the end of the compressed stream has been reached.
 

Detailed Description

Wrapper for the inflate algorithm.

Initialize/free algorithm resources. Provide successive arrays of compressed bytes via the input() method. Compute successive arrays of uncompressed bytes via the inflate() method.

Member Function Documentation

◆ inflate()

int4 ghidra::Decompress::inflate ( uint1 *  buffer,
int4  sz 
)

Inflate as much as possible into given buffer.

Return the number of bytes of output space still available. Output may be limited by the amount of space in the output buffer or the amount of data available in the current input buffer.

Parameters
bufferis where uncompressed bytes are stored
szis the size, in bytes, of the buffer
Returns
the number of output bytes still available

References compStream, inflate(), and streamFinished.

Referenced by inflate(), and ghidra::sla::FormatDecode::ingestStream().

◆ input()

void ghidra::Decompress::input ( uint1 *  buffer,
int4  sz 
)
inline

Provide the next sequence of compressed bytes.

Parameters
bufferis a pointer to the compressed bytes
szis the number of bytes

References compStream.

Referenced by ghidra::sla::FormatDecode::ingestStream().


The documentation for this class was generated from the following files: