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.

Level-5 Dark Cloud - .MDS Extracting from .SCN [COMPLETED]

Featured Replies

  • Author
  • Localization

Dayuppy, posted Tue May 12, 2020 2:29 pm (56695)


I've been trying to create another BMS script but it fails to extract all the MDS images in a file. I've attached an example archive of a file containing MDS models.

The problem is that the MDS files are of unknown size. There is information in the SCN header about the files contained within and their filesizes but I don't know how to parse all that data.

I'm trying to find a way to scan for \x4D\x44\x53\x00\x01\x00\x00\x00 which is the start of the MDS file, then I try to find the second instance of the same header and extract the data in between.

This is what I'm experimenting with:

Code:
for FILES = 0
FindLoc OFFSET1 string "\x4D\x44\x53\x00\x01\x00\x00\x00"
goto OFFSET1
idstring "\x4D\x44\x53\x00\x01\x00\x00\x00"

print "offset1: %offset1%"

FindLoc OFFSET2 string "\x4D\x44\x53\x00\x01\x00\x00\x00"
goto OFFSET2
idstring "\x4D\x44\x53\x00\x01\x00\x00\x00"

print "offset2: %offset2%"

set SIZE LONG OFFSET2
math SIZE -= OFFSET1 #Subtract OFFSET1 from OFFSET 2

Log "" OFFSET1 SIZE
math OFFSET1 = SIZE
goto OFFSET1
print "SIZE %SIZE%"


next FILES
- This appears to be working for now. More testing needed.




NOTES: There's a PTS header that contain the filenames within each model set and the size.

My current script only extracts some of the files successfully, the rest don't open correctly.

More simply, I'm trying to find the first MDS to the second MDS and extract the file in between. Then move on to the next.

Thanks in advance
  • Author
  • Localization

aluigi, posted Thu May 14, 2020 1:13 pm (56743)


Code:
findloc OFFSET binary "\x4D\x44\x53\x00\x01\x00\x00\x00"
do
    goto OFFSET
    get DUMMY long
    findloc NEXT_OFFSET binary "\x4D\x44\x53\x00\x01\x00\x00\x00" 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 != ""
  • Author
  • Localization

Dayuppy, posted Fri May 15, 2020 12:02 am (56771)


Thank you aluigi. This appears to be working great and is much cleaner than mine.
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.