uop file format (updated: 1.7.07)

Diskussion und Informationen über UO:KR
Nachricht
Autor
Kons

#46 Beitrag von Kons » 20 Sep 2008 12:20

i can't answer to first question :)

Second :
There's no file stuffed into header, structure is always linear:

Header
-Block[0]
--Indexes[100]
--Datablocks[all]
-Block[n]
--Indexes[100]
--Datablocks[all]

Header is 40
then there's block.filecount and block.NextblockOffset ( int + long = 12 )
then indexes and so on..

Nevir

#47 Beitrag von Nevir » 21 Sep 2008 10:45

Ah, but that's only valid for UO, though? Sorry if I wasn't clear; I'm focused on poking around in the warhammer variant of the format - I suppose it's off topic in a way :(

Assuming I'm being dumb though (not surprising!), take the most recent interface.myp for an example - here's how I'm reading it, at least:

0-39: header
40-511: zero padding
512-647: data block 'header'
648-2543: zlib'd data
2544-36555: first set of indicies (1000 entries)

The strange part is that the first index block at 2556-2589 refers to the data block between 512-2543. And then there's files like nda.myp where they have a data block in the header, but it's not referred to in the index

(also, yell if I need to update the offsets)

Kons

#48 Beitrag von Kons » 21 Sep 2008 17:01

i don't know, i've studied only .uop format :)

Nevir

#49 Beitrag von Nevir » 25 Sep 2008 08:04

Drat - well, I appreciate the help nonetheless :P

rootbender

#50 Beitrag von rootbender » 25 Sep 2008 21:30

I'm looking at Warhammer Online MYP files too, and I can't figure out how Unpacker is calculating where
the next block starts?

http://img516.imageshack.us/img516/3647/test2ti1.png

For example, take data.myp (from Beta, file size is 58184182 bytes).
It has 2433 files. Block size is 1000, so it has 3 blocks (1000,1000,433).

The table offset begins at 891. Now, I can read in the first block ok (0 to 999 files), but I don't
know how to get to the next block?

I had to hex the file to figure out the next block starts at 33939322, but this doesn't immediately
follow the first block.

Code: Alles auswählen

BLOCK 0, FILE 999: (last file in block)
 start_offset: 33938604
  data_offset: 136
    comp_size: 42
  uncomp_size: 64
        hash1: 6B7BF6A5
        hash2: 506FDF03
          crc: 4BC0A9D3
  comp_method: 1
There is some extra file data at 33938782, so next block doesn't immediately follow. Unpacker seems
to handle this without problems, but I can't figure it out.

Kons

#51 Beitrag von Kons » 25 Sep 2008 23:53

this is how i calculated next block offset in my packer :)
( and it works for KR uop)

Code: Alles auswählen

long nextblockoffset = towrite.HeaderSize;
nextblockoffset += C_offset(true, towrite, i);

-----------------------------
           //Calculate Offsets v2.0
        private long C_offset(bool nextblock, R_MythicPackageHeader towrite, int i)
        {
            long offsettodatablock = 0;
            //BlockOffset
            offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].FileCount)).Length;
            offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].NextBlock)).Length;
            for (int j = 0; j < (towrite.Blocks[i]).FileCount; j++)
            {
                //Index Offset
                offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].Files[j].DataBlockOffset)).Length;
                offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].Files[j].HeadLength)).Length;
                offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].Files[j].CompressedSize)).Length;
                offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].Files[j].DecompressedSize)).Length;
                offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].Files[j].FileHash)).Length;
                offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].Files[j].CRC)).Length;
                offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].Files[j].Flag)).Length;

                //DataBlock
                if (towrite.Blocks[i].Files[j].DataBlock != null && nextblock)
                {
                    //calculate offset to compressed data byte[]
                    offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].Files[j].DataBlock.Flag)).Length;
                    offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].Files[j].DataBlock.DataOffset)).Length;
                    offsettodatablock += (BitConverter.GetBytes(towrite.Blocks[i].Files[j].DataBlock.DateTime)).Length;
                    offsettodatablock += (towrite.Blocks[i].Files[j].DataBlock.Data).Length;
                }
            }        
            return offsettodatablock;
        }
        //

rootbender

#52 Beitrag von rootbender » 26 Sep 2008 00:33

Are all block data files (0 to 999) stored sequentially?
(it doesn't look like it)

Because I was hoping to just use the last file in a block to determine the next block offset.

[edit]
Ah, nevermind. I just found out next offset is stored right after block size.
No need to do any calculations. I only need to unpack. :)

Kons

#53 Beitrag von Kons » 29 Jul 2009 09:57

uop in SA has been changed, Malganis know new format (like warhammer one)

tigah
Newbie
Beiträge: 16
Registriert: 17 Jul 2007 21:45

#54 Beitrag von tigah » 29 Jul 2009 11:16

Kons hat geschrieben:uop in SA has been changed, Malganis know new format (like warhammer one)
Yep already noticed that when i tried to unpack the new interfaces ;O

Kons

#55 Beitrag von Kons » 29 Jul 2009 14:25

Code: Alles auswählen

Mythic Package File Format (.UOP)
---------------------------------

[1] Format Header
BYTE  -> 'M'
BYTE  -> 'Y'
BYTE  -> 'P'
BYTE  ->  0
DWORD -> Version
DWORD -> Signature?
QWORD -> Address of the first [2] Block
DWORD -> Max number of files per block
DWORD -> Number of files in this package
BYTE[]-> 0

[2] Block Header
DWORD -> Number of files in this block
QWORD -> Address of the next block

	[3] File Header
	QWORD -> Address of [4] Data Header
	DWORD -> Length of file header
	DWORD -> Size of compressed file
	DWORD -> Size of decompressed file
	QWORD -> File hash
	DWORD -> Adler32 of [4a] Data Header in little endian, unknown in Version 5
	WORD  -> Compression type (0 - no compression, 1 - zlib)
	
	[4] Data Header (Version 4)
	WORD  -> Data type
	WORD  -> Offset to data
	QWORD -> File time (number of 100-nanosecond intervals since January 1, 1601 UTC)
	BYTE (size of compressed file) -> File	

	[4] Data Header (Version 5)
	BYTE[]-> Metadata used by UO patcher

Pseudocode:
[1] Format Header

while ( Address of the next block > 0 )
	[2] File Header

	while ( Max number of files per block )
		[3] File Header
	end

	while ( Number of files in this block )
		[4] Data Header
	end	
end
Thanks to Malganis.

RadstaR
Junior Mitglied
Beiträge: 70
Registriert: 29 Dez 2006 06:22
Kontaktdaten:

#56 Beitrag von RadstaR » 29 Jul 2009 14:44

Thanks

maximus3

#57 Beitrag von maximus3 » 05 Aug 2009 07:41

Kons hat geschrieben:

Code: Alles auswählen

Mythic Package File Format (.UOP)
---------------------------------

[1] Format Header
BYTE  -> 'M'
BYTE  -> 'Y'
BYTE  -> 'P'
BYTE  ->  0
DWORD -> Version
DWORD -> Signature?
QWORD -> Address of the first [2] Block
DWORD -> Max number of files per block
DWORD -> Number of files in this package
BYTE[]-> 0

[2] Block Header
DWORD -> Number of files in this block
QWORD -> Address of the next block

	[3] File Header
	QWORD -> Address of [4] Data Header
	DWORD -> Length of file header
	DWORD -> Size of compressed file
	DWORD -> Size of decompressed file
	QWORD -> File hash
	DWORD -> Adler32 of [4a] Data Header in little endian, unknown in Version 5
	WORD  -> Compression type (0 - no compression, 1 - zlib)
	
	[4] Data Header (Version 4)
	WORD  -> Data type
	WORD  -> Offset to data
	QWORD -> File time (number of 100-nanosecond intervals since January 1, 1601 UTC)
	BYTE (size of compressed file) -> File	

	[4] Data Header (Version 5)
	BYTE[]-> Metadata used by UO patcher

Pseudocode:
[1] Format Header

while ( Address of the next block > 0 )
	[2] File Header

	while ( Max number of files per block )
		[3] File Header
	end

	while ( Number of files in this block )
		[4] Data Header
	end	
end
Thanks to Malganis.
Is there a editor to edit the new uops? I want to include my language files again ;)

TheUndisputed

#58 Beitrag von TheUndisputed » 06 Aug 2009 02:04


RadstaR
Junior Mitglied
Beiträge: 70
Registriert: 29 Dez 2006 06:22
Kontaktdaten:

#59 Beitrag von RadstaR » 15 Aug 2009 14:59

Ok i have problem with MPE 1.02 i trying extract UOP files from UOSA Classic client, but .....

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Stack trace: at Mythic.Package.Zlib.uncompress(Byte[] dest, Int32& destLen, Byte[] source, Int32 sourceLen)
at Mythic.Package.MythicPackageFile.Unpack(BinaryReader source)
at Mythic.Package.MythicPackageFile.Unpack(BinaryReader source, String folder, Boolean fullPath)
at Mythic.Package.MythicPackageFile.Unpack(String folder, Boolean fullPath)
at Mythic.Package.Editor.MainForm.Worker_DoWork(Object sender, DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

Kons

#60 Beitrag von Kons » 16 Aug 2009 23:34

RadstaR hat geschrieben:Ok i have problem with MPE 1.02 i trying extract UOP files from UOSA Classic client, but .....

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Stack trace: at Mythic.Package.Zlib.uncompress(Byte[] dest, Int32& destLen, Byte[] source, Int32 sourceLen)
at Mythic.Package.MythicPackageFile.Unpack(BinaryReader source)
at Mythic.Package.MythicPackageFile.Unpack(BinaryReader source, String folder, Boolean fullPath)
at Mythic.Package.MythicPackageFile.Unpack(String folder, Boolean fullPath)
at Mythic.Package.Editor.MainForm.Worker_DoWork(Object sender, DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
i don't have tried unpacking classic client, buy i'll make this notice to malganis

Antworten