Mad Rat Dead (.dat/.fad)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Doctor Loboto
Posts: 376
Joined: Sun May 31, 2015 2:23 am

Mad Rat Dead (.dat/.fad)

Post by Doctor Loboto »

I've been searching for a way to get the textures/sprites out of these files for a bit, and since it's a Nippon Ichi Software game, I tried many of the existing tools for prior titles. Unfortunately none have gotten the job done. I managed to extract the 'fad' files from the bigger 'dat' archives, but haven't gotten past that point. Was hoping someone here could help me out.

https://www.dropbox.com/s/smrxg0fxtc9c6 ... N.zip?dl=0
aaa801
Posts: 48
Joined: Wed Oct 12, 2016 12:22 pm

Re: Mad Rat Dead (.dat/.fad)

Post by aaa801 »

Well.. this is interesting

It looks like YKCMP but possibly a newer version, the existing tools don't seem to like it, and it seems to have an additional header at the start

This should get you started,

Code: Select all

goto 0x24
get STRING_END long
goto 0x30
get STRING_START long

xmath STRING_LENGTH "STRING_END - STRING_START"
log "stringtable" STRING_START STRING_LENGTH

# workaround for getting entry count
goto 0x50
get FIRST_OFFSET long

set ENTRY_COUNT 0
xmath ENTRY_COUNT "FIRST_OFFSET - 0x40"
xmath ENTRY_COUNT "FIRST_OFFSET / 0x20"


goto 0x40


for i = 0 < ENTRY_COUNT
   getdstring NAME 8 # not always populated
   get LENGTH long
   get UNK1 long # Not populated if WIDTH and HEIGHT are populated
   get OFFSET long
   get UNK2 long # seems to be in the header of the subfiles, at 0x10, in case of NMPLTEX1 files
   get WIDTH long # image width, 0x58 in subfile
   get HEIGHT long # image height, 0x5c in subfile

   if UNK2 != 0
      # image file

      string NAME + OFFSET
      string NAME + "_"
      string NAME + WIDTH
      string NAME + "x"
      string NAME + HEIGHT
      string NAME + ".nplmtex"
      
      print "name: %NAME% offset: %OFFSET% length: %LENGTH% unk1: %UNK1% unk2: %UNK2% width: %WIDTH% height: %HEIGHT%"
      log OFFSET OFFSET LENGTH
         
   else
      # general files
      print "name: %NAME% offset: %OFFSET% length: %LENGTH% unk1: %UNK1% unk2: %UNK2% width: %WIDTH% height: %HEIGHT%"
      log OFFSET OFFSET LENGTH
   endif


next i
Doctor Loboto
Posts: 376
Joined: Sun May 31, 2015 2:23 am

Re: Mad Rat Dead (.dat/.fad)

Post by Doctor Loboto »

The script certainly results in files...not sure what to do with any of said files once I have them though. It looks like it just segmented the original file sort of randomly...
aaa801
Posts: 48
Joined: Wed Oct 12, 2016 12:22 pm

Re: Mad Rat Dead (.dat/.fad)

Post by aaa801 »

They are split correctly, it appears to be a modification on the format mentioned in these threads
https://zenhax.com/viewtopic.php?t=8503
https://forum.xentax.com/viewtopic.php?t=20754
Doctor Loboto
Posts: 376
Joined: Sun May 31, 2015 2:23 am

Re: Mad Rat Dead (.dat/.fad)

Post by Doctor Loboto »

At least we're getting somewhere. Unfortunately I have no clue on any of this sort of thing, so I wouldn't know what to do next even with them split like this.
Yamahearted
Posts: 1
Joined: Mon Jan 11, 2021 6:03 pm

Re: Mad Rat Dead (.dat/.fad)

Post by Yamahearted »

I've got dds files from those files using old version of fadEx utility from Liar Princess thread but all files look like pseudo-random mess. I have no idea what it means but I can guess it has something to do with swizzling? So I'll attach an example of those files and image of how it looks in case it helps anyhow
Image
https://my.namejeff.com/p0XEtKtf.7z
Casical
Posts: 1
Joined: Mon May 02, 2022 5:34 am

Re: Mad Rat Dead (.dat/.fad)

Post by Casical »

Yamahearted wrote:I've got dds files from those files using old version of fadEx utility from Liar Princess thread but all files look like pseudo-random mess. I have no idea what it means but I can guess it has something to do with swizzling? So I'll attach an example of those files and image of how it looks in case it helps anyhow
Image
https://my.namejeff.com/p0XEtKtf.7z


This is about as far as I've gotten as well, and nothing I've been able to find anywhere has led me to a reliable unswizzling method for the DDS files. If anyone has any ideas on this, I'd be more than willing to hear them at this point :(