Crackdown 2 *.dff

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
sleepyzay
Posts: 40
Joined: Mon Sep 15, 2014 5:13 am

Crackdown 2 *.dff

Post by sleepyzay »

Don't know why I haven't seen anything related to this game considering all of the content. I wanna take a crack at the model files but I'm not that great when it comes to archives. Iv'e attached the only two archives I was able to find with the aforementioned extension. Hoping I could get a little help here.

https://www.mediafire.com/folder/284k2t ... crackdown2
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Crackdown 2 *.dff

Post by puggsoy »

Managed to make this:

Code: Select all

# Crackdown 2 .dff
#
# Written by puggsoy
# script for QuickBMS http://quickbms.aluigi.org

comtype zlib_noerror
get SIZE asize
clog MEMORY_FILE 0 SIZE SIZE

for
   findloc INFO_OFF long 0x716 MEMORY_FILE
   goto INFO_OFF MEMORY_FILE
   idstring MEMORY_FILE "\x16\x07\x00\x00"
   
   getdstring DUMMY 0x0C MEMORY_FILE
   get NAMESZ long MEMORY_FILE
   getct NAME string 0 MEMORY_FILE
   strlen NAMESZ2 NAME
   
   math NAMESZ -= 1
   if NAMESZ != NAMESZ2
      savepos CURRPOS MEMORY_FILE
      print "invalid name and size match at %CURRPOS|h%"
      exit
   endif
   
   getdstring DUMMY 0x10 MEMORY_FILE
   get TYPESZ long MEMORY_FILE
   getct TYPE string 0 MEMORY_FILE
   strlen TYPESZ2 TYPE
   
   math TYPESZ -= 1
   if TYPESZ != TYPESZ2
      savepos CURRPOS MEMORY_FILE
      print "invalid type and size match at %CURRPOS|h%"
   endif
   
   getdstring DUMMY 0x0A MEMORY_FILE
   get SIZE long MEMORY_FILE
   savepos OFFSET MEMORY_FILE
   
   log NAME OFFSET SIZE MEMORY_FILE
   
   math OFFSET += SIZE
   goto OFFSET MEMORY_FILE
next

A couple of things I should point out:
  • This searches for a number to find the beginning of the file information. It does a number of other checks to check that it's actually gotten a valid file, and if any of these fail then it will print a message and terminate. If this happens please post the message it gives.
  • Global.dff (and maybe others) seems to find multiple files with the same name sometimes. I have no idea why but QuickBMS will give a prompt and you can choose how to handle it.
  • Although I'm fairly sure this is correct, if anybody has any improvements feel free to say.

Enjoy :)
sleepyzay
Posts: 40
Joined: Mon Sep 15, 2014 5:13 am

Re: Crackdown 2 *.dff

Post by sleepyzay »

Thank you very much for the help puggsoy. The model formats are stupid simple in this game and I was able to write an importer not too long after unpacking the archives. But there are quite a few files that don't come out correctly unfortunately. A lot of the files come out often less than a kilobyte in size containing only the file's name and file type while others of the same format come out fine. Only npc's came out right for what I could see though.

Image
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Crackdown 2 *.dff

Post by puggsoy »

Could you tell me the names of some files you suspect didn't come out right? I can take a look and see if I can do anything about them. That might also explain the duplicate files.
sleepyzay
Posts: 40
Joined: Mon Sep 15, 2014 5:13 am

Re: Crackdown 2 *.dff

Post by sleepyzay »

puggsoy wrote:Could you tell me the names of some files you suspect didn't come out right? I can take a look and see if I can do anything about them. That might also explain the duplicate files.


billboard_intro_1.usm, billboard_main_Comms.usm, and billboard_main_Gym.usm are a few of the many that either came out all looking similar to what it shows in the pic and or either dosent have a file extension.

Image

Most of this happens within the pacific_city archive and I notice it dose too in global though not nearly as much. I've also noticed that all if not most of the files without an extension has the header of "PTL". Hope this helps.
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Crackdown 2 *.dff

Post by puggsoy »

Hmm. I think those are good files, they might not be useful to you but they seem to be extracted correctly. I also looked at some duplicate files, as far as I can tell they seem to be exactly the same so it doesn't matter whether you overwrite, skip, or rename. I still don't know why there are duplicate files but I guess there just are.

If you want I can make the script exclude specific file types, for example PTL files have a file type of "PORTAL", and I could make it skip those. You can give me the headers of files you don't want it to extract and I can do that.
sleepyzay
Posts: 40
Joined: Mon Sep 15, 2014 5:13 am

Re: Crackdown 2 *.dff

Post by sleepyzay »

Well the only files I'm looking to grab are the CHAMP1Lx_Body model files, which are in global, that came out weird and also are the playable character models. But if all of the *.B_PSKN files came out ok I guess the game has a different way of storing the player model files. Though I cant find them anywhere.

Also the model files don't seem to have a header name. They just get straight to the point when it comes to logging the model information and such, so I cant give you the header without it just being a bunch of numbers varying by the file unfortunately. Really weird game. Thanks for the insight.