Skip to content Skip to sidebar Skip to footer

Reverse Engineering Http Request

I am trying to decode the post data sent to graph.instagram.com by the Android instagram app. The question is simillar to the one found here: Reverse Engineer HTTP request It seems

Solution 1:

To decompress it use inflater that omit header check

Zlib::Inflate.new(-Zlib::MAX_WBITS).inflate(File.read("*.batch.gz"))

In the ruby doc we might read this

Zlib::Inflate.new(window_bits = Zlib::MAX_WBITS)

Creates a new inflate stream for decompression. window_bits sets the size of the history buffer and can have the following values:

  • 0 - Have inflate use the window size from the zlib header of the compressed stream.

  • (8..15) - Overrides the window size of the inflate header in the compressed stream. The window size must be greater than or equal to the window size of the compressed stream.

  • Greater than 15 Add 32 - to window_bits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (a Zlib::DataError will be raised for a non-gzip stream).

  • (-8..-15) - Enables raw deflate mode which will not generate a check value, and will not look for any check values for comparison at the end of the stream.

This is for use with other formats that use the deflate compressed data format such as zip which provide their own check values.

https://ruby-doc.org/stdlib-2.6.3/libdoc/zlib/rdoc/Zlib/Inflate.html

Post a Comment for "Reverse Engineering Http Request"