﻿UOP Fileformat ( aka Mythic Package )
---------------------------------------
	--Draft 0.2 - Kelon & SENE --

(Every Offset value is its first evidence as example)
All values are stored in Little Endian sequence, as usual in x86 architecture.
Compression method is DEFLATE using zlib.

sizeof(DWORD) = 4 
sizeof(QWORD) = 8

[1] - General Format Header (sizeof: 40bytes )
Byte 0x0 - 0x17 -> Containing general file headers (Version etc.)
DWORD? 0x18 -> Amount of contained files/indexes

[2] - Index Block Header (sizeof: 24bytes)
There can be multiple index blocks, they are splitted into chunks.
DWORD 0x28 -> Amount of contained files in this index, max 100/0x64
QWORD 0x2c -> Offset to the next index block header OR Zero
QWORD 0x34 -> Offset to start of Data Block( -> WORD[2] 0x0008 0x0003 )
DWORD 0x3c -> End of header, Form Feed (0x0000000c)
When a index block doesn't contain 100 index definitions, it will be padded with nulls

	[3] - FileIndex Definitions (sizeof: 34bytes )
	DWORD 0x40 -> Lenght of compressed data
	DWORD 0x44 -> Size of decompressed file
	BYTE(12) 0x48 -> UNKNOWN ( Hashkey? Or separate values?)
	WORD  0x54 -> Separator? (always 0x0001)
	DWORD 0x56 -> UNKNOWN
	DWORD 0x5e -> end of definition, Form Feed ( 0x0000000c)
	...this repreats, until all FileIndexes are processed

	[4] - Data Block/File (sizeof: 8+Lenght bytes)
	DWORD 0xd7c -> separator, start of Data ( WORD[2] 0x0008 0x0003 )
	QWORD 0xd80 -> UNKNOWN, possibly a CRC
	BYTE(Lenght) 0xd88 -> compressed data
	...this is repeated until all Files from FileIndexes are processed

repreat until next Index Block=0.


Facets first file is unencrypted and shows the mapsize.


Pseudocode:

[1] - General Format Header (sizeof: 40bytes )

while ( repreatindex ) do
	[2] - Index Block Header (sizeof: 24bytes)

	while ( indexfilenumber~=indexfilecounter ) do
		[3] - FileIndex Definitions (sizeof: 34bytes )
	end
	while ( indexfilenumber~=indexfilecounter ) do
		[4] - Data Block/File (sizeof: 8+Lenght bytes)
	end
end

Feel free to add your own chapters.