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.

Pokemon: Alpha Sapphire 3DS "CRAG" - decompression problem

Featured Replies

  • Author
  • Localization

AlphaTwentyThree, posted Wed Aug 30, 2017 9:08 am (26047)


Hello!
I'm currently trying to correctly extract files from these archives. A comtype scan revealed that either LZ77WII or DS_LZX seems to be working. For most of the files this works fine but sometimes I get the message that some files are not compressed with this particular compression. There's no identifier for the compression either.
Here's the really simple script:
Code:
idstring "CRAG"
comtype LZ77WII
#comtype DS_LZX
get BNAME basename
goto 0x1c
getDstring IDENT 4
get MYOFF long
math MYOFF = 0x1c
goto MYOFF
getDstring IDENT 4
get BLOCKSIZE long
get FILES long
savepos GOTOHERE
math MYOFF = BLOCKSIZE
goto MYOFF
getDstring IDENT 4
get BLOCKSIZE long
xmath BIAS "MYOFF BLOCKSIZE"
goto GOTOHERE
for i = 1 <= FILES
   get UNK long
   get OFFSET long
   math OFFSET = BIAS
   get OFFSET2 long
   get ZSIZE long
   xmath SIZE "ZSIZE * 0x100"
   clog "" OFFSET ZSIZE SIZE
next i


Examples 1: http://www91.zippyshare.com/v/jcjRXGWe/file.html
Examples 2: http://www116.zippyshare.com/v/jr6KwuzF/file.html (quickBMS crashes)


Thanks for taking a look!
  • Author
  • Localization

aluigi, posted Wed Aug 30, 2017 8:08 pm (26077)


You are right, there is nothing saying if that block of data is compressed or not
  • Author
  • Localization

aluigi, posted Wed Aug 30, 2017 8:18 pm (26078)


This is my script:
http://aluigi.org/bms/pokemon_grac.bms

Obviously I had to use a work-around to know if files are compressed or not.

Please note that your file 9 in the second archive was incomplete because the last file doesn't fit in the archive.
  • Author
  • Localization

AlphaTwentyThree, posted Wed Aug 30, 2017 8:59 pm (26089)


Cool, that's another way to get to the according block. :)
Thanks for the script so far!
I merged all the archives with another installment of Pokemon and these are the ones where the script crashes:
http://www57.zippyshare.com/v/iNK3frhj/file.html
Thanks for further analysis.
  • Author
  • Localization

aluigi, posted Wed Aug 30, 2017 9:23 pm (26093)


Ok script updated but I can do absolutely nothing about the compressed vs non-compressed files so be prepared to "algorithm 115" errors.
Script 0.2
  • Author
  • Localization

AlphaTwentyThree, posted Wed Aug 30, 2017 10:07 pm (26098)


Thanks a lot!!
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.