Help us keep the site up! Got some change to spare? Why not donate a few bits and buy us a coffee. Image

Just Cause game .arc archives

Old posts about game archives and other formats.
Slaii
beginner
Posts: 25
Joined: Sun Jun 25, 2006 7:28 pm

Just Cause game .arc archives

Post by Slaii »

I need to unpack/pack .arc archives from Just Cause game (c) Eidos
pc0.arc < this file is 510 MB
It is in demo too
Darkfox
VVIP member
VVIP member
Posts: 688
Joined: Fri Jul 04, 2003 6:11 pm
Has thanked: 33 times
Been thanked: 16 times

Post by Darkfox »

Got any links to said demo?
User avatar
lionheartuk
double-veteran
double-veteran
Posts: 749
Joined: Tue May 16, 2006 10:55 pm
Location: Everywhere
Has thanked: 34 times
Been thanked: 38 times

Re: Just Cause game .arc archives

Post by lionheartuk »

Slaii wrote:I need to unpack/pack .arc archives from Just Cause game (c) Eidos
pc0.arc < this file is 510 MB
It is in demo too
What console is this game for exactly?
Because the gamecube uses RARC compression (often called ARC), there archieves btw.
User avatar
Savage
VIP member
VIP member
Posts: 559
Joined: Sun Apr 17, 2005 11:00 am
Has thanked: 16 times
Been thanked: 18 times

Post by Savage »

About RARc compression:
RARC archives
=============

Version 1


If you de-Yaz0 a Supermario Sunshine .szs file, you get a file starting with "RARC". This file is an archive file and contains several other files. This document describes the structure of these RARC files (note that I got all this information by staring at these files in a hex editor, so it may not be entirely accurate...it seems to work, though).

The file starts with an RarcHeader:

struct RarcHeader
{
char type[4]; //'RARC'
u32 size; //size of the file
u32 unknown;
u32 dataStartOffset; //where does the actual data start? You have to add 0x20 to this value.
u32 unknown2[4];

u32 numNodes;
u32 unknown3[2];
u32 fileEntriesOffset;
u32 unknown4;
u32 stringTableOffset; //where is the string table stored? You have to add 0x20 to this value.
u32 unknown5[2];
};

Next are RarcHeader.numNodes Node structures:

struct Node
{
char type[4];
u32 filenameOffset; //directory name, offset into string table
u16 unknown;
u16 numFileEntries; //how many files belong to this node?
u32 firstFileEntryOffset;
};

Each RARC file contains at least one Node, the 'ROOT' node. For each subdirectory in the archive, there's another Node (so each Node represents a directory). Each Node contains files and directories, represented by FileEntry structures:

struct FileEntry
{
u16 id; //file id. If this is 0xFFFF, then this entry is a subdirectory link
u16 unknown;
u16 unknown2;
u16 filenameOffset; //file/subdir name, offset into string table
u32 dataOffset; //offset to file data (for subdirs: index of Node representing the subdir)
u32 dataSize; //size of data
u32 zero; //seems to be always '0'
};

To read the archive, you read the root node and its file entries. For each subdir in the root node's fileentries, you read the corresponding node and its file entries. For each file in the fileentries, you dump its data.

thakis (http://www.amnoid.de/gc/)

Changelog
=========

20050211: Initial release
Some links and programs
http://www.amnoid.de/gc/index.html

http://www.amnoid.de/gc/szstools.zip 8D
User avatar
lionheartuk
double-veteran
double-veteran
Posts: 749
Joined: Tue May 16, 2006 10:55 pm
Location: Everywhere
Has thanked: 34 times
Been thanked: 38 times

Post by lionheartuk »

pulposo wrote:About RARc compression:
RARC archives
=============

Version 1


If you de-Yaz0 a Supermario Sunshine .szs file, you get a file starting with "RARC". This file is an archive file and contains several other files. This document describes the structure of these RARC files (note that I got all this information by staring at these files in a hex editor, so it may not be entirely accurate...it seems to work, though).
http://www.amnoid.de/gc/index.html

http://www.amnoid.de/gc/szstools.zip 8D
Ahh he he he :D
I was correct then IT IS gamecube RARC.
This is some more info off the website.
I havent ahd a chance to read Pulpuso's post propperly yet so this may or may not be more detailed.
15.3 ARC (RARC Archive)
This file is an archive file and contains several other files. index
15.3.1 Header
The file starts with an Rarc-Header: start end size description
4 type - 'RARC'
4 size, size of the file
4 unknown
4 dataStartOffset, where does the actual data start? You have to add 0x20 to this value.
16 unknown
4 numNodes
8 unknown
4 fileEntriesOffset
4 unknown
4 stringTableOffset, where is the string table stored? You have to add 0x20 to this value.
8 unknown

index
15.3.2 Nodes
Next are RarcHeader.numNodes Node structures: start end size description
4 type
4 filenameOffset, directory name, offset into string table
2 unknown
2 numFileEntries, how many files belong to this node?
4 firstFileEntryOffset

Each RARC file contains at least one Node, the 'ROOT' node. For each subdirectory in the archive, there's another Node (so each Node represents a directory). Each Node contains files and directories, represented by FileEntry structures: index
15.3.3 File Entries
start end size description
2 id, file id. If this is 0xFFFF, then this entry is a subdirectory link
2 unknown
2 unknown
2 filenameOffset, file/subdir name, offset into string table
4 dataOffset, offset to file data (for subdirs: index of Node representing the subdir)
4 dataSize, size of data
4 zero, seems to be always '0'

To read the archive, you read the root node and its file entries. For each subdir in the root node's fileentries, you read the corresponding node and its file entries. For each file in the fileentries, you dump its data.
Hope it helps :D
Slaii
beginner
Posts: 25
Joined: Sun Jun 25, 2006 7:28 pm

Just Cause demo

Post by Slaii »

Demo is available from gamershell:

Code: Select all

http://www.gamershell.com/download_15145.shtml
or here:

Code: Select all

http://hry2.sme.sk/just_cause_demo.exe
cca 540 MB

In attachment is header of pc0.arc file
@lionheartuk thanx, but I think that is not right

game is for: [PC,PS2,Xbox]

developer: Avalanche Studios
publisher: Eidos
2006
You do not have the required permissions to view the files attached to this post.
User avatar
lionheartuk
double-veteran
double-veteran
Posts: 749
Joined: Tue May 16, 2006 10:55 pm
Location: Everywhere
Has thanked: 34 times
Been thanked: 38 times

Re: Just Cause demo

Post by lionheartuk »

Slaii wrote: In attachment is header of pc0.arc file
@lionheartuk thanx, but I think that is not right
2006
JUst because the game is not FOR gamecube Doesnt mean that its not using a gamecube typoe method of encryption/compression.
Well I can say 1 thing.

Your image doesnt really help us much lol.
As it COULD be YAZ0R compression, though the sign of that its those 5 letters at the first 5 bytes.
BUT it could be an edit of that format.
THe best thing I think for you to do is use the FILE CUTTER to cut the file up, then upload it HERE or elsewhere and then we can see.
Few of us will actualy downlaod a file that over 500 meg JUST for a quick look, when we can get jsut as much info from a files Piece.

But it COULD be RARC still, But i cant tell at all until I look at a file Piece with a Hex editor myself.
But even then i cant PROMISE anything from it.
Slaii
beginner
Posts: 25
Joined: Sun Jun 25, 2006 7:28 pm

example of .pc

Post by Slaii »

@lionheartuk: ok, now I know...

I cut small part of that .pc and pack it with 2 other files I found in the same dir as .pc

pclist.txt: there is list of files like

Code: Select all

C:\finalbuilder\demo\Projects\JustCause\data\Levels\GlobalTerrainData_PC.dat
pc.tab: unknown

When I view .pc in hex I saw some UUU chars - I think, that there are packed .dds files...

Hope it help... if not I can send bigger piece of .pc to rapid*share
You do not have the required permissions to view the files attached to this post.
Strobe
Moderator
Posts: 411
Joined: Mon Oct 24, 2005 8:52 am
Location: Sweden
Been thanked: 16 times
Contact:

hey

Post by Strobe »

Can someone help me to find the "packed" data in this archive. i just
cannot find any. its not packed.

And yes. there are DDS textures in here. unpacked.
but without headers.
User avatar
Savage
VIP member
VIP member
Posts: 559
Joined: Sun Apr 17, 2005 11:00 am
Has thanked: 16 times
Been thanked: 18 times

Post by Savage »

It's only in the first pack the compressed file, the other .arc's are uncompressed, there you can found a lot of DDS
Mr.Mouse
Site Admin
Posts: 4058
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 437 times
Been thanked: 639 times
Contact:

Post by Mr.Mouse »

It seems to me the txt file in the same dir as PC0 is the list of files in the PC0.ARC, and the .tab file gives information on where to find these files in the arc.
Mr.Mouse
Site Admin
Posts: 4058
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 437 times
Been thanked: 639 times
Contact:

Post by Mr.Mouse »

What I expected is indeed the case. I am still puzzled why the pclist.txt refers to more files then there are in the PC0.ARC file (based on findings in the pc.tab file). I am currently writing a plugin for MexCom to support extraction.
Mr.Mouse
Site Admin
Posts: 4058
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 437 times
Been thanked: 639 times
Contact:

Post by Mr.Mouse »

See attached image. The plugin now detects all files in the ARC and links it with the correct filename. Need to build in actual extraction. More to follow.
You do not have the required permissions to view the files attached to this post.
Mr.Mouse
Site Admin
Posts: 4058
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 437 times
Been thanked: 639 times
Contact:

Post by Mr.Mouse »

Working Plugin for Just Cause (PC) .ARC files and SARC files.

Download the attached zip file and extract the dll. Create a ARC folder in the plugin directory of MultiEx Commander and then copy the dll there. Done.

This MexCom plugin will open and extract from .ARC files and SARC files.

ARC files:

The .tab and .txt files that refer to the ARC file need to be in the same folder as the ARC file or it won't work.

SARC files:
These are Smaller ARChives that are within the large ARC file. They usually have extensions like .bl and .nl at least, but there may be more. Just open some file with an Hex editor and if you see the word SARC starting from the 5th byte then presto, you have yourself a SARC file.

I've attached some screens of MexCom with an open ARC file and an open SARC file.

As to the format of the ARC file, the ARC file merely contains all the resources saved one by the other. However, they are padded up to blocks of whatever is specified in the .tab file. Padding is done by filling the remainder of the block up with "P", how aPProPriate. Padding...P...geddit?

The .tab file and the pclist file need some further explaining. First the pclist.txt file. This had me puzzled because it listed more files then there actually were in the .ARC file, according to the .tab file. The answer, after a long session of logic and comparing extracted files with their possible names, was simple of course. Every file has a unique name, even though the folders they came from might differ. Every time this Eidos packer would encounter a file with the same name as one already stored in the .ARC file, it would SKIP IT! Furthermore, files that did not have an extension (like 4 or 5 entries in the pclist.txt) were also skipped! Possibly, because the packer regarded those as folders? I don't know. After sorting the list, all files in the ARC file matched thier names in chronological order from top of the list to bottom.

Finally, the .tab file. This contains info about the location and the size of each resource in the .ARC archive.

Code: Select all


// Header

uint32 Version info?
uint32 BlockSize (for padding the .ARC file)
uint32 Version info?

// for each entry 

uint32  Unknown (increasing with each entry, rapidly)
uint32  Offset in blocks. To get the actual offset, multiply by the BlockSize
uint32  Size 

SARC Files:

Code: Select all


// Header

uint32     Version?
byte {4} Magic word (SARC)
uint32     Size of file info block 

// For each entry (in the file info block)

uint32     Size of filename 
byte{}    Filename (string)
uint32     Offset 
uint32     Size
As said, there are a number of files listed in the pclist.txt file that are not saved in the .ARC file. When you start the plugin to open an .ARC file, it will create a dropped.txt file in the folder of the plugin. Those that were dropped form .ARC file you will find listed there.

NOTE: To speed up comparison of filenames, I created a routine that hashes the filename strings first. I've achieved enough specificity to succesfully locate the duplicates etc and end up with the right list. I've worked with the demo, however, so I don't know about the retail version.
Also note that you may have to be patient while the plugin does its work.

Okido, thanks for tuning in, now view the screens and download the plugin. ;)
You do not have the required permissions to view the files attached to this post.
Slaii
beginner
Posts: 25
Joined: Sun Jun 25, 2006 7:28 pm

Plugin

Post by Slaii »

Hmmm
@Mr.Mouse:

It looks like your plugin is working, but when I try to open the .arc archive I only get error:
"PNG Archive not valid Path_to_my_directory_with Just_cause.dll"

I am using unregistered version
Post Reply