XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Sat Jan 19, 2019 9:46 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Just Cause 4 .arc/tab
PostPosted: Tue Dec 04, 2018 10:45 pm 
Offline
double-veteran
double-veteran

Joined: Sun Apr 20, 2008 2:58 am
Posts: 841
Has thanked: 5 times
Have thanks: 33 times

I can make out some stuff in HEX like some FSB5 file headers, but so far seems the rest is compressed.

You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: Just Cause 4 .arc/tab
PostPosted: Wed Dec 05, 2018 4:14 pm 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Mon Apr 21, 2014 8:32 pm
Posts: 186
Has thanked: 5 times
Have thanks: 117 times
Uses Oodle lib V7
TAB structure

Code:
//--------------------------------------
//--- 010 Editor v6.0.2 Binary Template
//
// File:avalanche tab
// Author:Lukas Cone
// Revision: Just Cause 4
// Purpose:
//--------------------------------------
SetBackColor( cLtGreen );
struct {
   uint ID;
   ushort version1, version2;
    uint allignment;
   int null;
}Header;

typedef struct {
   int hash;
   int unk;
}HashEntry;

HashEntry unkHash;
int numHashes;
HashEntry hashes[numHashes];

while (FileSize() > FTell())
{
   struct {
      int hash, offset, compressed_size, size;
      short HashEntryID;
      char unk0, unk1;
   }FileEntry;
}



Compressed files are beyond me, they probably use individual compression, depending on file type since I could see strings within compressed script/animation files.

Compressed file layout:
Code:
//--------------------------------------
//--- 010 Editor v6.0.2 Binary Template
//
// File:arc compressed entry
// Author:Lukas Cone
// Revision: Just Cause 4
// Purpose:
//--------------------------------------
SetBackColor( cLtGreen );
struct {
   short ID; // Always 0x8c06
   char unk0,
      unk1;
   int hash; //crc?
   char headerID[8]; // first 8 bytes from file
}Header;



_________________
My Blog
Image


Top
 Profile  
 
 Post subject: Re: Just Cause 4 .arc/tab
PostPosted: Fri Dec 14, 2018 8:36 pm 
Offline
advanced

Joined: Thu Jul 12, 2012 12:24 pm
Posts: 71
Has thanked: 10 times
Have thanks: 23 times
Ok here is temporary bms script which can unpack some of arc files. QBMS obviously can't handle other oodle compression algo... Filenames are hashed so....
Thanks PredatorCZ for initial struct.

Code:
####################################
comtype OODLE

open FDDE "tab" 0
open FDDE "arc" 1
get FILES asize
idstring "TAB"
getdstring DUMMY 0x15
get HASHTABLE long
for i = 0 < HASHTABLE
   get HASH0 long
   get HASH1 long
next i
savepos STARTOFF
math FILES -= STARTOFF
math FILES /= 20
for i = 0 < FILES
endian big
get NAME long
endian little
get OFFSET long
get ZSIZE long
get SIZE long
get FILETYPE byte
get FILETYPE1 byte
get COMPRESSION byte
get COMPTYPE byte

if ZSIZE == SIZE
   callfunction SETEXTUNC
else
   callfunction SETEXTCOM
   endif
next i

startfunction SETEXTUNC
if SIZE u> 16
   log MEMORY_FILE OFFSET SIZE 1
   goto 0 MEMORY_FILE
   get SIGN1 byte MEMORY_FILE
   goto 0 MEMORY_FILE
   getdstring SIGN3 3 MEMORY_FILE
   goto 0 MEMORY_FILE
   getdstring SIGN4 4 MEMORY_FILE
   goto 4 MEMORY_FILE
   getdstring SIGN8 4 MEMORY_FILE
   goto 12 MEMORY_FILE
   getdstring SIGN12 4 MEMORY_FILE
   goto 16 MEMORY_FILE
   getdstring SIGN16 4 MEMORY_FILE
   
   if SIGN4 == "KB2j" || SIGN4 == "BIKi"
        set EXT string "bik"
   elif SIGN4  == " FDA" || SIGN12 == " FDA"
        set EXT string "fda"
   elif SIGN4 == "RTPC"
        set EXT string "rtpc"
   elif SIGN4 == "AVTX"
        set EXT string "avtx"
   elif SIGN4 == "DDS "
        set EXT string "dds"
   elif SIGN4 == "RIFF"
        set EXT string "riff"      
   elif SIGN8 == "TAG0"
        set EXT string "tag"
   elif SIGN8 == "SARC"
        set EXT string "sarc"
   elif SIGN16 == "FSB5"
        set EXT string "fsb"
   elif SIGN3 == "CFX" || SIGN3 == "GFX"
        set EXT string "swf"
   elif SIGN1 == 0x04
        set EXT string "4"
    else
        string EXT f= dat
   endif
endif   
   string NAME p "%s/%08X.%s" game NAME EXT
   log NAME OFFSET SIZE 1
endfunction

startfunction SETEXTCOM
if SIZE u> 16
   log MEMORY_FILE OFFSET ZSIZE 1
   goto 0 MEMORY_FILE
   get SIGN short MEMORY_FILE
   if SIGN == 1676
      clog MEMORY_FILE OFFSET ZSIZE SIZE 1      
      goto 0 MEMORY_FILE
      get SIGN1 byte MEMORY_FILE
      goto 0 MEMORY_FILE
      getdstring SIGN3 3 MEMORY_FILE
      goto 0 MEMORY_FILE
      getdstring SIGN4 4 MEMORY_FILE
      goto 4 MEMORY_FILE
      getdstring SIGN8 4 MEMORY_FILE
      goto 12 MEMORY_FILE
      getdstring SIGN12 4 MEMORY_FILE
      goto 16 MEMORY_FILE
      getdstring SIGN16 4 MEMORY_FILE

      if SIGN4 == "KB2j" || SIGN4 == "BIKi"
         set EXT string "bik"
      elif SIGN4  == " FDA" || SIGN12 == " FDA"
         set EXT string "fda"
      elif SIGN4 == "RTPC"
         set EXT string "rtpc"
      elif SIGN4 == "AVTX"
         set EXT string "avtx"
      elif SIGN4 == "DDS "
         set EXT string "dds"
      elif SIGN4 == "RIFF"
         set EXT string "riff"      
      elif SIGN8 == "TAG0"
         set EXT string "tag"
      elif SIGN8 == "SARC"
         set EXT string "sarc"
      elif SIGN16 == "FSB5"
         set EXT string "fsb"
      elif SIGN3 == "CFX" || SIGN3 == "GFX"
         set EXT string "swf"
      elif SIGN1 == 0x04
         set EXT string "4"
      else
         string EXT f= dat
      endif
         string NAME p "%s/%08X.%s" game NAME EXT
         clog NAME OFFSET ZSIZE SIZE 1
   else
      string NAME p "%s/%s/%08X.comp" game compressed NAME
      log NAME OFFSET ZSIZE 1
   endif   
endif
endfunction


EDiT: Updated with extension support.
EDiT1: Now unpack all files. Those which can't be decompressed are located in "compressed" folder.


Top
 Profile  
 
 Post subject: Re: Just Cause 4 .arc/tab
PostPosted: Tue Jan 08, 2019 6:53 am 
Offline
n00b

Joined: Sun Nov 09, 2014 7:25 pm
Posts: 14
Has thanked: 1 time
Have thanks: 0 time
well done~~;;



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: PaulPhoenix31139 and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group