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.

Dictionary for lzma86dechead

Featured Replies

  • Author
  • Localization

StreamThread, posted Thu Oct 04, 2018 12:08 am (39033)


Hello

DDS image compressed with lzma86dechead and can be successfully decompressed by suitable comtype.

Header when its compressed is:
Code:
00 5D 00 00   80 00 80 00   04 00 00 00 ...


OK. Now it should be compressed back. But with comptype lzma_86dechead_compress, output file have header:
Code:
2C 00 00 00   08 00 80 00   04 00 00 00 ...


Obviously, that is not the result what needed.

Maybe should be some right dictionary for this?

Thanks in advance.
Samples of compressed and source image in attach.
  • Author
  • Localization

aluigi, posted Thu Oct 04, 2018 12:29 am (39036)


Why not? The first byte is a set of flags and both 0x5d and 0x2c are perfectly valid.
  • Author
  • Localization

StreamThread, posted Thu Oct 04, 2018 12:46 am (39037)


IDK, that's just doesn't work. I tryed change flag from 0x2c to 0x5d, but game engine is crash anyway.
That's game is Far Cry Instincts Predator, if important. I writing a packing script for it.

Script is working, packing correct without compression. So, all problem in that compression method. CryEngine is so capricious )

Well, maybe it's still possible packing with "old' lzma_86dechead_compress method, with 0x5d and so on?
  • Author
  • Localization

aluigi, posted Thu Oct 04, 2018 1:19 pm (39052)


I doubt the crash is caused by the properties used by quickbms for better compressing the data (necessary for the original reimport mode), because the compression is just that one and the only difference is a setting supported by the algorithm itself.

This is what quickbms uses for the settings, in lzma_set_properties() in unz.c:
Code:
        props->level = 9;            /*  0 <= level <= 9 */
        props->dictSize = 1<                                       (1 << 12) <= dictSize <= (1 << 30) for 64-bit version
                                       default = (1 << 24) */
        // xz wants lc lp <= 4
        //props->lc = 1;               /* 0 <= lc <= 8, default = 3 */
        //props->lp = 3;               /* 0 <= lp <= 4, default = 0 */
        props->lc = 8;               /* 0 <= lc <= 8, default = 3 */
        props->lp = 4;               /* 0 <= lp <= 4, default = 0 */

        props->pb = 0; /* yeah 0!*/  /* 0 <= pb <= 4, default = 2 */
        //props->algo = 1;             /* 0 - fast, 1 - normal, default = 1 */
        props->fb = 273;             /* 5 <= fb <= 273, default = 32 */
        //props->btMode = 1;           /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
        props->numHashBytes = 4;     /* 2, 3 or 4, default = 4 */
        //props->mc = (1 << 30);       /* 1 <= mc <= (1 << 30), default = 32 */
If I remember correctly the "pb" field set to zero provided better results during my tests and it's the one that probably resulting in 0x5d->0x2c (which is NOT a constant magic, it's a set of flags).

Some info about these fields:
https://stackoverflow.com/questions/305 ... gs-details
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.