Extracting .dag from .grp files [War Thunder]

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
dimis9138
Posts: 12
Joined: Fri Jun 11, 2021 12:41 pm

Extracting .dag from .grp files [War Thunder]

Post by dimis9138 »

This is about war thunder, I was wondering if there's any tools available that extract dag files from .grp files that come with the game? Looked around but couldn't find anything.

Sample files: https://mega.nz/file/othiGCaQ#6DnSsI3fn ... ALjXr1bXE0
grandshot
Posts: 42
Joined: Mon Jun 07, 2021 8:20 pm

Re: Extracting .dag from .grp files [War Thunder]

Post by grandshot »

It's regular Dagor Engine GRP2 archive and can be successfully extracted with script below. But filenames exclude extensions, so identifying of file types may be a bit hardly.

Code: Select all

# Dagor Engine GRP2 Archives: War Thunder, Crossout
# script for QuickBMS http://quickbms.aluigi.org

Comtype ZSTD
IDString "GRP2"

Get grp2Size Asize

Get dataHeaderSize Long
Get dataHeaderSize Long
Get dataSize Long

Get offsetStrings Long
Get numStrings Long
Get unknown Long
Get unknown Long

Get offsetTables Long
Get numTables Long
Get unknown Long
Get unknown Long

Get offsetTables2 Long
Get numTables2 Long
Get unknown Long
Get unknown Long

For I = 1 to numStrings
   GoTo offsetStrings
   Get offsetName Long
   SavePos offsetStrings
   
   GoTo offsetName
   Get nameFile String
   PutArray 0 I nameFile
Next I

GoTo offsetTables
For I = 1 to numTables
   Get unknown Short
   Get unknown Short
   Get offset Long
   Get nameId Short
   Get unknown Short
   
   Math nameId + 1
   PutArray 1 I offset
   PutArray 2 I nameId
Next I

For I = 1 to numTables
   GetArray offset 1 I
   GetArray nameId 2 I
   GetArray nameFile 0 nameId
   
   if I < numTables
      XMath nextTableId "I + 1"
      GetArray nextOffset 1 nextTableId
      XMath size "nextOffset - offset"
   else
      XMath size "grp2Size - offset"
   endif
   
   Log MEMORY_FILE offset size
   
   Get sign Long MEMORY_FILE
   if sign == 0xFD2FB528
      Clog nameFile 0 size 1000000000 MEMORY_FILE
   else
      Log nameFile 0 size MEMORY_FILE
   endif
Next I