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.

Help please with .SNGW decrypt

Featured Replies

  • Author
  • Localization

ponaromixxx, posted Sat Sep 01, 2018 4:43 pm (38024)


Can help?

Code:
    /* check SNGW (Capcom's MT Framework PC games), may be encrypted */
    if (is_sngw) {
        if (read_32bitBE(0x00,streamFile) != 0x4f676753) { /* "OggS" */
            ovmi.xor_value = read_32bitBE(0x00,streamFile);
            ovmi.decryption_callback = sngw_ogg_decryption_callback;
        }
        ovmi.meta_type = meta_OGG_SNGW;
    }


Code:
static void sngw_ogg_decryption_callback(void *ptr, size_t size, size_t nmemb, void *datasource) {
    size_t bytes_read = size*nmemb;
    ogg_vorbis_streamfile * const ov_streamfile = datasource;
    int i;
    char *header_id = "OggS";
    uint8_t key[4];

    put_32bitBE(key, ov_streamfile->xor_value);

    /* bytes are xor'd with key and nibble-swapped, first "OggS" is changed */
    for (i = 0; i < bytes_read; i ) {
        if (ov_streamfile->offset i < 0x04) {
            ((uint8_t*)ptr)[i] = (uint8_t)header_id[(ov_streamfile->offset i) % 4];
        }
        else {
            uint8_t val = ((uint8_t*)ptr)[i] ^ key[(ov_streamfile->offset i) % 4];
            ((uint8_t*)ptr)[i] = ((val << 4) & 0xf0) | ((val >> 4) & 0x0f);
        }
    }
}


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.