#1
|
||||
|
||||
[C++] Grim Dawn Database File Extractor (.arz)
This is another project of mine for a game called Grim Dawn. This tool will extract the game data that is packed in the games custom .arc format. Again, not something I think many will be interested in as a whole, but the project is open source so sharing it in case someone finds any parts of it useful.
grimarz - Grim Dawn Database File Extractor (.arz)
Download Latest Version: https://github.com/atom0s/grimarz/releases/latest .ARZ File Header Code:
struct GRIMDAWN_ARZ_V3_HEADER { unsigned int Unknown; // Assumed version check. unsigned int RecordTableStart; unsigned int RecordTableSize; unsigned int RecordTableEntryCount; unsigned int StringTableStart; unsigned int StringTableSize; }; Code:
v4 = *(_DWORD *)a1; v5 = (unsigned __int16)*(_DWORD *)a1; v3 = a1 + 4; *(_DWORD *)a3 = v4; if ( v5 < *(_DWORD *)(a2 + 4) || (v7 = *(_DWORD *)(a2 + 32), ((v4 & 0x10000) == 65536) != ((v7 & 0x10000) == 65536)) ) { result = 0; } Code:
0x00000000 unsigned int Number Of Strings In Table -> unsigned int String Length -> char[] String -> unsigned int String Length -> char[] String ... etc until number of strings is met. Record Table Format Code:
0x00000000 unsigned int File Path String Id 0x00000004 unsigned int String Length 0x00000008 char[] String (Record Type) [String is not null terminated!] 0x000000?? unsigned int Record Data Position 0x000000?? unsigned int Record Data Length (Compressed) 0x000000?? unsigned int Record Data Length (Decompressed) 0x000000?? unsigned int64 Record File FILETIME Before you can read the record data, you must decompress it. Grim Dawn uses LZ4 decompression. If you need a working library that is tested to work with the Grim Dawn files, you can use: - C/C++ : http://code.google.com/p/lz4/ - C# : https://lz4net.codeplex.com/ To decompress the data, use the compress and decompressed sizes known from the record table entry for this data object. Once decompressed, the format is: Code:
0x00000000 unsigned short Data Type [See Below] 0x00000002 unsigned short Value Count 0x00000004 unsigned int String Key Id 0x00000008 unsigned int Value [To be read as int/float/bool as needed.] Code:
-> 0x0000 == Int32 Value -> 0x0001 == Float Value -> 0x0002 == String Value [Value will be index inside of string table of the string.] -> 0x0003 == Boolean Value The rest of the file is 4 DWORDs at the end. I am uncertain what they do. I know where the game references them while loading the database but they are not used in any type of compares or checks. They are simply loaded and moved to a buffer. Afterward they never seem to be touched. Special thanks to Shalie for his/her notes on some parts of the file I was stuck with. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Access Database Program | robotics0 | General Discussion | 7 | 02-07-2017 18:08 |
[C++] Grim Dawn Archive File Extractor (.arc) | atom0s | Source Code | 0 | 01-16-2015 14:05 |
Database programming in C++ | hmora | General Discussion | 1 | 07-12-2004 09:48 |