Mario + Rabbids .sdfdata, .sdftoc

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
CosmicDreams
Posts: 100
Joined: Thu Sep 13, 2018 6:38 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by CosmicDreams »

Was chatting with someone else earlier about this.
https://cdn.discordapp.com/attachments/419711036837330956/500829671122927617/Screenshot_20181014-013602_Discord.jpg

Maybe this information will be of help?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by aluigi »

Currently I can't work on that, sorry.
If you find a solution feel free to post the full details or the bms patch.
Qnoops
Posts: 39
Joined: Thu Aug 04, 2016 8:03 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by Qnoops »

aluigi wrote:Long story short, I don't know what's the problem.

Everything is correct till the code "for chunkIndex = 0 < count1" reads ch3 from offset 0x0001a560 of MEMORY_FILE which is 0x00, and this is the only ch3 with this value.
So what I did was ignoring the instructions if ch3 is 0x00 (which is an invalid value indeed) and apparently everything works correctly :)
Script 0.1.3a, let me know if you get other errors.


So you updated the current ubisoft_sdf script that was working with south park game, now will it still work with the south park game? did you added new specs or completely changed it? : D

Just in case i backed up old script working with SP game
CosmicDreams
Posts: 100
Joined: Thu Sep 13, 2018 6:38 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by CosmicDreams »

Should still work i guess.
Doesn't seem like the script was changed just added to.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by aluigi »

@Qnoops
The only changes regarding the script are about the weird "ch3 == 0" problem that didn't affect South Park, and a fix for a bug introduced in the previous version of the script few days ago.
CosmicDreams
Posts: 100
Joined: Thu Sep 13, 2018 6:38 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by CosmicDreams »

Okay so, i think a solution would be to extract each SDFDATA that has actual data in it to their own directories. Should avoid issues with file conflicts but means files would have to manually be merged, better than what it is currently i suppose.

Not sure if QuickBMS can support such a thing though.
CosmicDreams
Posts: 100
Joined: Thu Sep 13, 2018 6:38 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by CosmicDreams »

Never mind, just tried that manually and there's still issues.
Weird.
CosmicDreams
Posts: 100
Joined: Thu Sep 13, 2018 6:38 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by CosmicDreams »

So Starlink: Battle For Atlas came out and uses the Snowdrop engine too.

Thought i'd try that out with the current script aand well...
It worked perfectly!
No issues at all dumping every single file from the game SDFDATA.
Image
All the characters are pre-rendered bink video files, not sure what else i expected.
Anywho the files inside the archives are very similar in layout and formats to Mario Rabbids so it isn't too hard to look around the game after looking at the other game for so long.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by aluigi »

So, just to recap, the script works correctly with all the games except Mario Rabbids, right?
CosmicDreams
Posts: 100
Joined: Thu Sep 13, 2018 6:38 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by CosmicDreams »

Yep.
Pretty much.
KillzXGaming
Posts: 6
Joined: Fri Jan 20, 2017 10:44 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by KillzXGaming »

Incase you need to detect zstd as i checked the comments in the script, it uses magic which is always 0x28B52FFD
CosmicDreams
Posts: 100
Joined: Thu Sep 13, 2018 6:38 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by CosmicDreams »

.
Me and someone else figured out the problem with the script.
3 lines at around the middle of the script that go something like:

Code: Select all

If ver <=0x16
get fileId long MEMORY_FILE
endif

Completely broke it for some reason.
It seems like Mario + Rabbids doesn't use fileIds but rather only packageIds.
The issue now is that files split across archives are extracted as separate files.
LolHacksRule
Posts: 865
Joined: Fri Apr 20, 2018 12:41 am

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by LolHacksRule »

You delete the line in it right? I'm getting somewhere...
LolHacksRule
Posts: 865
Joined: Fri Apr 20, 2018 12:41 am

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by LolHacksRule »

Quick bump, I cannot extract update v1.9 with the fixed script. The script stops on the file shd_icecream_c_01_n.dds in: moria\sdf\nx\data\sdf-B-1098.sdfdata. This also affects the original script. Will a solution come?

Code: Select all

- enter in folder RKB\UPDATE\1.9\EXT\ROMFS\moria\sdf\nx\data
- open input file RKB\UPDATE\1.9\EXT\ROMFS\moria\sdf\nx\data\sdf-B-1098.sdfdata
  00000000 0          moria\baked\art\environments\sherbetdesert\props\icecream\textures\shd_icecream_c_01_n.dds
+ 009ec439 65536      moria\baked\art\environments\sherbetdesert\props\icecream\textures\shd_icecream_c_01_n.dds
Info:  algorithm   478
       offset      009ec439
       input size  0x0000b320 45856
       output size 0x00010000 65536
       result      0xffffffb8 -72

Error: the uncompressed data (-72) is bigger than the allocated buffer (5416311)

Last script line before the error or that produced the error:
  159 clog name packageOffset compSize CHUNK_SIZE 1
CosmicDreams
Posts: 100
Joined: Thu Sep 13, 2018 6:38 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by CosmicDreams »

Was the game updated recently? I dumped the game around 2 or 3 weeks ago and it works perfectly fine.
LolHacksRule
Posts: 865
Joined: Fri Apr 20, 2018 12:41 am

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by LolHacksRule »

September 19, 2018. Ver. 1.9.58692.
LolHacksRule
Posts: 865
Joined: Fri Apr 20, 2018 12:41 am

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by LolHacksRule »

I forgot base SDFDATA files... Actually, this still happens with them added too, and quickbms_4gb_files.exe... https://cdn.discordapp.com/attachments/ ... sdf.sdftoc

UPDATE: NVM, got a bad dump or dumped incompletely.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by aluigi »

Just checked the file and it seems correct regarding the compression algorithm since it tries to use zstd on zstd compressed data.
Even extracting the files from the first filecutted data works perfectly.
I don't have the full sdf-B-1098.sdfdata so that's the max I can say at the moment, don't know why you get that error at offset 0x009ec439 (and don't know if your UPDATE was referred to the filecutted samples or to the error)
LolHacksRule
Posts: 865
Joined: Fri Apr 20, 2018 12:41 am

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by LolHacksRule »

The update was related to the cut file that was supposedly incorrect due to hashes mismatching, so I replaced it and the game extracted successfully.
costelabr
Posts: 13
Joined: Mon Nov 18, 2019 2:36 am

Re: Mario + Rabbids .sdfdata, .sdftoc

Post by costelabr »

LolHacksRule wrote:The update was related to the cut file that was supposedly incorrect due to hashes mismatching, so I replaced it and the game extracted successfully.

i have same issue but don't understand what file you replaced