Method: Rex::Text.zlib_inflate

Defined in:
lib/rex/text.rb

.zlib_inflate(str) ⇒ String

Uncompresses a string using zlib

Parameters:

  • str (String)

    Compressed string to inflate

Returns:

  • (String)

    The uncompressed version of str



1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
# File 'lib/rex/text.rb', line 1456

def self.zlib_inflate(str)
  if(self.zlib_present?)
    zstream = Zlib::Inflate.new
    buf = zstream.inflate(str)
    zstream.finish
    zstream.close
    return buf
  else
    raise RuntimeError, "Gzip support is not present."
  end
end