Demon's Soul - DCX/SDAT compressed format
-
- Posts: 49
- Joined: Mon Oct 27, 2014 8:30 pm
Demon's Soul - DCX/SDAT compressed format
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.
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.
-
- Posts: 49
- Joined: Mon Oct 27, 2014 8:30 pm
Re: Demon's Soul - DCX/SDAT compressed format
...Wait, I think I'm just dumb. It's not breaking at odd places, Windows file sorting isn't sorting the hex filenames appropriately.
-
- Posts: 49
- Joined: Mon Oct 27, 2014 8:30 pm
Re: Demon's Soul - DCX/SDAT compressed format
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.
Compressed data should start at offset 0x100.
-
- Posts: 49
- Joined: Mon Oct 27, 2014 8:30 pm
Re: Demon's Soul - DCX/SDAT compressed format
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?
comtype deflate
string NAME = "m08.luabnd.tst"
clog NAME 0x100 0x1829f 0x80b2b
How would I get the rest?
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Demon's Soul - DCX/SDAT compressed format
For both luabnd and dcx I have just written this script:
http://aluigi.org/papers/bms/others/demons_soul.bms
SDAT maybe is something like an encrypted dcx? Don't know...
http://aluigi.org/papers/bms/others/demons_soul.bms
SDAT maybe is something like an encrypted dcx? Don't know...
-
- Posts: 49
- Joined: Mon Oct 27, 2014 8:30 pm
Re: Demon's Soul - DCX/SDAT compressed format
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
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
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Demon's Soul - DCX/SDAT compressed format
You cannot rebuild the dcx file but you can reimport the files in the luabnd one
-
- Posts: 49
- Joined: Mon Oct 27, 2014 8:30 pm
Re: Demon's Soul - DCX/SDAT compressed format
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?
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Demon's Soul - DCX/SDAT compressed format
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.
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.
-
- Posts: 7
- Joined: Fri Aug 08, 2014 8:24 am
Re: Demon's Soul - DCX/SDAT compressed format
Hi, I can't open the file https://mega.co.nz/#!zIlhUaRA!Fxi_XwGy4mJ-oxoMFbGjsZyKsAniwvs_8s2w46tZ3AY with this script http://aluigi.org/papers/bms/others/demons_soul.bms
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Demon's Soul - DCX/SDAT compressed format
Script updated 0.1.1.
Let me know if there are problems with other files.
Let me know if there are problems with other files.
-
- Posts: 7
- Joined: Fri Aug 08, 2014 8:24 am
Re: Demon's Soul - DCX/SDAT compressed format
All work! Many thanks!
-
- Posts: 49
- Joined: Mon Oct 27, 2014 8:30 pm
Re: Demon's Soul - DCX/SDAT compressed format
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.
-
- Posts: 49
- Joined: Mon Oct 27, 2014 8:30 pm
Re: Demon's Soul - DCX/SDAT compressed format
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
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
-
- Posts: 49
- Joined: Mon Oct 27, 2014 8:30 pm
Re: Demon's Soul - DCX/SDAT compressed format
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.
-
- Posts: 49
- Joined: Mon Oct 27, 2014 8:30 pm
Re: Demon's Soul - DCX/SDAT compressed format
Success with the below script, but I'll have to look closer into what I cut out to make it work.
Code: Select all
# 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
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Demon's Soul - DCX/SDAT compressed format
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.
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.
-
- Posts: 1125
- Joined: Tue Feb 02, 2016 2:35 am
Re: Demon's Soul - DCX/SDAT compressed format
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).
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).
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Demon's Soul - DCX/SDAT compressed format
MOSI and MOSB have no data or not interesting data while ds_bgm_m01.mowb works correctly with my script.
-
- Posts: 1125
- Joined: Tue Feb 02, 2016 2:35 am
Re: Demon's Soul - DCX/SDAT compressed format
Oh... well...