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.

need to learn how XMemDecompress works...

Featured Replies

  • Author
  • Localization

guuudvibez, posted Thu Sep 23, 2021 5:09 pm (66617)


Anyone know where the respective code is in source? also need any links or anything that'll further my understanding of this comtype.
  • Author
  • Localization

aluigi, posted Sat Sep 25, 2021 12:52 pm (66642)


XMemDecompress is part of the Xbox SDK (xcompress.lib) but there is also an open source version that is compatible (even if not supporting all the various features).

This is the code:
Code:
    #define MYALLOC_ZEROES 16

    XMEMDECOMPRESSION_CONTEXT ctx = NULL;
    HRESULT hr;

    hr = XMemCreateDecompressionContext(XMEMCODEC_DEFAULT, NULL, 0, &ctx);
    if(hr != S_OK) exit(1);

    SIZE_T ret = out_size;
    hr = XMemDecompress(ctx, out, &ret, in, in_size MYALLOC_ZEROES);
    if(hr != S_OK) exit(1);

    XMemDestroyDecompressionContext(ctx);


Probably you want to understand what are those MYALLOC_ZEROES... long story short the API is bugged and the only way to make it working correctly was to allocate 16 additional zeroes in the input file and therefore specifying a bigger input size. Failure to do so will result in random errors of the API. Yeah misteries...

By the way, the unxmemlzx function in unz.c of quickbms is really magical. It's an all-in-one beast able to work with all the known types of xmem inputs and formats.
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.