June 3, 2019. Should you wish to discuss further on Discord, join the XeNTaX Discord server! :)

May 25, 2019. Hello all, we have been targeted by a certain type of spambot that will send messages to our users in their private messages. If you get a message from such a loser/bot, report it to us here, and delete the message ! :/

Just Cause 4 .arc/tab

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
OrangeC
double-veteran
double-veteran
Posts: 860
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 33 times

Just Cause 4 .arc/tab

Post by OrangeC » Tue Dec 04, 2018 10:45 pm

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

User avatar
PredatorCZ
mega-veteran
mega-veteran
Posts: 227
Joined: Mon Apr 21, 2014 8:32 pm
Has thanked: 6 times
Been thanked: 155 times
Contact:

Re: Just Cause 4 .arc/tab

Post by PredatorCZ » Wed Dec 05, 2018 4:14 pm

Uses Oodle lib V7
TAB structure

Code: Select all

//--------------------------------------
//--- 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: Select all

//--------------------------------------
//--- 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;



GRiNDERKILLER
advanced
Posts: 76
Joined: Thu Jul 12, 2012 12:24 pm
Has thanked: 12 times
Been thanked: 23 times

Re: Just Cause 4 .arc/tab

Post by GRiNDERKILLER » Fri Dec 14, 2018 8:36 pm

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: Select all

####################################
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.

sfc123
n00b
Posts: 14
Joined: Sun Nov 09, 2014 7:25 pm
Has thanked: 1 time

Re: Just Cause 4 .arc/tab

Post by sfc123 » Tue Jan 08, 2019 6:53 am

well done~~;;

kilik
mega-veteran
mega-veteran
Posts: 173
Joined: Sat Dec 08, 2012 11:14 am
Has thanked: 22 times
Been thanked: 2 times

Re: Just Cause 4 .arc/tab

Post by kilik » Fri May 17, 2019 6:25 pm

it's can be update for rage 2 please is use same engine

-------------------
*EXCEPTION HANDLER*
-------------------
An error or crash occurred:

*EH* ExceptionCode c0000005 access violation
*EH* ExceptionFlags 00000000
*EH* ExceptionAddress 76FE91AD
76F60000 + 000891ad msvcrt.dll
*EH* NumberParameters 00000002
*EH* 00000001
*EH* 114C1FFF

Last script line before the error or that produced the error:
38 log MEMORY_FILE OFFSET SIZE 1

Post Reply