Registration Code (Part 1): w%kQ6
Registration Code (Part 2): b<#$1[*(cw~
In order to register on this forum, you must use the codes above. Combine them into one code (copy paste).

Grim Dawn Archive File Extractor (.arc)

Topics regarding the new upcoming ARPG Grim Dawn.
Post Reply
User avatar
atom0s
Site Admin
Posts: 403
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Grim Dawn Archive File Extractor (.arc)

Post by atom0s » Tue Jan 06, 2015 8:15 pm

grimarc - Grim Dawn Archive File Extractor (.arc) File Format Information
Please note this data and format is subject to change. Grim Dawn is still in alpha testing and is not completed.
The developers may change the formats at random causing this information to become invalid.
At the time of this post, the game is currently at build: B23


To start, the .arc files are broken into four sections.

Code: Select all

file
{
    header
    file_data
    file_record_table
    file_table_of_contents
}
ARC File Header (v3)

Code: Select all

/**
 * @brief ARC File Header (v3)
 */
struct ARC_V3_HEADER
{
    unsigned int Magic; // ARC
    unsigned int Version;
    unsigned int NumberOfFileEntries;
    unsigned int NumberOfDataRecords; // (NumberOfDataRecords * 12) = RecordTableSize
    unsigned int RecordTableSize;
    unsigned int StringTableSize;
    unsigned int RecordTableOffset;
};
  • NumberOfFileEntries is the total number of files this .arc contains.
  • NumberOfDataRecords is the total number of file parts within the second part of this .arc file.
  • RecordTableSize is the total size of the record parts table. (Each entry is 12 bytes long.)
  • StringTableSize is the total size of the string table.
  • RecordTableOffset is the offset to the file parts table.
Next, after the header is the file data parts. This chunk is handled by the next two parts of the file. So the next part we have the record table. The record table defines the file parts in the chunk of data before it. The format is:

Code: Select all

/**
 * @brief ARC File Part Entry (v3)
 */
struct ARC_V3_FILE_PART
{
    unsigned int PartOffset;
    unsigned int CompressedSize;
    unsigned int DecompressedSize;
};
Each entry points to a part of a file. (Or a whole file if its not parted.) If the compressed size matches the decompressed size, the part is not considered compressed and can be dumped as-is. These file parts are compressed using LZ4 compression.

Following this table, is the string table. Each string is the name of a file within the archive. The string table is just a block of strings, null terminated in a row. The position of the string is the index of the file within the archive. So the first entry in the ToC table uses the first string in the string table, the second uses the second and so on. There is no string lookup in .arc files like there is in .arz files!

The last block of data in the file is the files table of contents. This is the major part of the file that is used to read and understand the rest of the file. The ToC attaches to the record table to know which blocks of data to read. The ToC is formatted like this:

Code: Select all

/**
 * @brief ARC File Table Of Contents Entry (v3)
 */
#pragma pack(1)
struct ARC_V3_FILE_TOC_ENTRY
{
    unsigned int        EntryType;
    unsigned int        FileOffset;
    unsigned int        CompressedSize;
    unsigned int        DecompressedSize;
    unsigned int        Unknown0001; // Possible timestamp?
    unsigned __int64    FileTime;
    unsigned int        FileParts;
    unsigned int        FirstPartIndex;
    unsigned int        StringEntryLength;
    unsigned int        StringEntryOffset;
};
#pragma pop
  • EntryType determines how the entry is stored. Apparently if this is set to 1 the entry is not compressed at all. I do not believe this is used anymore and every entry I have seen has always been 3.
  • FileOffset is the offset to the first part of this file.
  • CompressedSize is the total compressed size of this file.
  • DecompressedSize is the total decompressed size of this file.
  • Unknown0001 is unknown. I think this may be some sort of timestamp.
  • FileTime is the file time of the file. (See http://msdn.microsoft.com/en-us/library ... s.85).aspx)
  • FileParts is the number of parts this file is broken into.
  • FirstPartIndex is the first index inside of the record table to start using as parts of this file.
  • StringEntryLength is the length of the string in the string table.
  • StringEntryOffset is the offset in the string table for this string.
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
tt300
Posts: 32
Joined: Mon Sep 07, 2015 12:44 am

Re: Grim Dawn Archive File Extractor (.arc)

Post by tt300 » Sat Sep 19, 2015 7:16 pm

Thanks for all the tools you provide.
There can compress ARC tool?
User avatar
atom0s
Site Admin
Posts: 403
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Re: Grim Dawn Archive File Extractor (.arc)

Post by atom0s » Sat Sep 19, 2015 7:59 pm

No, I never got around to adding the features to rebuild the archives. Personally never needed the feature myself so I never bothered coding it.
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
User avatar
immorrr
Posts: 110
Joined: Fri Mar 27, 2015 2:21 pm
Location: Germany

Re: Grim Dawn Archive File Extractor (.arc)

Post by immorrr » Sat Sep 19, 2015 9:13 pm

atom0s wrote:No, I never got around to adding the features to rebuild the archives. Personally never needed the feature myself so I never bothered coding it.
Too bad :( I'm sure i would find a nice use for it ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest