Rex File Format Specification

Version 2, Revision 1 (V2R1)

 

Copyright Avishkar Autar, 2005-2006

 

Physical Layout:

 

Header

File Data

Directory List

File Lists

 

Header:

V2R1: the integer types for the header variables are unsigned

V2R1: added 4096 bytes of reserved space

V2R1: added version number field

 

Header

Variable

Type

Description

magicNum

uint32

magic num = 1919252529

versionMajor

uint64

Major version number = 2

versionMinor

uint64

Minor version number (i.e. revision number) = 1

numFiles

uint64

number of files in the file list

numDirs

uint64

number of directories in the directory list

offsetDirList

uint64

offset to start of directory list

offsetFileList

uint64

offset to start of file lists

offsetFileData

uint64

offset to start of file data

reserved

byte[4096]

reserved space

 

Directory List:

Note: Directory list is sorted in alphabetical order by path.

Note: A sequential run through of fileIndex[] gives the filenames of the files in the directory in alphabetical order.

 

DEPRECATED: Note: A char is a 2 byte UNICODE (UTF-16LE) character.

V2R1: path is a byte array of UTF-8 code points; [possible breaking change with previous version of rex files]

V2R1: numFiles and fileIndex[] are unsigned integers

V2R1: added 32 bytes of reserved space

 

Directory List

Variable

Type

Description

path

byte[1024]

full path of directory

numFiles

uint64

number of files in this directory

fileIndex

uint64[numFiles]

indices of firsts in this directory

reserved

byte[32]

reserved space

 

 

File List:

Note: For compressed files, the md5hash is that of the uncompressed file

Note: A char is a 2 byte UNICODE (UTF-16LE) character.

Note: File List is NOT sorted!!!

V2R1: filename is a byte array of UTF-8 code points; [possible breaking change with previous version of rex files]

V2R1: index, offset, filesize, and lastModDT integers are unsigned

V2R1: added 32 bytes of reserved space

 

File

Variable

Type

Description

filename

byte[1024]

name of file (not the full path)

indexParentDir

uint64

index of file's parent directory

compressionType

byte

compression type

offsetFileStart

uint64

offset to start of file data

fileSize

uint64

size of file

md5hash

byte[16]

md5 hash of file

lastModDT

uint64

date and time of last modification

reserved

byte[32]

reserved space

 

 

Additional Structures:

 

lastModDT

 

byte# (little-endian)

data

7

year

6

month

5

day

4

hour

3

min

2

sec

1

ms

0

ms

 

 

Compression Types

Value

Description

0

No compression

 

 

COMPRESSION TYPES WILL BE ADDED AS COMPRESSION METHODS ARE ADDED TO REXUTIL