Skip to content

Instantly share code, notes, and snippets.

@phrohdoh
Created November 6, 2014 20:39
Show Gist options
  • Save phrohdoh/4186ec07191c2e3d3221 to your computer and use it in GitHub Desktop.
Save phrohdoh/4186ec07191c2e3d3221 to your computer and use it in GitHub Desktop.
Age of Empires 1 and 2 DRS archive format/specification

Age of Empires DRS Archives

Files in a DRS archive do not have "names" in the typical sense.

They have an ID and an extension.

##DRS Format

###Header

The DRS header contains a copyright string, a version string,
an archive type string, the number of embedded files,
and the offset of the first embedded file from the start of the DRS archive.

Total: 64 bytes

Length C# Type Description
40 bytes string Copyright Info
4 bytes string File Version
12 bytes string Archive Type
4 bytes int Table Count
4 bytes int 1st File Offset

####Output for interfac.drs: Copyright (c) 1997 Ensemble Studios.
1.00
tribe
4
2212
Note that after the tribe string there should be 7 "C String-Terminators" (\0).


###Table Headers Files are sorted by their file extension into 'tables'.
This makes extracting specific file types easier since each table only contains a single file type.

####Table headers are laid out like so: Total: 12 bytes

Length C# Type Description
1 bytes byte Related to file type
3 bytes string Extension (reversed)
4 bytes int Table Offset
4 bytes int File Count

###Tables At the start of each table is n groups of data related to the files in this table (where n is File Count).

####File Info Total: 12 bytes

Length C# Type Description
4 bytes int File ID
4 bytes int File Offset
4 bytes int Table Size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment