Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

i want to compress with a raw deflate stream with zlib

Featured Replies

  • Author
  • Localization

Bleech Studios, posted Fri Feb 12, 2021 12:44 pm (62146)


i want to compress with a raw deflate stream with zlib but whenever I do it comes out with some weird header '2q..', I need the header to be 0xED like I normally see (complicated to explain). Im using zlib 1.2.8 and this version should do it.
I use this for deflate init:
Code:
deflateInit2(&stream, 1, Z_DEFLATED, -15, 1, Z_FILTERED);
. Most deflate streams start with a 0xe*, so why isnt it giving me that? the stream is valid, i checked using offzip.

Basically, if anyone can find the exact options for zlib (ive tried many) and version of zlib on the want_unpack.dat to get the want.dat then thats what Im aiming for
  • Author
  • Localization

aluigi, posted Fri Feb 12, 2021 3:50 pm (62149)


Have you tried the default deflateInit or the following?
Code:
deflateInit2(&stream, 9, Z_DEFLATED, -15, 9, Z_FILTERED)

packzip is quite useful for these tests: packzip -w -15 -m 1 want_unpack.dat output.dat
Both -m 1 and -m 3 gives the initial 0xed that you want.

I don't think it makes any difference in decompression, I'm just answering to your request :)
  • Author
  • Localization

Bleech Studios, posted Fri Feb 12, 2021 5:37 pm (62150)


Thanks aluigi that worked!!
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.