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.
Zero Tolerance for Disrespect

Demon's Soul - DCX/SDAT compressed format

Featured Replies

  • Author
  • Localization

Wulf, posted Mon May 25, 2015 8:55 pm (5413)


This may already be a solved problem that I just need to get smarter for.

The DCX file contains an LUABND file, which itself contains a bunch of LUA scripts. The LUABND file appears to be a simple enough archive.

I'm not sure what the SDAT file is.

Offzip will decompress most of the DCX file, but it breaks it at odd points and doesn't seem like something that could be pieced back together again. Any input on how to write a script to decompress them, then recompress a modified copy would be appreciated.
  • Author
  • Localization

Wulf, posted Mon May 25, 2015 9:05 pm (5414)


...Wait, I think I'm just dumb. It's not breaking at odd places, Windows file sorting isn't sorting the hex filenames appropriately.
  • Author
  • Localization

Wulf, posted Mon May 25, 2015 9:27 pm (5415)


I do seem to be having some trouble getting QuickBMS to deflate it though. Anybody have a minute to type out the proper command?

Compressed data should start at offset 0x100.
  • Author
  • Localization

Wulf, posted Mon May 25, 2015 9:32 pm (5416)


Alright, the below will get me the first 64Kb.

comtype deflate
string NAME = "m08.luabnd.tst"
clog NAME 0x100 0x1829f 0x80b2b

How would I get the rest?
  • Author
  • Localization

Wulf, posted Tue May 26, 2015 3:04 am (5418)


It works great for exporting them, thanks.

Is it possible to reimport them? I get the following when trying to reimport to the dcx:
Error: script invalid for reimporting, it uses MEMORY_FILEs
  • Author
  • Localization

aluigi, posted Tue May 26, 2015 5:59 am (5420)


You cannot rebuild the dcx file but you can reimport the files in the luabnd one
  • Author
  • Localization

Wulf, posted Tue May 26, 2015 1:57 pm (5434)


What would be needed to recreate the dcx? Would any existing deflate-based tools create an archive similar enough to be decompressed by the same game code?
  • Author
  • Localization

aluigi, posted Tue May 26, 2015 2:02 pm (5435)


Eh no, it's a custom format.
Basically you should first figure the the initial header (0x68 bytes) and then write a script that perform the whole work.

But why don't you use directly the luabnd file without compressing it?

The script, in fact, decompresses the dcx file so that you can try to delete the original dcx one leaving only the decompressed one on the disk, I "suppose" that the game loads this one.
  • Author
  • Localization

aluigi, posted Tue May 26, 2015 2:49 pm (5440)


Script updated 0.1.1.
Let me know if there are problems with other files.
  • Author
  • Localization

Skykila, posted Tue May 26, 2015 3:02 pm (5441)


All work! Many thanks!
  • Author
  • Localization

Wulf, posted Tue May 26, 2015 3:37 pm (5442)


aluigi wrote:
But why don't you use directly the luabnd file without compressing it?

The script, in fact, decompresses the dcx file so that you can try to delete the original dcx one leaving only the decompressed one on the disk, I "suppose" that the game loads this one.

If the DCX file doesn't exist, the game hangs at a black screen.

If you edit the name of the file the game's trying to load so that it loads the luabnd file instead, it crashes.

There are still thing I can try to make it work, but being able to replace the DCX would've been ideal. I could try my hand at modifying the game's decompressing code to be a simple copy, then just make sure every file is decompressed....

Thanks for the script thus far, it's a good start for what needs doing.
  • Author
  • Localization

Wulf, posted Thu May 28, 2015 6:50 pm (5480)


Modifications to have Demon's Souls load unencrypted, uncompressed files. With the executable modified as shown below it will load the repacked bnd files from the script.


Don't load SDAT (encrypted):
0x0065B808 - FSELF
0x0066AF08 - RAM
409E0120 -> 60000000

0x0065B924 - FSELF
0x0066B024 - RAM
419EFEE8 -> 4BFFFEE8

Don't load SDAT (compressed):
0x0065B7FC - FSELF
0x0066AEFC - RAM
409e00cc -> 60000000
  • Author
  • Localization

Wulf, posted Fri May 29, 2015 7:27 pm (5491)


I can probably figure this out when I get some time to focus on it, but any idea why the script is failing on the attached binder file? Different extension, same (similar?) BND format.
  • Author
  • Localization

Wulf, posted Fri May 29, 2015 7:48 pm (5492)


Success with the below script, but I'll have to look closer into what I cut out to make it work.

Code:
# Demon's Soul
# script for QuickBMS http://quickbms.aluigi.org

endian big

get EXT extension

idstring "BND"  # BND307D7R6
goto 12
get DUMMY long  # FLAGS with endianess?
get FILES long
get BASE_OFF long
get ZERO long
get ZERO long
goto 0x2C
for i = 0 < FILES
    get FLAGS long
    get SIZE long
    get OFFSET long

    log OFFSET OFFSET SIZE
next i
  • Author
  • Localization

aluigi, posted Fri May 29, 2015 7:59 pm (5493)


I have updated the script to match the format.
Unfortunately I don't know the exact meaning of that FLAG so now there are 3 bits that I check together but they should be checked separately.
  • Author
  • Localization

AnonBaiter, posted Tue Aug 30, 2016 12:41 am (17037)


You've been missing out the .moib/.mosb/.mowb files too, which isn't surprising given the diverse range of files used in the game(many variations of the BND archive, etc).
ds_bgm_m01.rar

Although the .mowb file seems to be the BND archive file, the .mosb file also has references for that file. There are even filenames at the end of the .mosb file, but there are no containers(no sign of .at3 for example).
  • Author
  • Localization

aluigi, posted Tue Aug 30, 2016 11:24 am (17050)


MOSI and MOSB have no data or not interesting data while ds_bgm_m01.mowb works correctly with my script.
  • Author
  • Localization

AnonBaiter, posted Tue Aug 30, 2016 11:41 am (17053)


Oh... well...
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.