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.

DDS Texture archive, extract with real filenames

Featured Replies

  • Author
  • Localization

beastedot9, posted Sun Apr 03, 2016 1:32 pm (12379)


Hello everyone, I'm having a little issue with these texture archives. I can extract them but I'm wondering what I could do with the script to get the filenames and make the files output with those. Because right now the files extract with 0000000000.dds, 00000000001.dds etc.

Here is a screenshot of the archive:

Image

The bit marked in red is the number of archives, the green highlighted area is the filename and the blue highlighted area is the offset of the texture in the archive (little endian). 4 bytes before the offset is the file size of the textures I'm assuming.

So far I'm using this script by AlphaTwentyThree to extract the DDS files where it finds instances of them:

Code:
findloc OFFSET string "DDS"
do
    goto OFFSET
    get DUMMY long
    findloc NEXT_OFFSET string "DDS" 0 ""
    if NEXT_OFFSET == ""
        get SIZE asize
    else
        math SIZE = NEXT_OFFSET
    endif
    math SIZE -= OFFSET
    log "" OFFSET SIZE
    math OFFSET = NEXT_OFFSET
while NEXT_OFFSET != ""


How can I rewrite this to also get the filenames and extract the files with the names? Any help is appreciated.

Also a sample file if needed: https://mega.nz/#!1xw1FT6C!Z2bFmvHKYpLi ... F9xn-4XAAs
  • Author
  • Localization

MerlinSVK, posted Sun Apr 03, 2016 7:38 pm (12395)


It's not super cool, but it works. At least on that provided example file.

Code:
get FILES long
get UNK1 long
get UNK2 long
get MAXNAMESIZE long
for i = 0 < FILES
get FBASENAME string
   savepos POSITION
   strlen NAMELENGTH FBASENAME
   xmath POSITION "POSITION (MAXNAMESIZE - NAMELENGTH) - 0x01"
goto POSITION
get FEXTNAME string
   string FBASENAME "."
   string FBASENAME FEXTNAME
get FSIZE long
get FOFFSET long
get NULL long
   log FBASENAME FOFFSET FSIZE
next i
  • Author
  • Localization

beastedot9, posted Tue Apr 12, 2016 9:02 pm (12606)


It's been a while but I just want to say thank you for taking the time to help out, really appreciate it :)
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.